Get code coverage for Java project and Groovy projects with Atlassian Clover.
- Install the Clover plugin through the Update Center or download it into the SONAR_HOME/extensions/plugins directory
- Restart the Sonar server
License Key and Maven Clover Plugin
From the settings page, the version of the Maven Clover plugin to be used and the license key can be set.
By uploading the license key (clover 1 or clover 2) into Sonar, you will 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 with its attached configuration.
Unit Tests and Code Coverage Reports
Target java version of the source code.
1.4, 1.5 since 2.10
- Problems with GWT - see SONARPLUGINS-1048
To display code coverage data:
- Prior to the SonarQube analysis, execute your unit tests and generate the Clover report.
- Import this report while running the SonarQube analysis by setting the
sonar.clover.reportPathproperty to the path to the Clover report. The path may be absolute or relative to the project base directory.
It is no longer possible to let SonarQube drive the execution of unit tests.