Eclipse Parent POM and Static Code Analysis

If you are running an open source project at, and are using Maven then we have some good news for you.   A newly deployed Parent POM has been created for your use.  To use the parent pom, you will need to either use the settings.xml file during your build, or make sure your maven build has the public repository available to it.

To make your existing build use the new parent pom, just add to your project’s parent pom the following:


By adding the above your project will inherrit some standard default meta information, such as location of the Continuous Integration Builds, Licensing, etc. Also, your project will have available to it some standard profiles as well. This includes some static code analysis profiles that can be used during your builds.

  • analysis – enables FindBugs and PMD Duplicate Code Detectors to run during the build.  These will output XML formatted reports that can be used by Hudson to display the overall results.
  • checkstyle – enables source code and project specific style checks.  By default it uses the sun default profile, but projects can override this and provide their own specific checks.

To enable any of these profiles during your build, just run maven with:

mvn clean install -Panalysis

Static code analysis is one of the most under used items by Eclipse Foundation projects.  Mainly because it was very difficult and time consuming to get it to run during a build.   Hopefully more projects start running the reports and paying attention to them. We might be able to catch possible bugs and performance issues ahead of time, before they reach a need to do a stop ship fix. I applaud CDT for including such an item, something that the JDT and the Eclipse EPP packages should have bundled together by default.

This entry was posted in clean code, craftsmanship, eclipse, maven, tycho. Bookmark the permalink.

5 Responses to Eclipse Parent POM and Static Code Analysis

  1. Dominik says:

    Link points to some bug in Equinox!

  2. Pingback: Dave Carver: Eclipse Parent POM and Static Code Analysis

  3. Dave, I believe Dominik is mentioning the link in the following sentence, not the one at the end of the blog post! 🙂 (see ” A newly deployed Parent POM has been …”)

  4. kingargyle says:

    Ah thanks, sorry about that. I’ve updated the entry to point to the correct wiki page describing how to use it.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s