Ended up using the //NOPMD comment tag to exclude these cases, which is supported by the plugin. As far as I know, you can't use that mechanism to turn off only certain PMD rules, so conceivably you could end up hiding other errors that you don't want to hide, but I think it's close enough for now. It's better than having a bunch of extraneous errors in the report or turning off the rule altogether.
On Tue, Feb 22, 2011 at 6:10 PM, Wayne Fay <[email protected]> wrote: > > work). But can you configure it to not run certain rules only on certain > > files? For example, can I tell it to not run the AvoidDuplicateLiterals > on > > just a single file? > > If you can configure PMD itself to support this requirement, then most > likely the Maven2 plugin can be configured to support it as well, but > it may require some modification of the plugin code. This is such a > specific requirement, I doubt anyone has needed to do it previously so > you're probably in for some hacking... but plugins are generally > simple to figure out and many are open source, so you should be able > to make it work with a little effort. > > Wayne > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >
