Wednesday, December 15, 2010

integrate checkstyle java custom rules in eclipse

A few days ago a customer ask me for integration of checkstyle java custom rules in eclipse. For now they only use command line while checking their supplier delivery.
So I have an XML file (Checkstyle settings) and a jar.
When looking in eclipse-cs plugin preferences I didn't find a way to take in account my jar. After a few internet searches in found on the eclipse-cs this link. And all comes clear. To do this integration you have to create an eclipse plugin using eclipsecs extension point :
  • check out the source code of "net.sf.eclipsecs.sample"
  • put the jar in this plugin project and add this jar to the plugin class path
  • put your xml settings in the plugin and and use plugin extension "net.sf.eclipsecs.core.configuration" for registration (location ="yourSettings.xml). see
  • Package and deploy.

2 comments:

  1. Can you please elaboarte which jar to put where and how? I am struggling to add my custom rules project in Eclipse.

    ReplyDelete
  2. Hi, the jar that I speake concern custom java Check (see here for example) packaged in a jar file.
    Here I does the integration using the eclipse cs sample plugin project "net.sf.eclipsecs.sample" and adapt it.
    Deploy this plugin enable access to the custom rules.

    ReplyDelete