This plugin allows you to capture code coverage report from Clover. Hudson will generate the trend report of coverage.
Configuring Clover Plugin
- Install the clover plugin
- Configure your project's build script to generate clover XML reports
- (Optional) configure your project's build script to generate clover HTML or PDF reports (this plugin prefers HTML reports to PDF). The plugin will not extract any information from these reports, but will use them as a better formatted most recent coverage report when they are available.
- Enable the "Publish Clover Coverage Report" publisher
- Specify the directory where the clover.xml report is generated.
- (Optional) Configure the coverage metric targets to reflect your goals.
Maven Configuration (with freestyle project)
The maven-clover-plugin is one of the plugins that highlights an issue with how Maven 2 handles aggregator goals.
Hudson cannot handle maven aggregator goals with the maven2 project (alpha) project type due to how this project type calls Maven.
In order to obtain multi-module clover reports, you must therefore use the free-style software project project type. In any case, the hudson clover plugin does not currently support the maven2 project (alpha) project type.
In order to ensure that the correct aggregated report is generated, it is necessary to invoke maven multiple times.
- Create the job as a "free-style software project".
- Enable the "Invoke top-level Maven targets" Build.
- Specify the following goals for Maven: (Note the use of the pipe character | to invoke maven three times).
- Enable the "Publish Clover Coverage Report" publisher.
- Depending on your Source Code Management, the clover report directory will either be "target/site/clover" or "module-name/target/site/clover"
- Don't forget to configure the pom.xml to generate the clover.xml report
Maven2, Clover and Multimodule with a <packaging>ear</packaging> child module
The maven2 ear packaging will break if you use the clover goal at any time during the same invokation of maven if you ivoke the package or later phases (as it will see artifacts without a classifier and with the clover classifier, get confused and give up)
To work around this, you should configurer your root pom to include the <packaging>ear</packaging> targets only when you are not using clover... how to do this:
The above... hack... is why it is recommended to invoke maven three times. If you don't need this hack, you could simplify down to two invocations and specify the clover license file location in the pom.xml, i.e. install clover:instrument | -N clover:aggregate clove:site
Upcoming Version 1.7
- Clover processing runs before notifications run, to avoid inconsistency in the build status reporting (JENKINS-1285)
Version 1.5 (17/08/2007)
- Fixed a number of issues relating to rendering of the trend graph when there was no trend present.