简体   繁体   中英

Jenkins cannot run program sonar-runner

Installed:

Sonarqube 5.5

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:

[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

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.

Can someone help me with this?

after hours of frustration, it turned out i had to add environment variable in the /etc/profile file.

export SONAR_RUNNER_HOME=/opt/sonar-runner

export PATH=$PATH:$SONAR_RUNNER_HOME/bin

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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