If you are running an open source project at eclipse.org, 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 maven.eclipse.org 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:
<parent> <groupId>org.eclipse</groupId> <artifactId>eclipse-parent</artifactId> <version>1.0.0</version> </parent>
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.