codenarcTest: Compilation failed in Gradle 2.2

After upgrading to Gradle 2.2, I get a lot of stuff like this:

:myapp:codenarcTest
Compilation failed for [SourceFile[/Users/me/src/myapp/src/test/groovy/com/example/MyBuilderTest.groovy]].

Any idea why?

Likely related to this change: http://gradle.org/docs/current/release-notes#codenarc-plugin-groovy-version-changes

Perhaps try to force a Groovy version for the ‘codenarc’ configuration.

I can try that. How do I do it?

Thanks! For reference, I did this:

dependencies {
        codenarc(
            "org.codenarc:CodeNarc:0.22",
            "org.codehaus.groovy:groovy-all:2.3.7"
        )
}