5

I am trying to run the SonarQube Scanner within Jenkins as a post-build step. However, I keep getting the error message below:

------------------------------------------------------------------------
SONAR ANALYSIS FAILED
------------------------------------------------------------------------
FATAL: SonarQube Scanner executable was not found for SonarQube
Build step 'Execute SonarQube Scanner' marked build as failure

From similar questions on stackoverflow I read that one should choose "Install automatically" for the SonarQube Scanner, which I have done.

My configurations is as follows:

  • SonarQube 6.0
  • Jenkins 1.609.3
  • SonarQube Plugin 2.4.4

SonarQube Servers

sonarqubeservers.png

SonarQube Scanner

sonarqubescanner.png

Build-step

buildstep.png

Community
  • 1
  • 1
oyvindym
  • 352
  • 1
  • 2
  • 15
  • Can you please include the complete log? – janos Sep 15 '16 at 14:10
  • Harsha is right, you need the server, the Jenkins plugin and the sonarqube scanner. all three components will make it go through without any issue !! The sonarqube scanner should have been integrated into the plugin to make the whole process easy ! – Mahesh Chandra Apr 18 '18 at 05:22

3 Answers3

3

Make sure you are giving path in Global Tool Configuration correctly. Give the path of folder in which bin folder is exists inside that folder.

Step1 : 1st find where the sonar_scanner bin is available -

root@test1sp117:/opt/sonar_scanner/sonar-scanner-3.0.3.778-linux# ls
bin  conf  jre  lib

Step2 : Give the correct path in Manage Jenkins --> Global Tool Configuration --> SonarQube Scanner

enter image description here

Harsha Biyani
  • 7,049
  • 9
  • 37
  • 61
1

You may want to ensure that both SonarQube and SonarQubeRunner are installed. You would need to configure the SonarQube Runner bin in the Tool Configuration of Jenkins and not the SonarQube server. This fix worked for us.

vishy
  • 11
  • 1
0

When you config SonarQube Scanner in Manage Jenkins --> Global Tool Configuration --> SonarQube Scanner, besides select "Install automatically", you also need to add a installer. See screenshot here: SonarQube Scanner --> Add Installer