SONAR Setup on Local Environment

Below are the steps for configuring SONAR on your local setup-

1. Download SONAR from http://www.sonarsource.org/downloads/ (latest version 3.4.1).
2. Download sonar runner from http://repository.codehaus.org/org/codehaus/sonar-plugins/sonar-runner/2.0/sonar-runner-2.0.zip and paste it in Sonar home directory as mentioned in previous step.
3. Download “apache-maven-3.0.5” from apache site.
4. Define SONAR_RUNNER_HOME (e.g.-  C:\sonar-3.4.1\sonar-runner-2.0) in system environment variable.
5. Add entry-  %SONAR_RUNNER_HOME%\bin;C:\apache-maven-3.0.5\bin in PATH system environment variable.
6. Go to C:\sonar-3.4.1\bin\windows-x86-32 directory and run startsonar.bat.
7. Hit http://localhost:9000 to check server has been successfully started or not.
8. Create “sonar-project.properties” and “pom.xml” file in your project root folder (Attached with email for your reference).
9. Navigate to your project using command prompt and run sonar-runner.bat. This will start analysing your project using Sonar rules.
10.Refresh url http://localhost:9000 and you will see your project configured on the sonar dashboard. Click on the project and analyse quality report for the project.
11.   For generating pdf report for project, execute below command-
mvn org.codehaus.sonar-plugins.pdf-report:maven-pdfreport-plugin:1.3:generate
12.   A pdf report will be generated in ${project-home}/target directory.

No comments: