maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Justin Shepard (JIRA)" <>
Subject [jira] [Commented] (MPMD-186) Class Name with slash is omitted from exclusions on pmd:check
Date Tue, 01 Dec 2015 19:48:11 GMT


Justin Shepard commented on MPMD-186:

There are some PMD violations that don't have class name set in the Violation object and so
the exclusion logic handles those violations by getting the file name and extracting the class
name from it (replacing all the backslashes with periods as it does so) in order to convert
the file name into a class name. When the build is running on a non-Windows OS, the file name
in the Violation doesn't have backslashes in it, so they don't get replaced and then the Violation
isn't excluded correctly.

I just verified this still occurs with 3.5.

> Class Name with slash is omitted from exclusions on pmd:check
> -------------------------------------------------------------
>                 Key: MPMD-186
>                 URL:
>             Project: Maven PMD Plugin
>          Issue Type: Bug
>          Components: PMD
>    Affects Versions: 3.1
>         Environment: Ubuntu 13.04  Jdk 1.7  Maven 3.1.1
>            Reporter: Diego Almeida
>            Assignee: Michael Osipov
>            Priority: Critical
>         Attachments: maven-pmd-plugin.patch
> The method getFileName on class Violation returns the class name with slash or back slash.
On the method extractClassName in the Class PmdViolationCheckMojo the backslashes are replaced
with dots in order to compose the package name, but some
>  classes do not meet this condition and stay with the original class name and are not
found on the map excludeFromFailureClasses that contains the classes and the rules with exceptions.
> This generates an error even if the class and the rule are included on the exception

This message was sent by Atlassian JIRA

View raw message