Grails 升级到 2.5.5 - 未解决的依赖关系 - groovy-all 2.4.5

nsh*_*eta 2 grails dependency-management

我正在尝试将我的 grails 应用程序从 2.0.0 升级到 2.5.5,遇到 groovy-all jar 的未解决的依赖关系。BuildConfig.groovy 中的依赖解析器设置为 ivy。另外,位置 %USERPROFILE%/.grails/ivy-cache/org.codehaus.groovy 包含版本 2.4.5 的 groovy-all.jar

Java设置为JDK7

确切错误:org.codehaus.groovy#groovy-all;2.4.5: 在 org.codehaus.groovy#groovy-all;2.4.5: 'master' 中找不到配置。org.grails#grails-core;2.5.5 编译需要它

BuildConfig.groovy

grails.project.dependency.resolver = "ivy"

repositories {
    mavenRepo "link to company specific repo"
    mavenCentral()
}


plugins {
    runtime ":hibernate4:4.3.10"
    runtime ":jquery:1.7.1"
    runtime ":resources:1.1.5"
    runtime ":bubbling:1.5.1"
    runtime ":calendar:1.2.1"
    runtime ":code-coverage:1.1.6"
    runtime ":jsecurity:0.3"
    runtime ":tomcat:7.0.42"
    runtime ":webflow:1.3.7"
    runtime ":webtest:1.1.5.1"
    runtime ":yui:2.8.2.1"

    build ":tomcat:7.0.70"
}
Run Code Online (Sandbox Code Playgroud)

请帮忙。如果需要任何其他详细信息,请告诉我。

nsh*_*eta 5

在花了很多时间寻找这个问题的原因之后,我遇到了 Grails 版本 2.5.5 中报告的问题(https://github.com/grails/grails-core/issues/10011)所以在进入我的项目之前,尝试了执行基本的 grails 命令“grails-createapp”。该命令也因上述问题中提到的错误而失败。

我们案例中的解决方案是

     1. Remove Grails version 2.5.5 (if this is already installed)
     2. Download/install Grails version 2.5.4
     3. Run basic command grails-createapp. This runs fine and an app is created.
     4. Remove Grails version 2.5.4
     5. Install Grails version 2.5.5 now
     6. Run command - grails createapp (this starts working now)
Run Code Online (Sandbox Code Playgroud)

奇怪的问题:)

  • 确实是一个奇怪的人。可以通过将 _BuildConfig.groovy_ 中的依赖解析器设置为 _maven_ 来“解决”问题,无论如何,生成文件中的默认值,但是调用“create-app”时没有文件,并且没有配置的默认解析器是 _ivy_ ,这似乎在这个 grails 版本中有些 bug。我在您链接到的问题下发布了更多解释:https://github.com/grails/grails-core/issues/10011#issuecomment-245138488 (2认同)