Must-share information (formatted with Markdown):
- SonarQube 6.7.4
- Code coverage by unit tests
- mvn sonar:sonar -Dsonar.host.url=http://localhost:9000 -Dsonar.login=…
Can you help me please? =)
First of all, could you please share which version of sonar-java you are using, that would help narrow the issue you are facing, thanks.
When I look at what you reported, what strikes me is the following: properties
sonar.junit.reportPath have all been deprecated.
sonar.jacoco.reportPath, you should be using
sonar.coverage.jacoco.xmlReportPaths. I would strongly advice you to have a look and follow what is described in the following coverage guide.
sonar.junit.reportPath property was deprecated in sonar-java 4.11 and removed in sonar-java 5.12, you should be using
sonar.junit.reportPaths instead, which allow for a comma separated list of reports.
If you are still facing issues after trying the above, can you please also share the log of your analysis.
I am having the same problem. After switching to JUnit 5, all the code coverage reporting went to 0%. I took the example from https://github.com/SonarSource/sonar-scanning-examples and modified maven-multimodule from JUnit 4, and switched it to JUnit 5. The sample has the same problem.
The only changes made to create the issue was
- Changing the test imports to
- and changing the pom JUnit dependency to
I saw that you opened another topic related to this subject.
Since the original post is quite old and it seems to be related to another problem, creating a new one was the right move.
Bumping this one was not though, please be careful next time!
I will have a look and answer on the other one, please continue the discussion there if needed.
Hey, how you doing?
I have an example project with Junit5 working at https://github.com/GiuseppeMP/JacocoMultiModuleReport
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.