Grails application with Clover fails with java.lang.VerifyError
Symptoms
Your application is using the Clover-for-Grails plugin. Compilation fails with the java.lang.VerifyError exception.
For example:
$ grails test-app -clover.on
...
build Clover: Clover is enabled. Configuration: [on:true, debug:[:], verbose:[:]]
...
build | Error Exception occurred trigger event [SetClasspath]: java.lang.VerifyError: (class: com/atlassian/clover/ant/tasks/AbstractCloverTask, method: init signature: ()V) Incompatible argument to function (NOTE: Stack trace has been filtered. Use --verbose to see entire trace.)
Cause
Your application is using some Grails plugin, which has a dependency on the Clover plugin and this dependency is being exported outside the plugin. As a consequence this Clover plugin becomes available to your application as well. At the same time you have a Clover dependency defined in your application's BuildConfig too. In case when these two dependencies refer to different Clover versions, it may lead to conflicts.
myApp -> somePlugin -> clover version A
-> clover version B
Resolution
1) If you own the plugin which has an invalid dependency, fix it's BuildConfig.groovy and add "export = false" in the Clover dependency. See Creating Grails plugins using Clover for details.
2) If you don't own the plugin, then exclude the transitive dependency to Clover in your application's BuildConfig.groovy. For example:
grails.project.dependency.resolution = {
plugins {
compile(":somePluginWithInvalidDependency:1.0.0") {
excludes "clover" // exclude clover in wrong version
}
compile(":clover:3.2.0") // use the desired version
}
}