The Clover plugin is the place where build actions related to Clover are found in Maven.
Clover is a tool that generates Test Coverage reports. It is free for non-commercial use. If your project is a commercial project you will need to get a license for the Clover jar before using this plugin. Please note that an evaluation license is included in this plugin.
The Clover plugin currently supports the following features:
Note that the Clover plugin will not overwrite your main compiled classes nor your main test compiled tests classes. It creates a parallel directory in target/clover in order not to tamper with your main files.
Instructions on how to use Maven Clover Plugin can be found here.
Since Clover 4.1.0 release this plugin is named com.atlassian.maven.plugins:clover-maven-plugin - previously it was com.atlassian.maven.plugins:maven-clover2-plugin. Thus, goals are also named 'clover:xyz', e.g. clover:setup instead of old clover2:setup.
The clover-maven-plugin has seven goals, but only six are called directly by the user. The full description of goals, generated automatically from the source code, is available here.
Note: Do not call this MOJO directly. It is meant to be called in a custom forked lifecycle by the other Clover plugin MOJOs.
Note: We're forking a lifecycle because we don't want the Clover instrumentation to affect the main lifecycle build. This will prevent instrumented sources to be put in production by error. Thus running mvn install on a project where this instrument goal has been specified will run the build twice: once for building the project as usual and another time for instrumenting the sources with Clover and generating the Clover database.
Note: This report mojo should be an @aggregator and the clover:aggregate mojo shouldn't exist. This is a limitation of the site plugin which doesn't support @aggregator reports...
Check the plugin test suite (src/it directory) for example of how to use this plugin.