2013-03-14 96 views
2

我试图从Grails 2.0.3升级到2.2.1,作为我的Happy Trails应用程序的一部分。从Grails 2.0.3升级到2.2.1:服务器访问错误:连接被拒绝

https://github.com/jamesward/happytrails/tree/grails2

我是越来越盖布/斯波克挣扎的第一件事用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 

下面是我的项目的DIFF至今:

https://gist.github.com/mraible/5161209

+0

检查[GEB的grails例如拉入请求(https://github.com/geb/geb-example-grails/pull/7/文件)。这将该示例升级到2.2。 – 2013-03-14 13:46:36

+0

你可以运行'dependency-report'命令吗?如果是这样,请在依赖关系中查找“geb-spock”​​。 Grails正在寻找它在错误的包(org.codehaus.geb是旧的),这表明一些陈旧的依赖性缓存信息。 – 2013-03-14 13:48:17

+0

尝试将“legacyResolve true”添加到grails.project.dependency.resolution闭包中。只是为了确保它不是新的解析器。 – 2013-03-14 14:24:32

回答

0

现在,我已经看过了项目的源代码,我m会提出另一个建议:从application.properties中删除所有插件条目,并将您需要的插件添加到BuildConfig.groovy

我认为这里最大的问题是在application.properties中声明geb 0.7.0,而0.9.0-RC-1在BuildConfig.groovy中。您不需要svn插件条目,因此请勿将其添加到BuildConfig.groovy。你将不得不将可搜索插件升级到0.6.4。

+0

服务器访问错误:拒绝连接似乎是由可评价插件引起的。当我在自定义存储库中看到localhost时,我怀疑这一点。 http://grails.org/plugins/rateable这工作在2.0.3。无论如何要压制在2.2这个错误? – 2013-03-14 15:03:18

+0

原来是由BuildConfig.groovy中的geb-spock两次造成的。一旦与旧的包名称,一次与新的。除去旧的问题让我不知所措。 – 2013-03-14 15:09:37

+0

将以下行更改为'inherits false'应解决存储库问题:https://github.com/jamesward/happytrails/blob/grails2/grails-app/conf/BuildConfig.groovy#L19 – 2013-03-14 16:06:20

0

我无法重现的爱,也没有钱,但我会大胆地猜测,你有过时的依赖信息常春藤缓存。尝试将~/.grails/ivy-cache移动到/var/tmp并运行grails compile。如果这样的作品,你可以留下的东西,因为他们,或恢复旧的缓存,只是删除了创业板相关的目录:

  • 〜/ .grails /常春藤缓存/ org.codehaus.geb
  • 〜/ .grails /常春藤缓存/ org.gebish
  • 〜/ .grails /常春藤缓存/ org.grails.plugins /创业板
0

尝试删除(重命名)〜/ .grails/2.2.1

相关问题