Grails插件获取同一版本

时间:2016-05-04 06:01:10

标签: grails

我的grails应用程序中安装了grails rest-client-builder插件。 早些时候我有1.0.3,但现在我将BuildConfig.groovy中的版本更改为2.1.1

现在我收到以下奇怪的消息:

|Environment set to development
.................................
|Packaging Grails application
You currently already have a version of the plugin installed [rest-client-builder-1.0.3]. Do you want to upgrade to [rest-client-builder-2.1.1]? [y,n] y
y
.
|Installing zip rest-client-builder-2.1.1.zip...
...
|Installed plugin rest-client-builder-2.1.1
..............You currently already have a version of the plugin installed [rest-client-builder-2.1.1]. Do you want to downgrade to [rest-client-builder-1.0.3]? [y,n] 

现在我的问题是为什么我要在同一个版本中将消息降级到1.0.3?

我怀疑这与一些奇怪的错误有关(比如预期的单元测试框架退出,这在升级之前没有发生)。

PS:当再次放回1.0.3版本时,我只是得到了降级的消息。所以当我把更高版本放进去时,我想知道什么是错的。

1 个答案:

答案 0 :(得分:0)

我不确定这是否适合您,但您可以运行grails depedency-report命令,看看是否有任何内容需要旧版本。如果是这样升级其他插件如果不是这样,请确保BuildConfig中没有任何引用到1.0.3。这是我的BuildConfig:

 plugins {
        build(":release:3.0.1", ":rest-client-builder:2.1.1", ":tomcat:7.0.54") {
            export = false
        }
        runtime ":console:1.5.4"
        runtime ':db-reverse-engineer:0.5'
        runtime ":hibernate:3.6.10.16"
        compile ":scaffolding:2.0.3"
        runtime ":jquery:1.11.1"
        compile ":jquery-ui:1.10.4"     
        compile ":mail:1.0.7"
        compile ":cache-headers:1.1.7"
        compile ":rest-client-builder:2.1.1"
    }

当我遇到这个问题时,我意识到我有了rest-client-builder:1.0.3在build部分列出,在编译中我有2.1.1。它在我眼前,我不会看到它。

你也可以试着干净利落。此外,从C:\ Users \ your_user \ .m2 \ repository \ org \ grails \ plugins \ rest-client-builder

删除.m2文件夹中的所有插件

然后在BuildConfig中使用2.1.1版本执行grails refresh-dependencies。我正在运行grails版本2.3.11对于早于grails 2.3,你会遇到早期版本。