添加后构建操作Sonar导致Jenkins构建失败

时间:2013-01-18 09:45:20

标签: jenkins sonarqube jenkins-plugins

使用Jenkins ver。 1.494; Jenkins Sonar Plugin 2.0.1;声纳服务器3.4.1。 Maven job.

添加构建后操作Sonar会导致Jenkins构建失败(错误:无法解析POM)。 删除声纳动作然后再次通过。

Sync complete, took 35 ms
Parsing POMs
[Atlas_Phevos] $ java -Xmx512m -XX:MaxPermSize=128m -cp /home/jenkins/jenkins-home/plugins/maven-plugin/WEB-INF/lib/maven3-agent-1.2.jar:/home/jenkins/jenkins-home/tools/Maven/Maven304/boot/plexus-classworlds-2.4.jar org.jvnet.hudson.maven3.agent.Maven3Main /home/jenkins/jenkins-home/tools/Maven/Maven304 /usr/local/tomcat-6.0.32/webapps/jenkins/WEB-INF/lib/remoting-2.19.jar /home/jenkins/jenkins-home/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-1.2.jar 60147
ERROR: Failed to parse POMs
java.io.IOException: Cannot run program "java" (in directory "/home/jenkins/jenkins-home/workspace/Atlas_Phevos"): java.io.IOException: error=2, No such file or directory
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:460)
    at hudson.Proc$LocalProc.<init>(Proc.java:244)
    at hudson.Proc$LocalProc.<init>(Proc.java:216)
    at hudson.Launcher$LocalLauncher.launch(Launcher.java:763)
    at hudson.Launcher$ProcStarter.start(Launcher.java:353)
    at hudson.maven.AbstractMavenProcessFactory.newProcess(AbstractMavenProcessFactory.java:223)
    at hudson.maven.ProcessCache.get(ProcessCache.java:231)
    at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:670)
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:586)
    at hudson.model.Run.execute(Run.java:1543)
    at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:477)
    at hudson.model.ResourceController.execute(ResourceController.java:88)
    at hudson.model.Executor.run(Executor.java:236)
Caused by: java.io.IOException: java.io.IOException: error=2, No such file or directory
    at java.lang.UNIXProcess.<init>(UNIXProcess.java:148)
    at java.lang.ProcessImpl.start(ProcessImpl.java:65)
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:453)
    ... 12 more
Skipping sonar analysis due to bad build status FAILURE
Sending e-mails to: ____
Finished: FAILURE

我没有把updated setting.xml放在Jenkins服务器上,我想Jenkins应该为Sonar采用自己的配置(服务器,JDBC连接等)。

更新:问题仍然存在。我尝试了几个工作来开始声纳分析。

1 个答案:

答案 0 :(得分:1)

从您的例外情况看,Jenkins看起来无法找到您的JDK。在作业配置中,您可以展开Sonar属性。确保在JDK选项下选择了Jenkins配置中的有效JDK。

在查看属性时,请确保Root POM下指定的pom文件正确无误。

试试......