In order to import Clover's tasks load the cloverlib.xml resource in your build.xml file, e.g.:
WARNING: the <clover-setup> task requires clover.jar to be placed directly on Ant's classpath, otherwise the compilation via <javac> task will fail with an error:
Class not found: com.atlassian.clover.ant.taskdefs.CloverCompilerAdapter
For this reason we recommend installing clover.jar in Ant classpath.
Checking if Clover is available for the build (optional)
In some cases you may want to check if Clover is available before executing Clover-related targets.
For example, you may need to ship the build file to others who may not have Clover installed. To
check Clover's availability you can make use of the standard Ant
- To enable logging of the Clover installation, set the environment variable
- Run ant with the
- Certain environments may require the clover.jar to be placed directly on Ant's Classpath. Details are outlined here.
- To enable logging of Clover at runtime set the environment variable
-Dclover.logging.level=debugon the JVM that is running your Clover instrumented code. e.g. the JUnit JVM, the Tomcat JVM.