我在jenkins的sonarQube插件中遇到了一个问题。当我尝试编译我的项目并启动sonarQube时,我遇到了一个问题:
[INFO] Sonar server can not be reached. Please check the parameter 'sonar.host.url': http://null:9000
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Sonar server can not be reached. Please check the parameter 'sonar.host.url': http://null:9000
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:284)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
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.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Sonar server can not be reached. Please check the parameter 'sonar.host.url': http://null:9000
at org.codehaus.mojo.sonar.ServerMetadata.connect(ServerMetadata.java:67)
at org.codehaus.mojo.sonar.SonarMojo.execute(SonarMojo.java:85)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
... 17 more
但是,当我看到我的移民时,我不会看到错误......
有人能帮助我吗? :/
LEDUNOIS S
P.S:我试图发布我的配置图片,但我不能......
答案 0 :(得分:1)
我不确定您是否忘记设置Server URL
:
Manage Jenkins
- > Configure System
- > Sonar installations
- > Add Sonar
- > Advanced
- > Server URL
,但希望这个答案有所帮助。
答案 1 :(得分:0)
您的主机名丢失了。
您必须提供有效的主机名
,而不是nullhttp://mojo.codehaus.org/sonar-maven-plugin/sonar-mojo.html#sonarHostURL
<profile>
<id>sonar</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<sonar.jdbc.url>jdbc:postgresql://localhost/sonar</sonar.jdbc.url>
<sonar.jdbc.driver>org.postgresql.Driver</sonar.jdbc.driver>
<sonar.jdbc.username>user</sonar.jdbc.username>
<sonar.jdbc.password>password</sonar.jdbc.password>
<!-- SERVER ON A REMOTE HOST -->
<sonar.host.url>http://localhost:9000</sonar.host.url>
</properties>
</profile>
答案 2 :(得分:0)
在sobarqube安装目录下的conf文件夹中,打开sonar.properties并注释掉属性sonar.web.host,如果已为其定义了显式值。这解决了我的问题。