We use Maven to build our apps and have a large number of modules in each of the apps.
I have 2 fold question:
Based on the example project (https://github.com/SonarSource/sonar-scanning-examples/tree/master/sonarqube-scanner-maven/maven-multimodule), this requires a new maven module to be added in order to aggregate reports from all other modules. This is extremely intrusive and hence I would like to know if this is the only recommended approach? If not, Can you please suggest how to aggregate reports without creating a new module?
After adding a new Maven module, I am able to generate the aggregated XML file (jacco.xml) successfully on my local machine. However, Sonar sensor is unable to find the XML file and hence reporting it as ZERO files found for scanning. I am not seeing any analysis reports in SonarQube UI. SonarQube shows that zero files were found in the source code But indicates that analysis was successful.
- sonarqube 8.4.1
- jacoco-maven-plugin : 0.8.6
- maven 3.3.9
- language Java
- openjdk 8 ( source code version)
Parent Pom file setting:
<plugin> <groupId>org.sonarsource.scanner.maven</groupId> <artifactId>sonar-maven-plugin</artifactId> <version>188.8.131.526</version> </plugin> <plugin> <groupId>org.jacoco</groupId> <artifactId>jacoco-maven-plugin</artifactId> <version>0.8.6</version> <executions> <execution> <id>prepare-agent</id> <goals> <goal>prepare-agent</goal> </goals> </execution> </executions> </plugin>
Relevant lines from the verbose log output from executing the command:
mvn -X clean install
mvn -X sonar:sonar -Dsonar.verbose=true
[INFO] 16:44:58.896 ------------- Run sensors on project [DEBUG] 16:44:58.898 'Generic Coverage Report' skipped because one of the required properties is missing [DEBUG] 16:44:58.899 'Java CPD Block Indexer' skipped because there is no related file in current project [DEBUG] 16:44:58.899 Sensors : Zero Coverage Sensor [INFO] 16:44:58.899 Sensor Zero Coverage Sensor [INFO] 16:44:58.903 Sensor Zero Coverage Sensor (done) | time=4ms [INFO] 16:44:58.906 CPD Executor Calculating CPD for 0 files [INFO] 16:44:58.907 CPD Executor CPD calculation finished (done) | time=0ms ... [DEBUG] 16:44:59.349 POST 200 https://sonarqube.xxx.com/api/ce/submit?projectKey=xxx&projectName=xxx | time=215ms [INFO] 16:44:59.350 Analysis report uploaded in 216ms [DEBUG] 16:44:59.351 Report metadata written to /myproject/target/sonar/report-task.txt [INFO] 16:44:59.352 ANALYSIS SUCCESSFUL, you can browse https://sonarqube.xxx.com/dashboard?id=xxx
Can you please help?