Hi All,
I am trying to scan a multimodule maven project using sonarscanner through github action.Below are the issues am facing.
- Incorrect code coverage details.
I am trying to track code coverage for the multimodule repository, and have some good amount of test cases written for few of the files.But still code coverage showing 0.1% or 4% but if i run the same in my local i get around 60% as a coverage.
2.One of the submodule main class files are not showing up under sonarqube UI code section.What i meant to say is instead of showing line to cover details for src/main/java its just giving details for src/test/java. I tried to adjust my sonar.sources and binaries but nothing is working.
My current setup
Main folder
- submodule1
-src
|- main/java/.java files
|- test/java/*Test.java files
- submodule2
-src
|- main/java/.java files
|- test/java/*Test.java files
- submodule3
-src
|- main/java/.java files
|- test/java/*Test.java files
pom.xml (root)
I added jacoco plugin setup to root pom.xml and reports are getting generated for all three folders and imported into sonarqube.
here is my sonar-project.properties
sonar.projectKey=***
sonar.projectName=***
sonar.sources=./submodule1/src/main,./submodule2/src/main,/submodule3/src/main
sonar.java.binaries=./submodule1/target/classes,./submodule2/target/classes,./submodule3/target/classes
sonar.sourceEncoding=UTF-8
sonar.language=java
sonar.core.codeCoveragePlugin=jacoco
sonar.java.libraries=**/*.jar
sonar.coverage.jacoco.xmlReportPaths=**/jacoco.xml
sonar.dependencyCheck.htmlReportPath=target/dependency-check-report.html
sonar.dependencyCheck.jsonReportPath=target/dependency-check-report.json
sonar.dependencyCheck.reportPath=target/dependency-check-report.xml
please find the attached log.
sonarlog.txt (15.9 KB)
Please check and assist me.I would greatly appreciate any help here @Colin @ganncamp @Margarita_Nedzelska