Grails:是否可以排除另一个插件的插件依赖项? [英] Grails: is it possible to exclude a plugin dependency of another plugin?

查看:24
本文介绍了Grails:是否可以排除另一个插件的插件依赖项?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 grails 2.2.2 应用程序,并决定使用 cache-ehcache 插件.

I have a grails 2.2.2 app, and have decided to use cache-ehcache plugin.

问题是这个插件依赖于版本为 1.0.0 的缓存插件,而我的应用程序的缓存插件版本为 1.0.1(我认为它是 grails 2.2.2 的默认值).因此,当我尝试编译应用程序时,我总是收到相同的消息:

The problem is that this plugin depends on the cache plugin with version 1.0.0 and my application has the cache plugin version 1.0.1 (i think it is the default for grails 2.2.2). Therefore when i try to compile the app i always get the same message:

You currently already have a version of the plugin installed [cache-1.0.1]. Do you want to update to [cache-1.0.0]? [y,n]

我每次编译应用程序时都必须回答这个问题.我尝试在 .grails/2.2.2/my_project/plugins/cache-ehcache-1.0.0/dependencies.groovyplugin 中将项目插件依赖项更改为 cache-1.0.1.xml 文件.它似乎不起作用.

I have to answer this question every time i compile the application. I tried to change the project plugin dependency to cache-1.0.1 in .grails/2.2.2/my_project/plugins/cache-ehcache-1.0.0/dependencies.groovy and plugin.xml files. It does not seem to work.

我知道可以从插件依赖项中排除 jar,但是否可以排除另一个插件?

I know that it is possible to exclude jars from plugin dependencies but is it possible to exclude another plugin?

我尝试将 BuildConfig.groovy 的部分更改为:

I tried changing the section of BuildConfig.groovy to:

plugins {
    ...  
    compile(':cache-ehcache:1.0.0') { excludes ":cache:1.0.0"}
}

但它似乎仍然不起作用.每次编译应用程序时,我都会遇到同样的问题.

but it still does not seem to work. I get the same question every time i compile the app.

推荐答案

用作

plugins {
    ...  
    compile(':cache-ehcache:1.0.0') { excludes "cache"}
}

这篇关于Grails:是否可以排除另一个插件的插件依赖项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆