I have installed Jenkins and SonarQube 5.1.1 (also tried LTS), It's running on a Ubuntu server and its accessible from outside. I have installed the Jenkins SonarQube plugin and everything is almost working. If I set SonarQube Server URL in Jenkins to localhost then everything works great. But then the link to SonarQube (inside Jenkins) will point to localhost and that's not ok when I'm accessing Jenkins from outside.
If i set Server URL to my real IP for example 111.112.113.114 then i get an error message saying server can not be reached.
[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.6:sonar (default-cli) on project com.ericsson.dx.lta.parent: Execution default-cli of goal org.codehaus.mojo:sonar-maven-plugin:2.6:sonar failed: SonarQube server can not be reached at http://111.112.113.114:9000/sonar. Please check the parameter 'sonar.host.url'. Read timed out -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.6:sonar (default-cli) on project com.ericsson.dx.lta.parent: Execution default-cli of goal org.codehaus.mojo:sonar-maven-plugin:2.6:sonar failed: SonarQube server can not be reached at http://111.112.113.114:9000/sonar. Please check the parameter 'sonar.host.url'.
But i have no problem accessing SonarQube in the browser from another computer.
In sonar.properties i have tried with different settings on sonar.web.host such as sonar.web.host=0.0.0.0 and sonar.web.host=111.112.113.114
If I understand correctly your issue, I think that what you are looking for is the sonar.core.serverBaseUrl
property that you can set in the global administration settings:
This is the "public" URL of your SonarQube instance that will be used in the logs or in the notifications.
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