Project: clover
Issue CLOV-1254: Add Ant dependendency to com.cenqua.clover:clover maven artifact
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: {noformat} [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: {noformat} Debug logging reveals more information: {noformat} [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] java.lang.Class.getDeclaredFields0(Native Method) [groovyc] java.lang.Class.privateGetDeclaredFields(Unknown Source) ... [groovyc] com.atlassian.clover.instr.java.InstrumentationConfig.loadFromStream(InstrumentationConfig.java:439) [groovyc] com.atlassian.clover.instr.groovy.Grover.newConfigFromResource(Grover.java:241) [groovyc] com.atlassian.clover.instr.groovy.Grover.(Grover.java:210) {noformat} 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.
Story points: 4