问题
I am using Sonar to generate code review reports of my project. But I am not able to start the server. Output from mvn sonar:sonar:
回答1:
[ERROR] SonarQube server [http://localhost:9000] can not be reached
Your are getting above error. Please check if the server is up
回答2:
reading
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.5.0.1254:sonar (default-cli) on project risks: Unable to execute SonarQube: Fail to get bootstrap index from server: Status returned by url [http://localhost:9000/batch/index] is not valid: [407] -> [Help 1]
I see that error is [http://localhost:9000/batch/index] is not valid: [407]
Looking up 407 error : https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/407
This seems to be proxy authentication issue so this needs to be properly configured on your side.
回答3:
There are a few things you could check. Firstly make sure you have both SonarQube (I think the latest is 7.3) and SonarQube Scanner installed on the build server or where you are going to host Sonar service. If you have created sonar database (https://docs.sonarqube.org/display/SONAR/Installing+the+Server) and updated the properties file with username and password then see if remote SQL browsing service is enabled and then next see if in computer management you have enabled TCP/IP on port 1433.
Also create a firewall inbound rule on port 1433 and 9000. The report is accessed at port 9000 and SQL browsing service uses port 1433. Now load http://localhost:9000 and see if the page loads fine.
As a side, while integrating Sonar With Bamboo, I found that the build server should run under admin account and not a local services account. I think yo are not trying to integrate Sonar into a build tool.
来源:https://stackoverflow.com/questions/52517190/not-able-to-compile-with-sonarsonar