• DevOps
  • 流水线代码质量分析报错SonarQube server [http://localhost:9000] can not be reached

++ pwd

  • mvn sonar:sonar -o -gs /home/jenkins/agent/workspace/cicd-test727w2/devops-test/configuration/settings.xml -Dsonar.login=****

[INFO] Scanning for projects…

[INFO]

[INFO] —————–< io.kubesphere.devops:devops-sample >—————–

[INFO] Building devops-sample :: HelloWorld Demo 0.0.1-SNAPSHOT

[INFO] ——————————–[ jar ]———————————

[INFO]

[INFO] — sonar-maven-plugin:3.6.0.1398:sonar (default-cli) @ devops-sample —

[INFO] User cache: /root/.sonar/cache

[ERROR] SonarQube server [http://localhost:9000] can not be reached

[INFO] ————————————————————————

[INFO] BUILD FAILURE

[INFO] ————————————————————————

[INFO] Total time: 0.760 s

[INFO] Finished at: 2020-11-17T00:59:31Z

[INFO] ————————————————————————

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

[ERROR]

[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.

[ERROR] Re-run Maven using the -X switch to enable full debug logging.

[ERROR]

[ERROR] For more information about the errors and possible solutions, please read the following articles:

[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

script returned exit code 1

请问一下该如何解决?