codenarcTest: Compilation failed in Gradle 2.2

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

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

Any idea why?

Likely related to this change:

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 {