【发布时间】:2013-03-14 13:17:05
【问题描述】:
作为我的 Happy Trails 应用程序的一部分,我正在尝试从 Grails 2.0.3 升级到 2.2.1。
https://github.com/jamesward/happytrails/tree/grails2
我遇到的第一件事就是让 Geb/Spock 与 Groovy 2 一起工作。我在尝试安装插件或执行任何操作时遇到以下错误。
| Resolving plugin JAR dependencies
| Error WARNING: Dependencies cannot be resolved for plugin [mail] due to error: startup failed:
Could not instantiate global transform class org.spockframework.compiler.SpockTransform specified at jar:file:/Users/mraible/.grails/ivy-cache/org.spockframework/spock-core/jars/spock-core-0.7-groovy-1.8.jar!/META-INF/services/org.codehaus.groovy.transform.ASTTransformation because of exception org.spockframework.util.IncompatibleGroovyVersionException: The Spock compiler plugin cannot execute because Spock 0.7.0-groovy-1.8 is not compatible with Groovy 2.0.7. For more information, see http://versioninfo.spockframework.org
我能够使用spock instructions for Grails 2.2 解决此问题。
但是,现在我遇到了一个奇怪的错误,Grails 似乎正在尝试从本地存储库下载文章。
$ grails compile
| Configuring classpath
:: problems summary ::
:::: ERRORS
Server access Error: Connection refused url=http://localhost:8081/artifactory/plugins-releases-local/org/codehaus/geb/geb-spock/0.9.0-RC-1/geb-spock-0.9.0-RC-1.pom
Server access Error: Connection refused url=http://localhost:8081/artifactory/plugins-releases-local/org/codehaus/geb/geb-spock/0.9.0-RC-1/geb-spock-0.9.0-RC-1.jar
| Error Failed to resolve dependencies (Set log level to 'warn' in BuildConfig.groovy for more information):
- org.codehaus.geb:geb-spock:0.9.0-RC-1
到目前为止,这是我的项目的差异:
【问题讨论】:
-
检查geb grails example pull request。这会将示例升级到 2.2。
-
你能运行
dependency-report命令吗?如果是这样,请在依赖项中查找“geb-spock”。 Grails 在错误的包中寻找它(org.codehaus.geb 是旧包),这表明一些过时的依赖缓存信息。 -
尝试将 'legacyResolve true' 添加到 grails.project.dependency.resolution 闭包中。只是为了确保它与新的解析器无关。
标签: grails grails-plugin spock geb