maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrey Utis (JIRA)" <>
Subject [jira] (MPMD-161) PMD/CPD violation exclusions by class/issue
Date Mon, 04 Feb 2013 19:30:13 GMT


Andrey Utis updated MPMD-161:

    Attachment: pmd_exclude_trunk_v2.patch

I added annotations for the parameters passed from the pom. Is that what you meant?

I also added unit tests in a similar style to what was already there. Let me know if this
is what you need.

> PMD/CPD violation exclusions by class/issue
> -------------------------------------------
>                 Key: MPMD-161
>                 URL:
>             Project: Maven 2.x PMD Plugin
>          Issue Type: New Feature
>          Components: CPD, PMD
>            Reporter: Andrey Utis
>            Assignee: Olivier Lamy
>             Fix For: 3.0
>         Attachments: pmd2.7.1_exclusions2.patch, pmd_exclude_trunk.patch, pmd_exclude_trunk_v2.patch
> I work on a system that has a lot of legacy code with a lot of PMD/CPD violations. Introducing
PMD to the build is not an easy option, since the build would always fail. So the next best
thing is to exclude any existing violations and only fail if a new violation is introduced.
Unfortunately, if I have thousands of violations, PMD doesn't provide a good way to do this.
I'd have to add comments or annotations to all these places to ignore the violation.
> We came up with an alternative solution to this. We modified the PMD plugin to read a
properties file that contains a mapping of class name to a list of excluded violations. If
a particular violation is in this file, it does not cause the build to fail. Similar idea
for CPD. 
> An svn patch is attached (apply to 2.7.1)
> (Disclaimer: this is probably not the most elegant piece of code but it works and it
was quick. Feel free to re-factor and make it more in line with the rest of the plugin code)

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message