1
votes

I am getting some error while upgrade. What I did was:

  1. I downloaded Grails 2.3.0.M1, extracted, and changed in Eclipse -> Preferences->Groovy->Grails also.
  2. Changed the Groovy compile 1.8 to 2.0.7
  3. I check out my Grails app from svn, it already working app with Grails 2.14.
  4. I changed this one in BuildConfig.groovy

    forkConfig = [maxMemory: 1024, minMemory: 64, debug: false, maxPerm: 256]
    grails.project.fork = [
       test: forkConfig, // configure settings for the test-app JVM
       run: forkConfig, // configure settings for the run-app JVM
       war: forkConfig, // configure settings for the run-war JVM
       console: forkConfig // configure settings for the Swing console JVM
    ]
    
    grails.project.dependency.resolver = "maven" // or ivy
    
  5. Finally I run grails upgrade, I am getting error like this:

    Error org.sonatype.aether.collection.DependencyCollectionException: Failed to collect dependencies

  6. So, I removed the previous added lines from BuildConfig.groovy.

  7. Now, Grails upgrade, is working fine. But it downloading lot of jars into ivy-cache.

  8. Once the upgrade is done (success). If I add then again I add those lines to BuildConfig.groovy, everything is working fine.

    But, the problem is, I should able to do upgrade in the first time itself. First time even not only upgrade even Grails clean also not working. After upgrade is done only any Grails commands working.

1

1 Answers

0
votes

This issue is due to changes in dependency resolution as explained here:
http://grails.org/doc/2.3.0.M1/guide/upgradingFromPreviousVersionsOfGrails.html

For me, resolving this issue boiled down to these simple steps:

In build.config

1.) Add the following line:
grails.project.dependency.resolver = "maven"

2) Change the plugin dependency version of Tomcat
From: build ":tomcat:$grailsVersion"
To: build ":tomcat:7.0.40.1"

3) Change the plugin dependency version of Hibernate
From: runtime ":hibernate:$grailsVersion"
To: runtime ":hibernate:3.6.10.M3"

As the documentation states:

If you are upgrading from Grails 2.2 you need to manually configure the correct Tomcat and Hibernate plugins in BuildConfig. The upgrade command will not do this for you!

Hope this helps...