How to Integrate SONAR with Hudson


What is SONAR ?

SONAR is code reviewing tool. SONAR needs to be integrated with Hudson so that whenever someone check-in code, then it will be reviewed by SONAR before making a build. Hudson provides a plugin for SONAR and we need maven installed and configured with Hudson for this.

How to configure SONAR to work with Hudson ?

Below are the steps to configure SONAR & Hudson Integration:

Step 1: Download, install and start the Sonar Server. 
Download the latest Sonar release from http://dist.sonar.codehaus.org/sonarqube-4.0.zip

Unzip the distribution. Based on your platform, run the batch file or the shell script from within the bin folder. Open a web browser and browse to http://localhost:9000. The default login and password is admin/admin.

Step 2: Install and Configure Sonar plugin on Hudson.

Open your Hudson dashboard http://IP:port. Click on Manage Hudson – Manage Plugins. Click now on the Available tab, you should see the Hudson Sonar Plugin. Check this plugin and click on the Install button at the far right hand corner. Restart Hudson and you should be able to see the plugin in the Installed tab as shown below:

Image

Next, configure the Sonar plugin from within Manage Hudson -> Configure System and Change all required parameters

Image

Step 3: Configure your Hudson Job 

In order to activate Sonar on a project, click on Configure, and within the Post-build Actions, check Sonar and you should see the following properties. Fill those properties and Save this configuration.

Image

Step 4: Build your project

Even though you don’t require Maven to be used as a build tool for your project, Sonar does still require Maven to run. Force a build on your Job on the Hudson dashboard. If Maven is installed, you should be able to see the following output in the Console Output on Hudson dashboard.

Image

Step 5: Browse to Sonar Dashboard

Once the build succeeds in the last step, browse to http://localhost:9000(change port and localhost as per your environments that you have configured). And you should be able to see the Sonar Dashboard.

 

About Alex Hunt

Hi All I am Manish Kumar Jha aka Alex Hunt. I am currently working in VMware Software India Pvt Ltd as Operations System Engineer (vCloud Air Operations). I have around 5 Years of IT experience and have exposure on VMware vSphere, vCloud Director, RHEL and modern data center technologies like Cisco UCS and Cisco Nexus 1000v and NSX. If you find any post informational to you please press like and share it across social media and leave your comments if you want to discuss further on any post. Disclaimer: All the information on this website is published in good faith and for general information purpose only. I don’t make any warranties about the completeness, reliability and accuracy of this information. Any action you take upon the information you find on this blog is strictly at your own risk. The Views and opinions published on this blog are my own and not the opinions of my employer or any of the vendors of the product discussed.
This entry was posted in Linux/CentOS. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s