here are the required informations :
- SonarQube version: 7.7.0
- Scanner : org.sonarsource.scanner.maven:sonar-maven-plugin:18.104.22.1681
- org.jacoco.jacoco-maven-plugin: 0.8.7
The scanner command is as follow :
mvn -X org.sonarsource.scanner.maven:sonar-maven-plugin:22.214.171.1241:sonar
There is no sonar configuration in the project.
There is jacoco configuration in the project :
<plugin> <groupId>org.jacoco</groupId> <artifactId>jacoco-maven-plugin</artifactId> <version>0.8.7</version> <executions> <execution> <goals> <goal>prepare-agent</goal> </goals> <configuration> <propertyName>jaCoCoArgLine</propertyName> </configuration> </execution> <!-- attached to Maven test phase --> <execution> <id>report</id> <goals> <goal>report</goal> </goals> </execution> </executions> </plugin>
In Sonarqube, the configuration of jacoco is as follow :
JaCoCo Reports / Path to the JaCoCo report files containing coverage data by unit tests. The path may be absolute or relative to the project base directory :
My goal is to publish code coverage (and other metrics) in sonarqube.
When the scanner command is run, everything works fine (bugs, code_smell, etc…) but the code coverage, which is always 0 when used from the Jenkins platform.
When used from my own computer, with the same files (.exec), it is OK.
When the scanner command is executed in Jenkins, the following message is displayed :
“Both ‘sonar.jacoco.reportPaths’ and ‘sonar.coverage.jacoco.xmlReportPaths’ were set. ‘sonar.jacoco.reportPaths’ is deprecated therefore, only ‘sonar.coverage.jacoco.xmlReportPaths’ will be taken into account.”
which is a mystery as no “sonar.coverage.jacoco.xmlReportPaths” has been declared in our configuration.
The files are generated by the plugin without problem, and contain correct informations as the scanner command run from my computer works fine.
I know we are not supposed to use the .exec files any more but I read the .xml reports are not read by SonarQube 7.7, and we cannot update Sonarqube (the team responsible won’t hear it).
Why am I getting this message? Am I missing a configuration somewhere?
Thank you in advance for your answer.