On a typical project (especially larger ones) there will developers using different versions of eclipse (or other IDEs), different versions of PMD, different versions of the eclipse PMD plugin. A typical developer may be working on several projects, so enforcing specific versions of tools for specific projects is not realistic.
In order to provide consistency across the project from a static analysis point of view, the project must maintain a standard PMD configuration file. Currently the PMD configuration files are not backwards compatible. So every time we get a new developer on the project or someone decides to upgrade their toolset, there are always issues with PMD changes that need to be resolved, which take longer than you might expect and lots of times developers just skip it because its a blocker in their existing goal.
Let's take, for example the recent rule name changes.
1) UseSingleton -> UseUtilityClass
2) MethodNamingConvention -> MethodNamingConventions
If a configuration file contains a <exclude name="UseSingleton"/> in one version, this will fail to work in a future version, breaking backwards compatibility. It should be pretty easy to add checks for these types of changes in the future, print out a warning and just disable the appropriate rule with the new name.
I realize that some code puritans will think this feature request is "whiny", but if you want wider adoption of your tool and have it "just work", this feature is a must have.
This feature will be available with PMD 5.3.8, PMD 5.4.2 and PMD 5.5.0 and later.
See the new class RuleSetFactoryCompatibility.
Merge commit in master: https://github.com/pmd/pmd/commit/ba18ee705e5da32fd379206b38e283aef2186304
Note: I couldn't find the MethodNamingConventions case - I guess, this was just a typo. The rule is called MethodNamingConventions (with the s) and I couldn't see, that it has been renamed or so in the past.