This documentation is for Clover 3.3.x. Earlier versions are available here.

Skip to end of metadata
Go to start of metadata

The Maven 2 and 3 Clover plugin produces Clover reports from Maven 2 and 3 projects.

Maven Site Documentation

Icon

For documentation presented in the standard Maven format, see the Maven Site Docs.

 

On this page:

Basic Usage

How to quickly set up basic Clover configuration in settings.xml and pom.xml and run Clover's goals from a command line.

Configuring instrumentation

How to set which source files shall be instrumented, control level of instrumentation, set JDK level and location of coverage data.

Configuring reports

How to choose report formats, generate historical reports and customize report content.

Configuring a coverage goal

How to set a coverage level as a quality gate and fail a build if it drops below certain threshold or drops compared to a previous build.

Using Test Optimization

Working with distributed systems

Working with multi-module projects

You can use the clover2:aggregate goal to combine the Clover databases of child projects into a single database at the parent project level.

You can also create a single database for all modules with singleCloverDatabase parameter set to true in clover2:setup goal.

Because of this Maven bug, aggregation of databases occurs before the child databases have been generated, when you use the site target.

You can create Clover reports for a multi-module project with the command line mvn clover2:setup test clover2:aggregate clover2:clover.

Best practices

Using Clover with other Maven plug-ins

  • No labels

5 Comments

  1. not sure if this is the time or place but your maven site docs link above still points at 3.0.2.  It would be good if there was some way to know what the latest version of your maven plugin was.

    1. fixed. sorry about that. the latest version is 3.1.4 (3.1.5 being released this week).

  2. There is a remark about the historyDir parameter saying to set it to:

    This was actually not a very good idea in our case, since the artifact name contained bamboo build number, in effect breaking history generation as it was creating a history dir for each new build.

    It is safer to set it to something more static like:

    1. Hi Radek! Thanks for the tip. Please note however, that the project.artifact in general does not contain a Bamboo build number and the location suggested by you (user.home/clover/history) would be common for all Bamboo plans, which might not be desired. Cheers!

  3. I have just been adding historical coverage reporting for my project, it looks like you need to do clover2:save-history before running clover2:clover.