|
Plugin Information
This plugin allows you to capture code coverage reports from Clover. Hudson will generate and track code coverage across time. This plugin can be used without the need to modify your build.xml. Scriptless Integration for Ant Builds
Manually Configuring Clover Plugin
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. Short answer:
install
-Dmaven.test.failure.ignore=true
|
-Dclover.license.file=path-to-clover-license
clover:instrument
clover:aggregate
|
-Dclover.license.file=path-to-clover-license
-N
clover:aggregate
clover:clover
Maven2, Clover and Multimodule with a <packaging>ear</packaging> child moduleThe 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:
<project>
...
<profiles>
...
<profile>
<id>running-clover</id>
<activation>
<property>
<name>clover.license.file</name>
</property>
</activation>
<build>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-clover-plugin</artifactId>
<configuration>
<licenseLocation>${clover.license.file}</licenseLocation>
<generateHtml>true</generateHtml>
<generateXml>true</generateXml>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>
<profile>
<id>not-running-clover</id>
<activation>
<property>
<name>!clover.license.file</name>
</property>
</activation>
<modules>
<module>my-ear-artifact</module>
<!-- list any other ear child modules here -->
</modules>
</profile>
...
</profiles>
...
</project>
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 Version HistoryVersion 3.0.2
Version 3.0.1
Version 2.6.3
Version 2.5
Version 2.4 (skipped) Version 2.3
Version 2.2
Version 2.1
Version 1.7
Version 1.5 (17/08/2007)
|






Comments (3)
Sep 28, 2010
Peter Kreidermacher says:
Hello, I have Clover set up in a m2 style project in Hudson. The setup wasn't t...Hello,
I have Clover set up in a m2 style project in Hudson. The setup wasn't too difficult and it seems to work on the two that I did.
All that needs to be added to the pom is this:
<plugin> <groupId>com.atlassian.maven.plugins</groupId> <artifactId>maven-clover2-plugin</artifactId> <version>3.0.2</version> <configuration> <licenseLocation>${maven.clover.licenseLocation}</licenseLocation> <generateHtml>true</generateHtml> <generateXml>true</generateXml> </configuration> </plugin>Then configure the projects "Goals and options" with this:
-Dmaven.clover.licenseLocation=path/to/clover.license clover2:setup install clover2:aggregate clover2:clover
Then simply select to Public Clover Coverage Reports just like the other setups.
Since it is possible to run these with m2 projects, would it be possible to get a link to the reports put on the main page menu of an m2 projects like they are for freestyle projects?
Thanks,
Peter
Nov 14, 2010
Anirudh Zala says:
Recently we have started to use this plugin. But we have found 2 problems with t...Recently we have started to use this plugin. But we have found 2 problems with this. 1: issue #5881 and 2: "Coverage Breakdown by Package" have some links on columns but they are not expanded. Seems YUI related issue?
Mar 02, 2011
Damien Gallagher says:
Hi I have a quick question about this plugin in Hudson. Is it possible in hudso...Hi
I have a quick question about this plugin in Hudson.
Is it possible in hudson to specify a property to exclude certain packages and/or classes from being run though Clover?
Thanks
Damien