Integrate SonarQube with Jenkins

jenkins

Integrate SonarQube with Jenkins

Introduction

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.

sonarqube_Installation

Configure sonarQube with Jenkins

Add MAVEN_HOME in Jenkins
Maven

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

sonarQube_servers

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”
analyse_with_sonar

Avatar for Ayman Ben Amor

Author: Ayman Ben Amor

4 Comments
  • Avatar for 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.

  • Avatar for Ayman Ben Amor
    saravanan
    Reply
    Posted at 6:36 am, September 19, 2017

    hi,

    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

  • Avatar for Ayman Ben Amor
    cynda
    Reply
    Posted at 4:43 pm, January 31, 2018

    hi,

    Thanks for your information

  • Avatar for Ayman Ben Amor
    Posted at 4:47 am, May 23, 2018

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

Post a Comment

Comment
Name
Email
Website