Soarqube not picking up junit test files and coverage report

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    sonarqube- on Mac macOS Big Sur
  • what are you trying to achieve
    Genrate junit code covarage
  • what have you tried so far to achieve this
    Here is the properties file

I run “sonar-scanner” in the project root directory and it generates the report but it shows 0% coverage and no unit test cases at all.


Hey there.

When analyzing Java code, it’s important that you use a scaner like the Scanner for Maven , Scanner for Gradle , or Scanner for Ant . Why are you using the vanilla SonarScanner?

You will have to make sure that tests/code coverage reports have been generated before running the scanner, which means running a build. Community Guides like this one can help you:

1 Like