请检查参数'sonar.host.url'

时间:2013-01-29 07:04:26

标签: maven-2 hudson sonarqube

我想启用hudson + sonar,所以我做了以下步骤:

1.安装声纳3.4.1并启动声纳服务器。现在我可以在浏览器上访问http://localhost:9000

2.在hudson的配置中,我提供了声纳安装细节,但只提供了数据库详细信息,如数据库登录,密码,网址等。

2.在hudson中处理新工作,使用当前我的项目所在的git存储库,在后期构建操作中我选择了声纳。

但是我要构建它正确地从git repositoty获取内容的工作,但我得到以下异常:

[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'.

我还没有在settings.xml文件中添加任何内容。我没有任何线索可以解决这个问题,任何人都可以给我一些解决方案......

1.Hudson配置:

enter image description here

2.Hudson职位配置:

enter image description here

1 个答案:

答案 0 :(得分:0)

您可以配置Hudson / Jenkins插件以设置Sonar服务器的特定URL。请查看文档的这一部分:http://docs.codehaus.org/display/SONAR/Configuring+Sonar+Jenkins+Plugin#ConfiguringSonarJenkinsPlugin-AddingSonarServer

您可以看到有一个“服务器URL”字段,您必须填写该字段。