Does Grails 2.1.0 Require Groovy 1.8?
Asked Answered
E

1

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?

Emptor answered 19/12, 2012 at 16:20 Comment(0)
V
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.

Vimineous answered 19/12, 2012 at 16:47 Comment(6)
So essentially, it shouldn't matter what version of Groovy is installed on the local machine, correct?Emptor
@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.Vimineous
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!Emptor
@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).Vimineous
Well, the error is only happening in Bamboo during the war process. --stacktrace simply throws the ClassNotFoundException... difficult to debugEmptor
@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, if this is the sort of thing you're seeing I recommend asking on the Grails user mailing list.Vimineous

© 2022 - 2024 — McMap. All rights reserved.