- The tests execution reports have to comply to the JUnit XML format.
- The code coverage reports have to be generated by Cobertura, or JaCoCo (details below).with JaCoCo
You need to give the path of test execution and code coverage reports using the following parameters.
Import tests execution reports (Surefire XML format).
Set the property with a list of comma-separated paths to the directories containing the XML reports.
|sonar.jacoco.reportPaths||Project-wide||target/jacoco.exec, target/jacoco-it.exec (default)|
Import JaCoCo code coverage reports.
Set the property to the path of the JaCoCo .exec reports, merge multiple reports.
(if you are using a version of SonarQube prior to 6.2 please use sonar.jacoco.reportPath property)
Details Further details on using JaCoCo are available in Usage of JaCoCo with Java Plugin . For Cobertura, read the documentation to get more information on how to generate the reports, or you can check the Analyzing with SonarQube Scanner for Maven documentation
A note to Cobertura users
SonarJava does not support import of Cobertura coverage data. A sonar-cobertura plugin exists, however maintenance and support there is entirely community based. More generally speaking, also note that SonarQube provides a tool-agnostic generic solution: Generic Test Data .