简体   繁体   English

詹金斯无法运行程序声纳运行器

[英]Jenkins cannot run program sonar-runner

Installed: 已安装:

Sonarqube 5.5 声纳曲贝5.5

Sonar-runner 2.4 ( http://dev.mamikon.net/installing-sonarqube-runner-on-ubuntu/ ) Sonar-runner 2.4( http://dev.mamikon.net/installing-sonarqube-runner-on-ubuntu/

When I try to run Jenkins with a simple project, this is the error I get: 当我尝试用一​​个简单的项目运行Jenkins时,这是我得到的错误:

[test] $ sonar-runner -e -Dsonar.host.url=http:// server_url :9000/sonar/ -Dsonar.projectBaseDir=/var/lib/jenkins/workspace/test [测试] $ sonar-runner -e -Dsonar.host.url = http:// server_url :9000 / sonar / -Dsonar.projectBaseDir = / var / lib / jenkins / workspace / test

SONAR ANALYSIS FAILED 声纳分析失败

FATAL: command execution failed. 致命:命令执行失败。 java.io.IOException: Cannot run program "sonar-runner" (in directory "/var/lib/jenkins/workspace/test"): error=2, No such file or directory java.io.IOException:无法运行程序“声纳运行器”(在目录“ / var / lib / jenkins / workspace / test”中):error = 2,没有这样的文件或目录

It seems that jenkins cannot find the sonar-runner program. 詹金斯似乎找不到声纳运行程序。 But when I open the server with a terminal, and run sonar-runner, it analyzes the project. 但是,当我使用终端打开服务器并运行sonar-runner时,它将分析项目。

Can someone help me with this? 有人可以帮我弄这个吗?

after hours of frustration, it turned out i had to add environment variable in the /etc/profile file. 经过数小时的无奈之后,事实证明我不得不在/ etc / profile文件中添加环境变量。

export SONAR_RUNNER_HOME=/opt/sonar-runner 导出SONAR_RUNNER_HOME = / opt /声纳运行器

export PATH=$PATH:$SONAR_RUNNER_HOME/bin 导出PATH = $ PATH:$ SONAR_RUNNER_HOME / bin

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM