Java – SonarQube – Failed to connect to > localhost/0:0:0:0:0:0:0:1:9000

javamavensonarqube

When I build my maven project locally, I run a sonar check. I am getting the following error. Googling hasn't resolved the issue.

I am new to SonarQube – am I missing config?

[ERROR] Failed to execute goal
org.sonarsource.scanner.maven:sonar-maven-plugin:3.3.0.603:sonar
(default-cli) on project x: Unable to execute SonarQube: Fail to get
bootstrap index from server: Failed to connect to
localhost/0:0:0:0:0:0:0:1:9000: Connection refused: connect

Best Answer

The SonarQube Scanners don't run in isolation to analyze your code. They interact with a SonarQube server, and language analyzers loaded in that server.

To run an initial trial, download the latest version from sonarqube.org, expand the resulting zip, and start the server. Then you'll be able to successfully run a scan.

Note that the instructions I've just given you start the server with a for-trial-only on-board H2 database. You should not go into production with that database.

Related Topic