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
            Priority: Critical
         Attachments: pmd-patch.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

        

Reply via email to