You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Benjamin Bentmann (JIRA)" <ji...@codehaus.org> on 2008/04/18 19:24:55 UTC

[jira] Closed: (MPMD-77) excludeRoots doesn't work with basedir-relative paths

     [ http://jira.codehaus.org/browse/MPMD-77?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benjamin Bentmann closed MPMD-77.
---------------------------------

         Assignee: Benjamin Bentmann
       Resolution: Fixed
    Fix Version/s: 2.4

Applied in [r649616|http://svn.apache.org/viewvc?view=rev&revision=649616], thanks Justin!

I chose your second patch, i.e. using {{File[]}}, because:
- it's the simplest way to avoid a [common bug with path resolution|http://www.nabble.com/Common-Bugs-p14783703s177.html] from which your first patch suffers
- in the plugin documentation, the type {{File[]}} is more descriptive than {{List}}

One final note: If you supply further patches (please!), avoid absolute paths in the patch file. Also, patching against the SVN trunk is preferrable.

> excludeRoots doesn't work with basedir-relative paths
> -----------------------------------------------------
>
>                 Key: MPMD-77
>                 URL: http://jira.codehaus.org/browse/MPMD-77
>             Project: Maven 2.x PMD Plugin
>          Issue Type: Bug
>    Affects Versions: 2.3
>            Reporter: Justin Edelson
>            Assignee: Benjamin Bentmann
>            Priority: Critical
>             Fix For: 2.4
>
>         Attachments: pmd-patch.patch, pmd_patch2.patch
>
>
> According to http://maven.apache.org/plugins/maven-pmd-plugin/pmd-mojo.html, the excludeRoots property is supposed to suppress PMD report generation for certain source roots. However, in practice this does not work with this type of configuration:
> 				<configuration>
> 					<excludeRoots>
> 						<excludeRoot>target/generated-sources/axis</excludeRoot>
> 					</excludeRoots>
> 				</configuration>
> On line 265 of AbstractPmdReport, a new File object is created for each excludeRoot element. Then, on line 346, each compileSourceRoot is checked to see if the List of excludeRoot File objects contains it. This test will never return true as the compileSourceRoot File objects are absolute and the excludeRoot File objects are relative.
> The simplest solution (seen in the attached patch) is to create absolute File objects for each excludeRoot.
> I tried created a unit test to demonstrate this problem, but couldn't quite nail it down. I'll keep trying....

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira