plugin does not execute custom xpath rules
A source code analyzer
Brought to you by:
adangel,
juansotuyo
Plugin will run a local project ruleset but does not execute any custom xpath rules. The standard PMD rules will be run but no custom rules appear to be executed. This used to work in previous versions.
Discussion: PMD Does Not Respect Eclipse Settings
Discussion: Migration Problems (Maven, Eclipse plugin)
I forgot to add that the project ruleset file works fine from the command line and does execute the custom xpath rules.
Can confirm this behaviour, custom rules (or even only renamed rules) get ignored in Eclipse, but work fine with command line/ant.
Can you check, which rules you have enabled in the workspace preferences?
If I remember correctly, the PMD plugin uses only the rules, that are enabled there.
It is debatable though, whether this is correct behavior or not...
right, when I import my custom rules there and then use my local rulefile it works, thanks! :)
But isn't this the reason for a local ruleset for the project, to not depend on global settings?
Last edit: Michael Pini 2013-10-02
IMHO, this is a serious regression from previous behavior. We have dozens of projects and each project autogenerates its own custom rules using maven. With this change, users will have to manually import custom rules from every project into the global list before they will execute.
Alright, it seems that this bug was actually meant to be a feature:
So, the goal is, to disable specific rules temporarily. But, of course, if you use custom rules, they are not in this global list and hence not activated.
Would it make sense, to change the behavior in that way, that by default every rule is activated and you need to explicitly disable rules if you want to use this feature? For custom rules this means, you would need to import these into the global rules preferences, if you want to disable them.
What do you think?
Fixed with 4.0.2.v20131031-1124.
See Release Notes