Eclipse Sonar Plugin 0.1 in screenshots

The Sonar Team is very proud to announce the availability of the first version of the Sonar Eclipse plugin. This plugin is part of the Sonar IDE Project. This first version comes just few a weeks after the release of the Sonar IntelliJ IDEA plugin. The project has 2 active contributors : Jérémie and myself.

The work has been greatly facilitated by the good feedback we received from the Sonar community on the release candidate version. It is going to be followed by new ones in the upcoming weeks/months (see My proposal for GSoC (Google Summer of Code) 2010).

This version 0.1 only displays violations. Duplicated blocks, code coverage and commented out lines of code will be added later. As for the Sonar IntelliJ IDEA plugin, source code is decorated on the fly with information provided by the Sonar web server.

As usual for releases, let’s go through screenshots to discover this new functionality and how it can be used in your daily work to track violations. Enjoy !

Configuration

By default, the plugin tries to reach a local Sonar web server on port 9000 to get violations. But it is possible to define different and several Sonar web servers to use in the Eclipse global preferences :

For instance, for Open Source projects available in Nemo, the configuration would be :

Once, the Sonar web server to be used has been configured, the next step is to activate the Sonar plugin on a given project. If you use m2eclipse, there is nothing to do as the groupId and artifactId of your project are automatically configured. Nevertheless, you may want to change the default Sonar server to use :

Source code decoration

Then you just have to open the java file you want to work on and violations are displayed with markers (on the left-hand side) :

Global source code Inspection

To start hunting violations on the overall project, you can use the Problems View :

Go to Sonar

At any time you can jump onto the Sonar Web dashboard directly from the IDE, to get information that is not yet available in the Sonar Eclipse plugin :

Navigator

Sonar Server Navigator allows you to browse all available projects in a specified Sonar server :

Roadmap

Next version 0.2 will allow to visualize duplicated blocks, code coverage, … directly inside Eclipse, so stay tuned.

To give it a try, you can add it to your favourites in Eclipse Marketplace or install directly using update-site. For more information you can visit Sonar IDE site.

  • will maven-eclipse-plugin automatically generate the .settings/org.sonar.ide.eclipse.prefs for me?
    In particular, I have to manually populate the projectGroupId
    and also verify that the projectArtifactId matches the pom

  • Hi

    I am trying to install Sonar plugin, but there are some problem. If I put http://dist.sonar-ide.codehaus.org/eclipse/ in my Eclipse (Galileo) it says no repository found. If I put http://dist.sonar-ide.codehaus.org/eclipse/plugins/org.sonar.ide.eclipse.sonar_embedder_0.1.0.201005260312.jar

    in my /eclipse/plugins folder Eclipse doesn’t recognize the plugin, and if I check in plugins, the icon before plugin apperas broken.

  • Hi,

    2 Boris : Could you please switch to the mailing list in order to troubleshoot your problems? and provide more details – like exact version of your eclipse and so on. Moreover org.sonar.ide.eclipse.sonar_embedder_0.1.0.201005260312.jar is just a part of plugin.

    2 bchaplin1 : If I correctly understand your question – answer is yes – if you use maven-eclipse plugin, you still need to configure Sonar Eclipse plugin.

  • Hi,

    I installed the plugin Sonar for Eclipse and that work fine.

    But when I want to start my Tomcat server to run the web application, the starting fails.

    Without the plugin, there is non problem and after unstalling the pluginm the problem stays.

    I didn’t find where to post this bug, so I came here.

    here is the log of the error:
    java.lang.NoSuchMethodError: org.eclipse.wst.server.core.model.ServerBehaviourDelegate.getTempDirectory(Z)Lorg/eclipse/core/runtime/IPath;
    at org.eclipse.jst.server.tomcat.core.internal.TomcatServerBehaviour.getTempDirectory(TomcatServerBehaviour.java:620)
    at org.eclipse.jst.server.tomcat.core.internal.TomcatVersionHelper.getStandardBaseDirectory(TomcatVersionHelper.java:154)
    at org.eclipse.jst.server.tomcat.core.internal.Tomcat60Handler.getRuntimeBaseDirectory(Tomcat60Handler.java:112)
    at org.eclipse.jst.server.tomcat.core.internal.TomcatServer.getRuntimeBaseDirectory(TomcatServer.java:316)
    at org.eclipse.jst.server.tomcat.core.internal.TomcatServerBehaviour.getRuntimeBaseDirectory(TomcatServerBehaviour.java:103)
    at org.eclipse.jst.server.tomcat.core.internal.TomcatServerBehaviour.getRuntimeProgramArguments(TomcatServerBehaviour.java:115)
    at org.eclipse.jst.server.tomcat.core.internal.TomcatServerBehaviour.setupLaunchConfiguration(TomcatServerBehaviour.java:833)
    at org.eclipse.wst.server.core.internal.Server.setupLaunchConfiguration(Server.java:1440)
    at org.eclipse.wst.server.core.internal.Server.getLaunchConfiguration(Server.java:1483)
    at org.eclipse.wst.server.core.internal.Server.startImpl2(Server.java:3048)
    at org.eclipse.wst.server.core.internal.Server.startImpl(Server.java:3001)
    at org.eclipse.wst.server.core.internal.Server$StartJob.run(Server.java:300)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

  • Hi Gael Sonney,
    Please switch to the users mailing list ( http://www.sonarsource.org/support ) in order to troubleshoot your problems.

Leave a reply


4 × nine =