2

I'm trying to upgrade from Grails 2.0.3 to 2.2.1 as part of my Happy Trails application.

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

The first thing I struggled with was getting Geb/Spock to work with Groovy 2. I was getting the following error when trying to install plugins or do just about anything.

| 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

I was able to workaround this using the spock instructions for Grails 2.2.

However, now I'm stuck with a strange error where Grails seems to be trying to download articles from a local repository.

$ 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

Here's the diff for my project so far:

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

3
  • Check the geb grails example pull request. This upgrades the example to 2.2.
    – user800014
    Commented Mar 14, 2013 at 13:46
  • Can you run the dependency-report command? If so, look for 'geb-spock' in the dependencies. Grails is looking for it in the wrong package (org.codehaus.geb is the old one), which suggests some stale dependency cache information. Commented Mar 14, 2013 at 13:48
  • Try adding 'legacyResolve true' to the grails.project.dependency.resolution closure. Just to make sure it isn't something with the new resolver.
    – Jeff Beck
    Commented Mar 14, 2013 at 14:24

3 Answers 3

0

Now that I have looked at the source code for the project, I'm going to offer up another suggestion: remove all the plugin entries from application.properties and add the ones you need to BuildConfig.groovy.

I think the big problem here is that geb 0.7.0 is declared in application.properties while 0.9.0-RC-1 is in BuildConfig.groovy. You don't need the svn plugin entry, so don't add that to BuildConfig.groovy. And you will have to upgrade Searchable plugin to 0.6.4.

3
  • The server access error: connection refused seems to be caused by the rateable plugin. I suspected this when I saw localhost in its custom repositories. grails.org/plugins/rateable This worked in 2.0.3. Anyway to suppress this error in 2.2? Commented Mar 14, 2013 at 15:03
  • Turned out to be caused by having geb-spock in BuildConfig.groovy twice. Once with the old package name, once with the new. Removing the old one got me past the issue. Commented Mar 14, 2013 at 15:09
  • Changing the following line to inherits false should solve the repository issue: github.com/jamesward/happytrails/blob/grails2/grails-app/conf/… Commented Mar 14, 2013 at 16:06
0

I can't reproduce for love nor money, but I'll hazard a guess that you have stale dependency information in the Ivy cache. Try moving ~/.grails/ivy-cache to /var/tmp and running grails compile. If that works, you can leave things as they are, or restore the old cache and just delete the geb related directories:

  • ~/.grails/ivy-cache/org.codehaus.geb
  • ~/.grails/ivy-cache/org.gebish
  • ~/.grails/ivy-cache/org.grails.plugins/geb
0

Try deleting (renaming) ~/.grails/2.2.1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.