Jenkins
  • Introduction
  • 1. Jenkins Basics
    • 1.1 Run Jenkins as-is
    • 1.2 Installation of Jenkins
    • 1.3 Installation of jenkins on Tomcat
  • 2. Jenkins Configurations
    • 2.1 Configure Jenkins Slave
    • 2.2 Configure SonarQube with Jenkins
    • 2.3 Configure SilkCentral with Jenkins
    • 2.4 Configure TestNG with Jenkins
  • 3. How to use Jenkins
    • 3.1 Create jobs
    • 3.2 Run jobs
    • 3.3 Run Single Job Parallely in Multiple slaves
  • 4. Jenkins Integrations
    • 4.1 Analysis with SonarQube using Jenkins
    • 4.2 SCTM Result Analysis with Jenkins
    • 4.3 TestNG Result Analysis with Jenkins
  • 5. Jenkins Advanced
    • 5.1Jenkins Challenges
Powered by GitBook
On this page

Was this helpful?

  1. 2. Jenkins Configurations

2.2 Configure SonarQube with Jenkins

Previous2.1 Configure Jenkins SlaveNext2.3 Configure SilkCentral with Jenkins

Last updated 5 years ago

Was this helpful?

Step1: Set environment variables for SONAR_RUNNER_HOME

Open your environment variables window. Click new button in System variables section.

  1. Set a variable name SONAR_RUNNER_HOME and its value should be the unzipped path of sonar-runner zip file.

    Example:- variable name:- SONAR_RUNNER_HOME variable value:- C:\sonar-scanner

  2. And then append sonar-runner's bin path %SONAR_RUNNER_HOME%\bin to the environment variables path.

    Example:- variable name:- PATH variable value:- %SONAR_RUNNER_HOME%\bin;

Step 2:

a. Install the for Jenkins via the Jenkins Update Center

b. Configure sonarqube server to Jenkins

  1. Configure your SonarQube server(s)

  2. Log into Jenkins as an administrator and go to Manage Jenkins > Configure System: Scroll down to the SonarQube configuration section, click on Add SonarQube, and add the values you're prompted for.

Generate the user token by logging into the SonarQube website and provide the key details in Jenkins for SonarQube versions above 5.2.

Step 3:Configure the tools in Jenkins Global Configuration

This step is mandatory if you want to trigger any of your SonarQube analyses with the SonarQube Scanner. You can define as many scanner instances as you wish. Then for each Jenkins job, you will be able to choose with which launcher to use to run the SonarQube analysis.

  1. Log into Jenkins as an administrator and go to Manage Jenkins > Global Tool Configuration

  2. Scroll down to the SonarQube Scanner configuration section and click on Add SonarQube Scanner. It is based on the typical Jenkins tool auto-installation. You can either choose to point to an already installed version of SonarQube Scanner (uncheck 'Install automatically') or tell Jenkins to grab the installer from a remote location (check 'Install automatically').

If you don't see a drop down list with all available SonarQube Scanner versions but instead see an empty text field then this is because Jenkins still hasn't downloaded the required update center file (default period is 1 day). You may force this refresh by clicking 'Check Now' button in Manage Plugins > Advanced tab.

SonarQube Scanner