This documentation is for Clover 4.1.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

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 clover: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 clover: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 clover:setup test clover:aggregate clover:clover.

Best practices

Using Clover with other Maven plug-ins

  • No labels


  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.

  4. Please let me know, How to generate a consolidated report with multiple save-history xml files (/clover/history folder).

    1. Hi. Just call the clover:clover goal with generateHistorical set to true. 

      1. Hi, included <generateHistorical>true</generateHistorical> in pom.xml file and created save points for 2 builds by using "mvn clover2:save-history clover2:clover".

        Now there are two xml files created in /clover/history folder.

        Please suggest me how to merge these reports collected across multiple builds and converge them to single report.