SonarQube, 6.7.5.38563
Code Analyzer for Java * 5.7 (build 15470) installed
I am trying to import the jacoco aggregated-report for my maven multi-module project into sonar.
I tried:
mvn -B clean org.jacoco:jacoco-maven-plugin:0.8.2:prepare-agent install
and then:
mvn sonar:sonar -P sonar4
I can see that the aggregate-report is executed in first step.
— jacoco-maven-plugin:0.8.2:report-aggregate (report-aggregate) @ coverage —
[INFO] Loading execution data file /repo/eraonel/git/helpers/target/jacoco.exec
[INFO] Loading execution data file /repo/eraonel/git/manager/target/jacoco.exec
[INFO] Loading execution data file /repo/eraonel/git/2temp/target/jacoco.exec
[INFO] Analyzed bundle ‘helpers’ with 2033 classes
[INFO] Analyzed bundle ‘regression-tests’ with 328 classes
[INFO] Analyzed bundle ‘manager’ with 1306 classes
[INFO] Analyzed bundle ‘2temp’ with 129 classes
[INFO] Analyzed bundle ‘actions’ with 5047 classes
[INFO] Analyzed bundle ‘extension’ with 25 classes
[INFO] Analyzed bundle ‘engine’ with 207 classes
I my coverage module I set:
<sonar.jacoco.reportPaths>${project.basedir}/target/jacoco.exec</sonar.jacoco.reportPaths>
according to:
https://docs.sonarqube.org/display/PLUG/Code+Coverage+by+Unit+Tests+for+Java+Project
I guess jacoco.exec is a file name and that this is the file that sonar looks for when I run sonar:sonar.
I can see in log something like:
[INFO] Sensor SurefireSensor [java] (done) | time=3346ms
[INFO] Sensor JaCoCoSensor [java]
[INFO] Analysing /repo/eraonel/git/helpers/target/jacoco.exec
[INFO] No information about coverage per test.
[INFO] Sensor JaCoCoSensor [java] (done) | time=2546ms
I check my sonarqube and I cannot see any updates.
However I cannot see:
[INFO] Analysis reports compressed in 421ms, zip size=142 KB
[INFO] Analysis report uploaded in 66ms
[INFO] ANALYSIS SUCCESSFUL, you can browse http:///sonar/dashboard/index
And I double-checked and found that there is no coverage in sonarqube server.
My questions are:
- Is this a directory path, ${project.basedir}/target/jacoco.exec and what will sonar look for in here?
- What should be the format of the aggregated jacoco file?
- Could I get converage in sonarqube without an external coverage file? If yes how?
br,
//mikael