Reputation: 7341
I'm trying to set up Sonarqube to run with Jenkins. I have both Jenkins and Sonarqube installed on an Ubuntu virtual machine that's running on a Windows 10 Hyper-V host. I downloaded Sonarqube to /opt/sonarqube
and then followed the installation instructions at docs.sonarqube.org. I am able to get to Sonarqube at myserver:9000 from my host machine and localhost:9000 from my guest machine, so Sonarqube is installed correctly and running as far as I can tell.
I installed the Sonarqube Scanner plugin in Jenkins, but I'm having trouble with the configuration of SONAR_RUNNER_HOME in the Global Tool Configuration. I've tried setting it to both /opt/sonarqube
and /opt/sonarqube/bin/linux-x86-64
, but in both cases building my Jenkins projects results in the error FATAL: SonarQube Scanner executable was not found for Local
What do I set SONAR_RUNNER_HOME to in Jenkins Global Tool Configuration?
Upvotes: 3
Views: 5008
Reputation: 12255
Config installation from Maven in Global Tool Configuration in SonarQube Scanner installations
in Jenkins.
Example how to use, where SonarQubeServer
is name of SonarQube servers
configuration in Jenkins Configure System
. SonarQubeScanner
name of SonarQube Scanner installations
:
withSonarQubeEnv('SonarQubeServer') {
def sonarRunner = tool name: 'SonarQubeScanner', type: 'hudson.plugins.sonar.SonarRunnerInstallation'
sh """
${sonarRunner}/bin/sonar-scanner \
-Dsonar.projectKey=your_project_key \
-Dsonar.sources=.
"""
}
Upvotes: 2