Sonar is an open platform to manage code quality. It covers the 7 axes of code quality
Sonar supports a wide range of programming languages such as Java, C, C# etc
Through this article, we are going to see how to set up a Sonar Server and how to integrate a Java Project with it.
Prerequisites
- MySQL 5.1
- Maven 2.2.1 or higher
- Sonar Server
Let’s start !!
Download Sonar server from the Sonar Website and unzip it.
Prior to starting the Sonar server, we need to start the MySQL Server.
Now that MySQL server is up, we need to configure it to the Sonar Server
Navigate to /conf and open sonar.properties in notepad++.
and remember to give this configuration as well (our MySQL database URL)
Now that the server is configured, lets start the Sonar Server.
Remember, Sonar is a web-based application.
Don’t worry if you doesn’t see any change in the console. Nothing gets printed on this console.
Instead, we have to check the sonar.log available under <sonar installation directory>/logs
In the logs, you will see
2011.09.15 11:20:50 INFO org.sonar.INFO Enable profiles…
2011.09.15 11:20:50 INFO org.sonar.INFO Enable profiles done: 93 ms
2011.09.15 11:20:50 INFO org.sonar.INFO Activate default profile for c
2011.09.15 11:20:50 INFO org.sonar.INFO Activate default profile for java
2011.09.15 11:20:50 INFO org.sonar.INFO Register quality models…
2011.09.15 11:20:50 INFO org.sonar.INFO Register quality models done: 0 ms
2011.09.15 11:20:50 INFO org.sonar.INFO Start services done: 41066 ms
This “Start services done” in the above log means the server is up and ready for servicing.
Now that the server is up and running, lets integrate the Java Project that we created earlier using Maven (hope you know how to create Simple Java Project using maven)
Goto the Java project root in command prompt and execute the following maven command
mvn sonar:sonar
The console will say Build Successful.
Once you see this message, open Firefox or IE and navigate to the URL
http://localhost:9000
This console will list all the Projects that we integrated






[...] SONAR – manage your code quality By ShamanOfJava, 10 October 2011 Sonar is an open platform to manage code quality. It covers the 7 axes of code quality. Sonar supports a wide range of programming languages such as Java, C, C# etc. Through this article, we are going to see how to set up a Sonar Server and how to integrate a Java Project with it. [...]