Using SonarQube in Eclipse

akram picture akram · Nov 2, 2011 · Viewed 57.1k times · Source

I just installed SonarQube in Eclipse, but I don't know how to use it :

Here It said: Link projects to Sonar server

What is the server? Should we create another project somewhere else with the same name as the project in Eclipse?

It's really confusing, I will appreciate if someone could help by a small example.

Answer

To be able to use Sonar Eclipse, you first need to install a Sonar server 5.1 or older as described here: http://docs.sonarqube.org/display/SONAR/SonarQube+in+Eclipse

Then, you will have to run a first analysis (out of Eclipse) of your project to have it referenced in the Sonar server. See http://docs.sonarqube.org/display/SONAR/Analyzing+Source+Code

After those 2 steps, then you'll be able to run analyses directly within Eclipse once you have associated your local project with the Sonar server.

UPDATE: Sonar 5.2+ is no longer supporting sonar eclipse plugin in favor of sonarlint. Unfortunately sonarlint has no customization options.

We will make this feature available in upcoming versions, probably by requiring to "connect" SonarLint with an existing SonarQube server instance.