Test Coverage Always 0% On SonarQube Dashboard

What I’m using:
SonarQube Server - Community Edition - Version 8.4.1
Sonar Maven Plugin - Version
Jacoco Maven Plugin - Version 0.8.3

What I’m trying to achieve:
I’m trying to see test coverage on SonarQube dashboard

This is for a SpringBoot, Maven-based project using Jacoco for test coverage reports.

So far I’ve gotten Jacoco to generate test coverage reports under the target folder after using the command mvn clean install. However, when I use the command mvn sonar:sonar, I get an error.
This is the error I’m getting:
Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin: (default-cli)
Unable to execute SonarQube: Fail to get bootstrap index from server: timeout: Read timed out

My SonarQube dashboard shows test coverage as 0% and does not ever change, even though I have tests. Not sure what I’m missing or what to do from here.


Clearly, you’re having trouble simply connecting to the sonarqube server. There may not be any issue with the coverage computations, but if you can’t get them to the server, it won’t matter.

I suggest you examine the url you are trying to connect to and determine whether that is valid.

1 Like