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 SonarQubeTM in Eclipse for versions 3.2+.

For versions prior to 3.2, browse this page.

Note
To use SonarQubeTM in Eclipse on a project, it is required that the project has been first analyzed by SonarQubeTM.

...

To take full advantage of SonarQube in Eclipse, it is recommended that your project be analyzed on a regular basis by SonarQube. Regular analysis allows the Eclipse plugin to distinguish between existing issues and any new ones you introduced.

If your project is not already under analysis, you'll need to declare it through the SonarQube web interface. 

Once your project exists in SonarQube, you're ready to get started with SonarQube in Eclipse.

Setting SonarQube Servers

Go to Window > Preferences > Sonar SonarQube > Servers.

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

The user you set to access the server has to be granted the Execute Preview Analysis permission.
Image Added

Linking a Project to One Analyzed on a SonarQube

...

Server

Linking for the first time

Once the SonarQube TM server is defined, the next step is to link your Eclipse projects project with projects a project defined and analyzed on this SonarQubeTM serverSonarQube server.

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

Image RemovedImage Added

In the Sonar SonarQube project text field, start typing the name of the project and select it in the list box:

Image RemovedImage Added

Click on Finish. Your project is now associated to one analyzed on your SonarQube TM 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 SonarQubeTM rather than the language's default profile.

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

...

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

Image RemovedImage Added

Unlinking a Project

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

Image RemovedImage Added

 

Advanced Configuration

Severity of SonarQubeTM Markers

You can set the severity of SonarQubeTM markers and SonarQubeTM markers for new violations by going to Additional settings (such as markers for new issues) are available through Window > Preferences > Sonar.SonarQube:

 Image Added

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