Code Analyzer for Java * 5.7 (build 15470) installed
I have a multimodule maven project. I have defined a separate coverage module ( as suggested on jacoco document).
I am trying to import the jacoco coverage files into sonarqube to get unit test coverage showing in sonar.
myproject pom.xml module1 pom.xml module2 pom.xml coverage pom.xml
mvn clean install
I get the following directory created on the same level as the parent pom.xml
2755133 Oct 6 17:28 jacoco.exec
6982975 Oct 6 17:34 jacoco.xml
Then I execute:
mvn -P sonar4 sonar:sonar
When I check the logs I cannot see that
Here is a snippet:
[INFO] ------------- Scan mje [INFO] Base dir: /repo/eraonel/git/myproj [INFO] Working dir: /repo/eraonel/git/myproj/target/sonar [INFO] Source paths: pom.xml [INFO] Source encoding: UTF-8, default locale: en_US [INFO] Language is forced to java [INFO] Index files [WARNING] File '/repo/eraonel/git/myproj/pom.xml' is ignored because it doesn't belong to the forced language 'java' [INFO] 0 files indexed [INFO] Sensor JaCoCo XML Report Importer [jacoco] [INFO] Sensor JaCoCo XML Report Importer [jacoco] (done) | time=531ms [INFO] Sensor SonarJavaXmlFileSensor [java] [INFO] Sensor SonarJavaXmlFileSensor [java] (done) | time=0ms [INFO] Load server issues [INFO] Load server issues (done) | time=329ms [INFO] Performing issue tracking [INFO] 6256/6256 components tracked [INFO] ANALYSIS SUCCESSFUL [INFO] Task total time: 59.654 s
I can see that analysis is done for each module when I run sonar.
[INFO] Sensor JaCoCoSensor [java]
[INFO] Analysing /repo/eraonel/git/myproject/engine/…/target/jacoco.exec
[INFO] No information about coverage per test.
[INFO] Sensor JaCoCoSensor [java] (done) | time=252ms
So my questions are now:
- Why is not sonar executing Sensor JaCoCoSensor [java] on the files that are in, myproject/target?
- Why is sonar not posting the results ( have both jacoco.exec and jacoco.xml) to sonarqube.
Ps . With all the information that you can google I wonder if anyone got this working!