It is important to note that I have tried it on a regular ( not multimodule ) maven project and it import works fine.
I ran with --debug and I could see the following:
INFO] 17:29:07.901 ------------- Scan myproj
[INFO] 17:29:07.904 Base dir: /repo/eraonel/git/myproj
[INFO] 17:29:07.904 Working dir: /repo/eraonel/git/myproj/target/sonar
[INFO] 17:29:07.905 Source paths: pom.xml
[INFO] 17:29:07.905 Source encoding: UTF-8, default locale: en_US
[DEBUG] 17:29:07.919 Declared extensions of language JSP were converted to sonar.lang.patterns.jsp : **/*.jsp
[DEBUG] 17:29:07.919 Declared extensions of language Java were converted to sonar.lang.patterns.java : **/*.java,**/*.jav
[INFO] 17:29:07.919 Language is forced to java
[DEBUG] 17:29:07.920 Initializers :
[INFO] 17:29:07.920 Index files
[WARNING] 17:29:07.921 File '/repo/eraonel/git/myproj/pom.xml' is ignored because it doesn't belong to the forced language 'java'
[INFO] 17:29:07.921 0 files indexed
[DEBUG] 17:29:07.937 'jsp' skipped because there is no related file in current project
[DEBUG] 17:29:07.937 'FindBugs Sensor' skipped because there is no related file in current project
[DEBUG] 17:29:07.937 'Import of Checkstyle issues' skipped because there is no related file in current project
[DEBUG] 17:29:07.937 'Import of PMD issues' skipped because one of the required properties is missing
[DEBUG] 17:29:07.937 'Import of SpotBugs issues' skipped because there is no related file in current project
[DEBUG] 17:29:07.937 'SurefireSensor' skipped because there is no related file in current project
[DEBUG] 17:29:07.937 'JaCoCoSensor' skipped because there is no related file in current project
[DEBUG] 17:29:07.937 'JavaSquidSensor' skipped because there is no related file in current project
[DEBUG] 17:29:07.943 'jsp' skipped because there is no related file in current project
[DEBUG] 17:29:07.969 'Import of Checkstyle issues' skipped because one of the required properties is missing
[DEBUG] 17:29:07.969 'Import of PMD issues' skipped because one of the required properties is missing
[DEBUG] 17:29:07.980 'Import of SpotBugs issues' skipped because one of the required properties is missing
[DEBUG] 17:29:08.004 Sensors : JaCoCo XML Report Importer -> SonarJavaXmlFileSensor
I guess JaCoCoSensor is the plugin reading jacoco.exec but here it fails for some reason.
is not at all a good behavior in open community and is not a best way to get attention of its members.
Nevertheless given the provided information from these threads, I would advice you to read following answer:
which IMO explains pretty well how JaCoCoSensor in Java SonarQube Plugin collects jacoco.exec files specified by sonar.jacoco.reportPath property and associates them with code in case of multi-module Maven projects.
And additionally to pay attention that JaCoCo XML Report Importer refers to another sensor - to recently released GitHub - SonarSource/sonar-jacoco: SonarQube JaCoCo Plugin that instead of exec files reads XML file(s) specified by sonar.coverage.jacoco.xmlReportPaths. But the rest of mechanics remain the same - SonarQube performs analysis of one module after another, during which one sensor reads XML file(s) and another sensor reads exec file(s) specified in corresponding property of corresponding module, and associates coverage data from these file(s) with source files in this module.
If all the above doesn’t help, and given that
while this works for others, I would highly advise you to reconsider approach and instead of questions provide complete example of project and its configuration to clearly demonstrate your difficulty. Because unlikely that someone can blindly correctly guess what is wrong based on the information that you provide so far. And here is example of how concrete complete examples are useful and helpful - No Coverage despite unit tests on an open source project - #2 by Godin
Hi @Godin
Sorry about posting so many times.
I guess it was frustration over not receiving any replies and googling did not show an example that worked for me.
Reading that so many people had problems with this did not make it easier…
Anyhow I checked what is in the eclemma project and tried to apply it to our project.
I executed:
I was expecting results to be pushed to sonar but it is not. So nothing at all is pushed to sonar.
As said before when running this for a non-multimodule project I get the following in log:
[DEBUG] 08:34:28.999 Upload report
[DEBUG] 08:34:29.128 POST 200 http://10.220.250.130/sonar/api/ce/submit?projectKey=anotherProject&projectName=Custom%20Rules | time=127ms
[INFO] 08:34:29.130 Analysis report uploaded in 131ms
[INFO] 08:34:29.132 ANALYSIS SUCCESSFUL, you can browse http://10.220.250.130/sonar/dashboard/index/anotherProject
[INFO] 08:34:29.132 Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
[INFO] 08:34:29.132 More about the report processing at http://10.220.250.130/sonar/api/ce/task?id=AWZSYlMjOTyY5R0Eu58t
[DEBUG] 08:34:29.133 Report metadata written to /repo/eraonel/git/anotherProject/target/sonar/report-task.txt
[DEBUG] 08:34:29.136 Post-jobs :
[INFO] 08:34:29.150 Task total time: 13.295 s
So why is the data not pushed for a multimodule project?
Because for this particular analysis you do not perform full analysis:
[INFO] 14:18:41.655 Issues mode
[WARNING] 14:18:41.655 The use of the issues mode (sonar.analysis.mode=issues) is deprecated. This mode will be dropped in the futu
re.
@Godin So what mode shall I use to get this working? Or maybe @ganncamp knows. And why did it work for a non-modular maven project with the same command for doing the analysis?