我在Jenkins服务器上安装了一个Sonar Scanner插件,该插件与sonar-qube服务器集成在一起,用于Jenkins的sonar-scanner插件具有自动安装检查功能,该安装程序将安装扫描仪并为sonar-qube运行扫描。对于我的Jenkins(Windows)的主节点,它也已安装了声纳服务器,完全可以正常工作。但是,当我尝试为我的ubuntu节点运行它时,它给了我一定的错误。尽管它在Ubuntu机器上本地完全可以正常工作,但是每当我通过Jenkins运行它时,都会出现以下错误:
> /home/ci_ubuntu/tools/hudson.plugins.sonar.SonarRunnerInstallation/SonarScanner/bin/sonar-scanner
> scan -Dsonar.host.url=http://10.0.0.82:9000 ********
> -Dsonar.projectName=ABC -Dsonar.projectVersion= %BUILD_NUMBER% -Dsonar.projectKey=ABC:project -Dsonar.sources=app -Dsonar.projectBaseDir=/home/ci_ubuntu/workspace/ABC /home/ci_ubuntu/tools/hudson.plugins.sonar.SonarRunnerInstallation/SonarScanner/bin/sonar-scanner:
> 15:
> /home/ci_ubuntu/tools/hudson.plugins.sonar.SonarRunnerInstallation/SonarScanner/bin/sonar-scanner:
> dirname: not found
> /home/ci_ubuntu/tools/hudson.plugins.sonar.SonarRunnerInstallation/SonarScanner/bin/sonar-scanner:
> 16:
> /home/ci_ubuntu/tools/hudson.plugins.sonar.SonarRunnerInstallation/SonarScanner/bin/sonar-scanner:
> basename: not found
> /home/ci_ubuntu/tools/hudson.plugins.sonar.SonarRunnerInstallation/SonarScanner/bin/sonar-scanner:
> 26:
> /home/ci_ubuntu/tools/hudson.plugins.sonar.SonarRunnerInstallation/SonarScanner/bin/sonar-scanner:
> dirname: not found File does not exist:
> //lib/sonar-scanner-cli-3.3.0.1492.jar '/' does not point to a valid
> installation directory: / ERROR: SonarQube scanner exited with
> non-zero code: 1 Finished: FAILURE