I am trying to do code analysis for sonarqube. However, I got the error when running
mvm sonar:sonar
This is the error message:
[ERROR] SonarQube server [http://localhost:9000] can not be reached
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 42.972 s
[INFO] Finished at: 2017-06-06T08:51:52+08:00
[INFO] Final Memory: 8M/19M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:
3.3.0.603:sonar (default-cli) on project example-java-maven: Unable to execute SonarQube:
Fail to get bootstrap index from server: Status returned by url
[http://localhost:9000/batch/index] is not valid: [504] -> [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
But when I access http://localhost:9000 via the browser, I can see the sonarqube homepage.
So why could this be happening?
Thank you.
An HTTP 403 response code means that a client is forbidden from accessing a valid URL. The server understands the request, but it can't fulfill the request because of client-side issues.
Try to use sonar-maven-plugin version 3.2 on your pom.xml
<plugin>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>3.2</version>
</plugin>
This works for me
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With