- Bitbucket Cloud
- Team City
- mvn verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey.
I am getting following error when execute above maven command in a Command Prompt:
Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:184.108.40.2064:sonar (default-cli) on project xxxx: Unable to execute SonarScanner analysis: Fail to get bootstrap index from server: Failed to connect to localhost/127.0.0.1:9000: Connection refused: connect ->
I do not experience this issue for my other Projects.
Any hint what to look at.
The error itself is the best pointer:
Now the question is: why is it trying to connect to
localhost/127.0.0.1:9000 rather than to sonarcloud.io? Among the mandatory analysis parameters is
sonar.host.url, which tells analysis where to look for the server. Absent a URL value, it defaults to
localhost, which is what happened here.
So you need to add
-Dsonar.host.url=https://sonarcloud.io to your analysis commandline, or define the key/value pair somewhere else. Note that the SonarScanner for Maven docs list a few other parameters you’ll want to make sure are set as well.
Your other projects must have the required values set somewhere else - perhaps in their pom files.
Thanks for provided information, the root cause was that the Pom-file was overwritten so Sonar Cloud URL was no longer available…
Issues is solved.
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.