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.

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

3 Comments
  • 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.

  • Posted at 4:43 pm, May 29, 2017

    Greate pieces. Keep posting such kind of info on your blog.
    Im really impressed by your blog.
    Hi there, You have performed a great job. I’ll certainly digg it and in my opinion suggest to my friends.
    I am confident they will be benefited from this site.

  • 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

Post a Comment

Comment
Name
Email
Website