Get code coverage with Atlassian Clover.
The In order to make Sonar use the Clover java code coverage engine, the property "sonar.core.codeCoveragePlugin" must be set to "clover". It can be set in different locations :
- Global settings (Configuration -> Settings -> Core). It will be applied to all Java projects.
- Project settings (Project -> Settings -> Core)
- Build tool setting, for example a Maven property in the pom or a command-line property
Using the clover plugin consists in specifying the Then from the Settings pages, the version of the clover maven to be used , its version and a optionally a license key. In order to do so and integrate as much as possible in the development environment, Sonar provides several solutions
Here is the admin screen for the clover plugin
Centralized in Sonar
and the license key can be defined :
By uploading the license key (clover 1 or clover 2) into Sonar, you benefit from a centralized configuration.
By default, the sonar-plugin-clover1 runs the maven-clover-plugin.
By default, the sonar-plugin-clover2 runs the maven-clover2-plugin.
In case the clover plugin is defined in the pom.xml of your project, Sonar will use the version defined in the pom
Centralized in the pom.xml (only possible for clover2)
The maven clover2 plugin is defined in the pom.xml and it includes the license
<plugin> <groupId>com.atlassian.maven.plugins</groupId> <artifactId>maven-clover2-plugin</artifactId> <version>2.4.2</version> <configuration> <license><\!\[CDATA\[\]\]></license> </configuration></plugin>
Managed in the pom.xml
The maven clover or clover2 plugin is defined in the pom.xml and indicates where to find the license key.
Partially in Sonar
It is possible to simply indicate which version of clover to use in the Sonar interface and to put the license key in the root of each project to be analyzed.
with its attached configuration.
- Problems with GWT - see SONARPLUGINS-1048