SonarQube: Fail to get bootstrap index from server

2019-08-21 09:10发布

问题:

I'm new to sonarqube and trying to analyze a maven project with it. I'm using the following command to do start the analysis

mvn sonar:sonar -Dsonar.host.url=http://localhost:9000 -Dsonar.login=TOKEN_GENERATED

But I'm getting 404 error

[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building crystalviz 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- sonar-maven-plugin:3.3.0.603:sonar (default-cli) @ crystalviz ---
[INFO] User cache: /Users/gkumar6/.sonar/cache
[ERROR] SonarQube server [http://localhost:9000] can not be reached
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.184 s
[INFO] Finished at: 2017-10-18T16:00:59+05:30
[INFO] Final Memory: 25M/437M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.3.0.603:sonar (default-cli) on project crystalviz: Unable to execute SonarQube: Fail to get bootstrap index from server: Status returned by url [http://localhost:9000/batch/index] is not valid: [404] -> [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

Even though I'm able to access http://localhost:9000 in my browser, maven is not able to reach it.

Please help me resolve this issue. Thanks in advance.

回答1:

Update for SonarQube 6.5 version. That is fixed.



回答2:

Is SonarQube running locally for you? If not, then type these commands into Terminal (Mac):

sonar console
brew services start sonarqube