【发布时间】:2020-03-06 02:32:06
【问题描述】:
我正在尝试设置 Sonarqube 以与 Jenkins 一起运行。我在 Windows 10 Hyper-V 主机上运行的 Ubuntu 虚拟机上安装了 Jenkins 和 Sonarqube。我将 Sonarqube 下载到 /opt/sonarqube,然后按照 docs.sonarqube.org 上的安装说明进行操作。我可以从我的主机访问位于 myserver:9000 的 Sonarqube,从我的访客机器访问 localhost:9000,因此 Sonarqube 已正确安装并据我所知正在运行。
我在 Jenkins 中安装了 Sonarqube Scanner 插件,但在全局工具配置中配置 SONAR_RUNNER_HOME 时遇到问题。我尝试将其设置为 /opt/sonarqube 和 /opt/sonarqube/bin/linux-x86-64,但在这两种情况下构建我的 Jenkins 项目都会导致错误 FATAL: SonarQube Scanner executable was not found for Local
我应该在 Jenkins 全局工具配置中将 SONAR_RUNNER_HOME 设置为什么?
【问题讨论】:
-
你必须找到Runner的安装路径。检查终端中的
/opt/sonar-runner/bin/路径。如果存在使用/opt/sonar-runner/bin/sonar-runner执行 -
我应该寻找什么文件?在
/opt/sonar-runner/bin内部,我有文件夹jsw-license、linux-x86-64、macosx-universal-64和windows-x86-64 -
运行
cd,然后运行cd ..,然后运行find . -name "sonar-scanner"以查找sonar-runner的位置 -
我好像没有那个文件。我也尝试使用
sudo find / -name sonar-scanner搜索整台机器,但没有返回任何结果。我在安装过程中遗漏了什么吗? -
您可以在Jenkins的全局工具配置中使用Maven自动使用
SonarQube Scanner installations