Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Info
iconfalse
titleTable of Contents

Table of Contents
maxLevel1

Info

This page documents how to configure SonarQube in Eclipse for versions 3.2+.

For versions prior to 3.2, browse this page.

Note
To use Sonar SonarQube in Eclipse on a project, it is required that the project has been first analyzed in a standard way by SonarSonarQube.

Setting

...

SonarQube Servers

Go to Window > Preferences > Sonar > Servers.

Sonar SonarQube in Eclipse is pre-configured to access a local Sonar SonarQube server listening on http://localhost:9000/. You can edit this server, delete it or add a new one.

Linking a Project to One Analyzed on a

...

SonarQube Server

Linking for the first time

Once the Sonar SonarQube server is defined, the next step is to link your Eclipse projects with projects defined and analyzed on this Sonar serverSonarQubeserver.

To do so, right-click on the project in the Project Explorer, and then Configure > Associate with Sonar...:

...

Click on Finish. Your project is now associated to one analyzed on your Sonar server.SonarQube server. This means that you'll be able to see existing issues for the project in Eclipse, and that when you run a local analysis in Eclipse, it will use the rule profile the project is assigned to in SonarQube rather than the language's default profile.

Info
titleAutomatic association for Maven projects
Note that for Maven projects, the association is performed automatically.

Changing linkage

At any time, it is possible to change the project association.

To do so, right-click on the project in the Project Explorer, and then Sonar > Change project association...:

Unlinking a Project

To do so, right-click on the project in the Project Explorer, and then Sonar > Remove Sonar Nature:

Configuring Mylin to deal with Reviews

A Sonar Mylyn connector allows to track reviews.

Creating a Sonar Task Repository

 To start using this feature, a new Sonar task repository has to be created (see the Mylyn documentation page for more information):

Image Removed

...

Image Removed

Creating a Query

To browse the reviews, you can create as many queries as you wish:

Image Removed

Here's an example of a query that retrieves all the reviews assigned to you on every project:

Image Removed

The reviews should now appear in the Task List view:

Image Removed

 

Advanced Configuration

Severity of

...

SonarQube Markers

You can set the Severity of Sonar Markers severity of SonarQube markers and SonarQube markers for new violations by going to Window > Preferences > Sonar.

...

You are now all set with configuration and you can start using Sonar SonarQube in Eclipse.