Description
Problem occurs in Gradle framework. When developer declares dependency to Clover artefact and tries to instrument project with Clover, it fails with a not-very-informative error:
[clover-setup] Detected groovyc compiler org.codehaus.groovy.ant.Groovyc [groovyc] Compiling 1 source file to ....... [groovyc] ERROR: Clover-for-Groovy encountered an error while loading config:
Debug logging reveals more information:
[groovyc] ERROR: Clover-for-Groovy encountered an error while loading config: Clover-for-Groovy encountered an error while loading config: : org/apache/tools/ant/BuildException [groovyc] java.lang.NoClassDefFoundError: org/apache/tools/ant/BuildException [groovyc] at java.lang.Class.getDeclaredFields0(Native Method) [groovyc] at java.lang.Class.privateGetDeclaredFields(Unknown Source) ... [groovyc] at com.atlassian.clover.instr.java.InstrumentationConfig.loadFromStream(InstrumentationConfig.java:439) [groovyc] at com.atlassian.clover.instr.groovy.Grover.newConfigFromResource(Grover.java:241) [groovyc] at com.atlassian.clover.instr.groovy.Grover.<init>(Grover.java:210)
A reason is that normally this code is being called from Ant so the ant.jar is provided. In Gradle it's not available by default.
Workaround: add ant.jar dependency in the project build file.
Attachments
Issue Links
- mentioned in
-
Page Loading...