I am trying to execute following maven command from jenkins job, mvn clean install sonar:sonar -Dsonar.host.url=http://hostname:9095/sonar -Dsonar.projectKey=mavensample -Dsonar.login=admin -Dsonar.password=admin -X
But it fails with following error,
[DEBUG] 18:20:49.119 Download: http://hostname:9095/batch/index [ERROR] 18:20:49.176 SonarQube server [http://hostname:9095] can not be reached [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 2.920 s [INFO] Finished at: 2017-07-14T18:20:49+02:00 [INFO] Final Memory: 20M/171M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.3.0.603:sonar (default-cli) on project my-stc: Unable to execute SonarQube: Fail to get bootstrap index from server: Status returned by url [http://hostname:9095/batch/index] is not valid: [403] -> [Help 1]
When I am trying to access http://hostname:9095 in browser it works.
I have also set the base url in sonarqube settings to http://hostname:9095 and tried but its fails with same error.
Sonaqube is installed on same machine as maven and jenkins.
I thought it may be due to proxy(may be I am wrong), So I have set proxy settings in sonar.properties file and tried but no luck.
FYI, It is using following version of sonar-maven plugin,
[INFO] --- sonar-maven-plugin:3.3.0.603:sonar (default-cli) @ my-stc ---
Anyone faced same issue earlier ?