This documentation is for Clover 3.2.x View the latest version of

Unknown macro: {spacejump}

or visit the current Clover documentation home page.

(info) This documentation assumes you have already set up your Maven project and created unit tests.

Using the Clover-for-Maven plugin

There are three possible ways of running the plugin:

  1. 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 multi-project environment, you must set the maven.clover.multiproject property to 'true' in your master project. Doing so will automatically gather Clover data from all of your sub-projects, and aggregate them in a master project report.
  2. In two 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 sub-projects in you're in a multi-project environment. You'll then need to call clover:report to generate the reports.
  3. In three 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.
  • No labels