Apache Maven 1.x has reached its end of life, and is no longer supported. For more information, see the announcement. Users are encouraged to migrate to the current version of Apache Maven.

Maven Clover plugin

The Clover plugin is the place where Clover tools 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.

Using the Clover plugin

There are 3 possible ways of running the plugin:

  • All in one: You'll either call the clover goal or add the maven-clover-plugin report to the reports section in your POM. This will instrument your source code, run your project's tests on the cloverified code and generate Clover reports. Note that if you're in a multiproject setup, you must set the maven.clover.multiproject property to true in your master project. Doing so will automatically gather Clover data from all your subprojects and aggregate them in a master project report.
  • In 2 steps: You'll call clover:test which will instrument your source code and run your project's tests on the cloverified code. Alternatively you can call clover:multiproject to run the clover:test goal on all your subprojects in you're in a multiproject setup. You'll then need to call clover:report to generate the reports.
  • In 3 steps: You'll call clover:on followed by whatever other goal you wish (for example maven clover:on war.) This will instrument your source code. Then you'll run any goal that tests your artifacts. For example in the case of a WAR you can use HttpUnit/HtmlUnit to run functional tests. The test of your artifact will fill the Clover database with data. Finally you'll run clover:report to generate the reports.