Java unittest code coverage missing with SonarQube 7.9.2 (works with 6.0)

Hi all,
I used to be able to see java unit test coverage in SonarQube with version 6.0 (I know, I know, that’s pretty old) which have vanished now after upgrading to the SonarQube 7.9.2.
Going through the logs, I see that the SurefireSensor is not able to find the reports, even though a ls shows that the surefire reports are present in that exact location.
Here’s the error that I see:

[ERROR] Reports path not found or is not a directory:

  • SonarQube version in use: 7.9.2
  • Sonar-java-plugin version: 6.2.0.21135
  • maven-surefire-plugin version: 2.22.2
  • Parameter used to specify surefire reports path: sonar.junit.reportPaths

I am speculating that the SurefireSensor is getting trigger before the surefire reports are being generated by the maven-surefire-plugin (which is triggered with the same maven command as sonarQube scanner)

Appreciate any help.

Bumping up.

was this fixed. I m also facing the same issue

Yes Swati.
SureFire doesn’t have functionality to perform code coverage analysis. You need JaCoCo for that. I enabled JaCoCo and configured it properly and SonarQube was able to find the code coverage reports generated by JaCoCo.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.