7

I recently updated a Grails app to 2.1.0, but when I war the project I get the following error:

java.lang.NoClassDefFoundError: org/codehaus/groovy/transform/powerassert/ValueRecorder

  • Groovy Version 1.7.5
  • Grails Version 2.1.0

Are these two versions compatible?

ataylor
  • 64,891
  • 24
  • 161
  • 189
John Giotta
  • 16,432
  • 7
  • 52
  • 82

1 Answers1

9

No. Grails 1.3.x uses Groovy 1.7, Grails 2.0.x and 2.1.x use Groovy 1.8, Grails 2.2 uses Groovy 2.0 and Grails 2.3 will use Groovy 2.1. You should probably do a grails dependency-report to see what is pulling in Groovy 1.7, and put the appropriate excludes in your BuildConfig dependency declarations.

Ian Roberts
  • 120,891
  • 16
  • 170
  • 183
  • So essentially, it shouldn't matter what version of Groovy is installed on the local machine, correct? – John Giotta Dec 19 '12 at 17:17
  • @JohnGiotta you don't need a separate Groovy installation, Grails bundles its own Groovy jars and doesn't care about any that are installed elsewhere. – Ian Roberts Dec 19 '12 at 17:21
  • Ok, that's what I thought. I tried to Google my issue and only found plug-ins with the same issue I'm experiencing. Thanks! – John Giotta Dec 19 '12 at 17:23
  • @JohnGiotta note that IDEs can sometimes confuse the issue, e.g. the Eclipse Groovy tools have their own groovy JARs separate from the Grails ones and you have to make sure Eclipse is configured with the version of Groovy that matches the one the Grails app expects (at least to the 1.7 vs 1.8 level, point releases not so crucial). – Ian Roberts Dec 19 '12 at 17:24
  • Well, the error is only happening in Bamboo during the war process. --stacktrace simply throws the ClassNotFoundException... difficult to debug – John Giotta Dec 19 '12 at 17:29
  • @JohnGiotta do you get a `groovy-all-1.7*.jar` in your WAR when you do a local `grails war` or does it only happen on the CI server? I know there have been problems in the past around [excluded dependencies still getting into the WAR](http://jira.grails.org/browse/GRAILS-9188), if this is the sort of thing you're seeing I recommend asking on the Grails user mailing list. – Ian Roberts Dec 19 '12 at 17:43