Download the sonar
here http://dist.sonar.codehaus.org/sonar-
3.5.1.zip and unzip the download to your
favorite folder
Unzip and Install
After Unzip you will see folder structure would
look something like as follows..
 Run Sonar
Depends on your OS, you need to run the
executable , for an instance if you are running
linux-x86 and 64 bit, then you need to run
start.sh
 Sonar Console
 Access your Sonar installation
Now you can browse your sonar
installation http:localhost:9000
 Generate Sonar Report
 After we have the sonar installed, we can
generate the reports for any maven project,
by adding the following lines in your project
pom.xml
 Go to Help > Install New Software... This
should display the Install dialog box.
 Paste the Update Site URL (http://dist.sonar-
ide.codehaus.org/eclipse/) into the field Work
with and press Enter. This should display the
list of available plugins and components:
Figure - Sonar Eclipse Plug-in Install
Choose Sonar Java, follow the steps and install the plugin
Note: Please make sure the project that you want to associate with sonar
has already analyzed in your sonar installation
 Configure your local/remote sonar in your
Anypoint Studio
 Go to Window > Preferences > Sonar >
Servers.
 Sonar Eclipse is pre-configured to access a
local Sonar server listening
on http://localhost:9000/. You can edit this
server, delete it or add a new one.
 Once the Sonar server is defined, the next
step is to link your Anypoint Studio projects
with projects defined and analyzed on this
Sonar server.
 To do so, right-click on the project in the
Project Explorer, and then Configure >
Associate with Sonar...:
 In the Sonar project text field, start typing
the name of the project and select it in the
list box:
 Click Finish. Your project is now associated
to one analyzed on your Sonar server
 Analyze and clean up the code violations
Do local analysis and clean the violations
 Run Sonar Analysis in Local
Run Sonar Analysis on Local
Sonar violation analysis console II
sonar violation analysis console
Sonar violations Markers

Sonar

  • 2.
    Download the sonar herehttp://dist.sonar.codehaus.org/sonar- 3.5.1.zip and unzip the download to your favorite folder
  • 3.
    Unzip and Install AfterUnzip you will see folder structure would look something like as follows..
  • 4.
     Run Sonar Dependson your OS, you need to run the executable , for an instance if you are running linux-x86 and 64 bit, then you need to run start.sh
  • 5.
  • 6.
     Access yourSonar installation Now you can browse your sonar installation http:localhost:9000
  • 7.
     Generate SonarReport  After we have the sonar installed, we can generate the reports for any maven project, by adding the following lines in your project pom.xml
  • 8.
     Go toHelp > Install New Software... This should display the Install dialog box.  Paste the Update Site URL (http://dist.sonar- ide.codehaus.org/eclipse/) into the field Work with and press Enter. This should display the list of available plugins and components:
  • 9.
    Figure - SonarEclipse Plug-in Install Choose Sonar Java, follow the steps and install the plugin Note: Please make sure the project that you want to associate with sonar has already analyzed in your sonar installation
  • 10.
     Configure yourlocal/remote sonar in your Anypoint Studio  Go to Window > Preferences > Sonar > Servers.  Sonar Eclipse is pre-configured to access a local Sonar server listening on http://localhost:9000/. You can edit this server, delete it or add a new one.
  • 11.
     Once theSonar server is defined, the next step is to link your Anypoint Studio projects with projects defined and analyzed on this Sonar server.  To do so, right-click on the project in the Project Explorer, and then Configure > Associate with Sonar...:
  • 12.
     In theSonar project text field, start typing the name of the project and select it in the list box:  Click Finish. Your project is now associated to one analyzed on your Sonar server
  • 13.
     Analyze andclean up the code violations Do local analysis and clean the violations
  • 14.
     Run SonarAnalysis in Local Run Sonar Analysis on Local
  • 15.
    Sonar violation analysisconsole II sonar violation analysis console
  • 16.