使用Sonar插件的Hudson post构建操作失败

时间:2016-02-18 18:48:57

标签: hudson hudson-plugins

我尝试在Hudson中使用Sonar plugin(2.0.1)运行free-style project(3.3.3)后期构建操作,但是我收到错误。

工作日志:

[workspace] $ mvn -f /home/hudson/.hudson333/jobs/Test/workspace/pom.xml -e -B sonar:sonar -Dsonar.jdbc.driver=org.postgresql.Driver -Dsonar.jdbc.url=jdbc:postgresql://sonar/sonar4 ******** ******** -Dsonar.host.url=http://sonar.mycompany.com
FATAL: command execution failed
java.io.IOException: Cannot run program "mvn" (in directory "/home/hudson/.hudson333/jobs/Test/workspace"): error=13, Permission denied
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1041)
    at hudson.Proc$LocalProc.<init>(Proc.java:187)
    at hudson.Proc$LocalProc.<init>(Proc.java:157)
    at hudson.Launcher$LocalLauncher.launch(Launcher.java:649)
    at hudson.Launcher$ProcStarter.start(Launcher.java:266)
    at hudson.Launcher$ProcStarter.join(Launcher.java:273)
    at hudson.tasks.Maven.perform(Maven.java:267)
    at hudson.plugins.sonar.utils.SonarMaven.executeMaven(Son    arMaven.java:149)
    at hudson.plugins.sonar.SonarPublisher.executeSonar(Son    arPublisher.java:331)
    at hudson.plugins.sonar.SonarPublisher.perform(SonarPublisher.java:292)
    at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:51)
    at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:736)
    at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:714)
    at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:690)
    at hudson.model.Build$RunnerImpl.post2(Build.java:163)
    at hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:652)
    at hudson.model.Run.run(Run.java:1519)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:44)
    at hudson.model.ResourceController.execute(ResourceController.java:82)
    at hudson.model.Executor.run(Executor.java:137)
Caused by: java.io.IOException: error=13, Permission denied
    at java.lang.UNIXProcess.forkAndExec(Native Method)
    at java.lang.UNIXProcess.<init>(UNIXProcess.java:135)
    at java.lang.ProcessImpl.start(ProcessImpl.java:130)
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1022)
    ... 19 more
Sonar analysis completed: FAILURE
Finished: FAILURE

Maven配置:

Maven configuration

Hudson文件:

.hudson333 [drwxrwxr-x]
    maven [drwxrwxr-x]
        slavebundle [drwxrwxr-x]
            bundled-maven [drwxrwxr-x]
                bin [drwxrwxr-x]
                    mvn [-rwxrwxr-w]

环境:

  • Cent OS
  • Hudson 3.3.3
  • Sonar Plugin 2.0.1

我找到了以下链接:

但没有合适的答案。

1 个答案:

答案 0 :(得分:0)

我发现了三种不同的解决方法: