Integrate SonarQube with Jenkins


Integrate SonarQube with Jenkins


SonarQube is a free and open source code quality measuring and management tool which is developed using java and maintained by sonarsource. It can analyze source code in 20+ different languages. Input can be the project source code or compiled code depending on the language.

Install SonarQube 5.6.6 (LTS *)

Start sonarQube

Install maven

Run this command to install the latest Apache Maven.

Ensure that you successfully installed maven on your machine

Configure sonarQube with maven

Open settings.xml maven config

Go to pluginGroups tag and add

Go to profiles tag and add

SonarQube plugin in Jenkins

Install SonarQube in Jenkins

Login to Jenkins dashboard and navigate to Manage Jenkins >> Manage Plugins >> Available Tab and select “SonarQube Scanner for Jenkins” plugin and install.

Configure sonarQube with Jenkins

Add MAVEN_HOME in Jenkins

Go to Manage Jenkins >>cofiguring the system, Search SonarQube servers section, Check “Enable injection of SonarQube server” and click “Add a SonarQube installation” button

In the build configuration go to Actions following the build section and click “Add an action after the build” button and choose “SonarQube analysis with Maven”

Author: Ayman Ben Amor

  • Posted at 8:34 am, May 6, 2017

    Thank you for sharing your thoughts. I truly appreciate your efforts and I am waiting for your
    further write ups thank you once again.

  • saravanan
    Posted at 6:36 am, September 19, 2017


    Thanks for your information. I have separate slave nodes for jenkins and i want to sonar analysis from slave nodes. I have installed sonarqube on separate machine. how do i configure the pipeline script to run sonarqube remotely from master

  • cynda
    Posted at 4:43 pm, January 31, 2018


    Thanks for your information

  • Posted at 4:47 am, May 23, 2018

    Just fabulous. Who wrote this and how can we get more?

Post a Comment