Sonar setup

14 Mar

Hi folks,

Here is the elaborated post how to do the Sonar setup for your web application.

Just follow the below steps to setup Sonar code review tool for your application.

Step-1 :

1. In Eclipse, Go to Help -> Install New Software. This should display the “Install” dialog.
2. Paste the below URL into the field named “Work with:” and press Enter.

3. Choose the component listed under Sonar: “Sonar Integration for Eclipse (Required)”.
4. Click Next. Eclipse will then check to see if there are any issues which would prevent a successful installation.
5. Click Finish to begin the installation process. Eclipse will then downloads and install the necessary components.
6. Once the installation process is finished, Eclipse will ask you if you want to restart the IDE. It’s strongly recommended that you restart eclipse IDE.
7. In Eclipse , Go to Windows -> Preferences -> Sonar server
8. Remove and http://localhost:9000 as well.


1. Create a new folder (sonar setup) in your local machine, download the below 2 softwares from the google.
1. sonar 3.0

2 Modify the existing code in setting.xml file(location : apache-maven-3.0.4\conf\setting.xml) with your project information.
3. Create JAVA_HOME and MAVEN_HOME variable in users variable Section Under Environment Variables (User Variables and also in System variables)
4. Create pom.xml file and place in the below location : apache-maven-2.2.1\bin

sample pom.xml
<project xmlns=”;
<name>your project name</name>
<sourceDirectory>source code path (path for java classes directory)</sourceDirectory>
<outputDirectory>path for classes directory</outputDirectory>

Note: In the above configuration, modify sourceDirectory and outputDirectory value path to your local machine path.


1. Start Sonar Server by clicking on StartSonar.bat command (location:sonar-3.0\bin\windows-x86-32\StartSonar.bat)
2. Do the Clean build using the below maven commands:
In Command Prompt, go to the location: apache-maven-3.0.4\bin and start executing the below commands, make sure that below 2 commands will execute with out any errors.
1. mvn clean install sonar:sonar
2. mvn sonar:sonar
3. Use the below URL to see the dashboard of your application
Local URL: http://localhost:9000/

Reference URLs:

2. http://sonarpvwin:9000/

Happy Learning!!.

Get glued to know more updates.

Have a nice day šŸ™‚

1 Comment

Posted by on March 14, 2013 in Uncategorized


One response to “Sonar setup

Leave a Reply

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

You are commenting using your 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

%d bloggers like this: