Step 1: Download, install and start the Sonar Server.
Download the latest Sonar release from here. Unzip the distribution to your favorite location, mine was in C:\dev\projects\sonar-1.11.1. Based on your platform, run the batch file or the shell script from within the bin folder. On windows, it is C:\dev\projects\sonar-1.11.1\bin\windows-x86-32\StartSonar.bat.
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. Mine is located at http://localhost:7223. 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:
Next, configure the Sonar plugin from within Manage Hudson -> Configure System. I am using the default database, and so didn't make any changes here. However, if you are using a different database server, you need to provide the database URL, username, password and so on as shown below.
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.
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. If Maven isn't installed, you can download and install Maven from here.
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.
Step 5: Browse to Sonar Dashboard
Once the build succeeds in the last step, browse to http://localhost:9000. And you should be able to see the Sonar Dashboard as such:
That's all it is to download, install, configure and get continuous quality updates from Hudson and Sonar. The above steps took me less than 15 minutes.
I am sure many of you are already using Sonar. I haven't used it with any of my clients yet. Hopefully, will do so soon. Share your thoughts if you are using Sonar.









