Check the parameter "sonar.host.url"

I want to enable hudson + sonar, so I took the following steps:

1. Installed sonar 3.4.1 and a running sonar server. Now I can access http://localhost:9000 in the browser.

2. In the configuration on hudson, I provided details of installing the sonar, but it contains only database data, such as database login, password, URL, etc.

2. I created a new task in hudson, used the git repository, where my project is currently working, and in the actions after the assembly, I chose a sonar.

But I'm going to create a task that it loads correctly from git repositoty, but I get the following exception:

 [ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.0:sonar (default-cli) on project Engile: Sonar server can not be reached at http://localhost:9000. Please check the parameter 'sonar.host.url'. -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.0:sonar (default-cli) on project Engile: Sonar server can not be reached at http://localhost:9000. Please check the parameter 'sonar.host.url'. at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59) at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196) at org.apache.maven.cli.MavenCli.main(MavenCli.java:141) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352) Caused by: org.apache.maven.plugin.MojoExecutionException: Sonar server can not be reached at http://localhost:9000. Please check the parameter 'sonar.host.url'. 

I did not add anything in the settings.xml file. I have no clue to answer this problem, can someone give me some solution ...

1.Hudson configuration:

enter image description here

2.Hudson job configuration:

enter image description here

+4
source share
1 answer

You can configure the Hudson / Jenkins plugin to set a specific URL for your Sonar server. Please check out this part of the documentation: http://docs.codehaus.org/display/SONAR/Configuring+Sonar+Jenkins+Plugin#ConfiguringSonarJenkinsPlugin-AddingSonarServer

You can see that there is a "Server URL" field that you must fill out.

0
source

All Articles