Pages

Tuesday, October 30, 2012

NetBeans 7.2.x Tip of the Day: Sharing PMD Configuration Files

I use the PMD plugin for NetBeans 7.2 for my development. If you are not using it, you should consider it. The plugin uses the ruleset from PMD project for static code analysis. Members of my team asked which rules I use when I evaluate their code so that they can handle it before I look at their code. I thought it would be as simple as exporting it, but that was not the case.

I filed an enhancement request for the feature: Export PMD Default Configuration Ruleset. Until it is added as a feature, here is how to pass your selected ruleset along.

The file that contains the rules which I am using is called pmd.properties. The file is located in a couple of different places depending on if you are using Windows, or Mac OS X.

On Mac OS X it is located:

/Users/{USER_HOME}/Library/Application Support/NetBeans/7.2.1/config/Preferences
On Windows it is located:

C:\Users\{YOUR_USER_DIRECTORY}\AppData\Roaming\NetBeans\7.2\config\Preferences
I hope that helps if you need to share your rules.

No comments:

Post a Comment