This server will be upgraded at 3pm Sydney time on December 3rd (December 2nd, 8pm PST) and will be down for up to 30 minutes.

Installing from build.xml

Clover 2.1 Documentation

Index

This is the recommended method of installing Clover.

Adding Clover to your build is done by adding the following to your buildfile (e.g. build.xml), where 'path/to' is the relevant path:

<taskdef resource="cloverlib.xml" classpath="/path/to/clover.jar">

Checking if Clover is available for the build

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 <available> task:

<target name="-check.clover">
<available property="clover.installed"
classname="com.cenqua.clover.CloverInstr" />
</target>

<target name="guard.noclover" depends="-check.clover" unless="clover.installed">
<fail message="The target you are attempting to run requires Clover, which doesn't appear to be installed"/>
</target>

<target name="with.clover" depends="guard.noclover">
...

Troubleshooting

  • To enable logging of the Clover installation, set the environment variable ANT_OPTS to '-Dclover.debug=true'
  • Run ant with the -debug and -verbose options
  • Certain environments may require the clover.jar to be placed directly on Ant's Classpath. Details are outlined here.
  • Run the <clover-env/> task to display Ant and Clover runtime information




NEXT STEP

See Best practices for Ant integration

Labels:

ant_opts ant_opts Delete
logging logging Delete
clover-env clover-env Delete
build build Delete
ant ant Delete
installation installation Delete
clover clover Delete
Enter labels to add to this page:
Wait Image 
Looking for a label? Just start typing.