No information about coverage by test

java
sonarqube

(Mikael Petterson) #1

Hi,

SonarQube, 6.7.5.38563
Code Analyzer for Java * 5.7 (build 15470) installed

I have setup for jacoco in pom.xml

I first execute:

mvn -P coverage clean test

and I file is produced under:

…/target/jacoco.exec

Then I run:

mvn sonar:sonar -P sonar4 -Dsonar.report.export.path=sonar-report.json -Dsonar.issuesReport.json.enable=true

From the log I can find:

[INFO] Sensor FindBugs Sensor [findbugs] (done) | time=13069ms
[INFO] Sensor SurefireSensor [java]
[INFO] parsing [/repo/eraonel/git/mje-custom-java-rules/target/surefire-reports]
[INFO] Sensor SurefireSensor [java] (done) | time=90ms
[INFO] Sensor JaCoCoSensor [java]
[INFO] Analysing /repo/eraonel/git/mje-custom-java-rules/target/jacoco.exec
[INFO] No information about coverage per test.
[INFO] Sensor JaCoCoSensor [java] (done) | time=396ms

Do you know what the reason could be for this?

br,

//mikael


(Nicolas Peru) #2

Hi, What is the issue exactly ?
the logs tell you that you won’t have information about which test covered which lines. This is a deprecated feature (as documented in https://docs.sonarqube.org/display/PLUG/Usage+of+JaCoCo+with+SonarJava ). You get this information because you did not configured the junit listener so this is expected as far as I can tell.


(Mikael Petterson) #3

Ok I did not know that it was deprecated. But now I know. Thx for informing me
:blush:

br,

//mikael