29

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.

madhead
  • 31,729
  • 16
  • 153
  • 201
akram
  • 507
  • 3
  • 10
  • 17

2 Answers2

29

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.

peak
  • 105,803
  • 17
  • 152
  • 177
  • 3
    At the moment I'm not very pleased with codehaus, as this is the third page I've gone to with this question that links to the same set of deleted pages on their wiki. Apparently we are expected to switch to SonarQube. – k-den Jun 13 '13 at 21:36
  • @SonarQubeTeam it isn't at all obvious that you have to run your first analysis "outside of eclipse" to get the eclipse plugin to talk to the SonarQube server. I don't see this spelled out anywhere except here in your otherwise great documentation. – jordanpg Jan 17 '15 at 17:21
  • 1
    By definition, the Eclipse project must be assigned to an SonarQube one. So existence requirement is perfectly intelligible... Else, read [Configuring SonarQube in Eclipse](http://docs.sonarqube.org/display/SONAR/Configuring+SonarQube+in+Eclipse) from Confluence User's guide. – LoganMzz Jul 07 '15 at 11:44
5

Sonar can be run now localy to analyse the java project

for more information visit sonar eclipse

Also you can visit DZONE for step by step installation procedure

schnatterer
  • 7,525
  • 7
  • 61
  • 80
Shirishkumar Bari
  • 2,692
  • 1
  • 28
  • 36