Download and install SonarQube Scanner:
-
Run the following command to download SonarQube Scanner:
$ wget https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.0.0.1744-linux.zip
If this link is not available, see: https://docs.sonarqube.org/latest/analysis/scan/sonarscanner/
-
Extract the file "
sonar-scanner-cli-4.0.0.1744-linux.zip
" in the folder you want to install SonarQube Scanner: /opt/sonar-scanner-4.0.0.1744-linux
$ unzip sonar-scanner-cli-4.0.0.1744-linux.zip -d /opt/
-
Change the folder permissions:
$ sudo chmod -R 755 /opt/sonar-scanner-4.0.0.1744-linux/
$ sudo chown -R jenkins:jenkins /opt/sonar-scanner-4.0.0.1744-linux/
-
Create a symbolic link of the SonarQube Scanner installation folder:
$ sudo ln -s /opt/sonar-scanner-4.0.0.1744-linux/ /opt/sonar-scanner
$ sudo chown -R jenkins:jenkins /opt/sonar-scanner
-
Configure the "
sonar-scanner.properties
".
Uncomment and modify the following properties:
$ su - jenkins
$ vi /opt/sonar-scanner/conf/sonar-scanner.properties
#----- Default SonarQube server
sonar.host.url=http://localhost:9000
To add new SonarQube Scanner installation, Click the "
Add SonarQube Scanner
" button.
Set the following properties:
-
Uncheck "
Install automatically
"
-
Name:
SonarQube-Scanner
-
SONAR_RUNNER_HOME:
/opt/sonar-scanner