Author: adangel
Date: Mon Feb 15 19:05:13 2016
New Revision: 1730597
URL: http://svn.apache.org/viewvc?rev=1730597&view=rev
Log:
[MPMD-178] use canonicalPaths to compare the directories
Modified:
maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/AbstractPmdReport.java
Modified:
maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/AbstractPmdReport.java
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/AbstractPmdReport.java?rev=1730597&r1=1730596&r2=1730597&view=diff
==============================================================================
---
maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/AbstractPmdReport.java
(original)
+++
maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/AbstractPmdReport.java
Mon Feb 15 19:05:13 2016
@@ -384,12 +384,21 @@ public abstract class AbstractPmdReport
boolean returnVal = false;
for ( File excludeDir : excludeRootFiles )
{
- if ( sourceDirectoryToCheck.getAbsolutePath().startsWith(
excludeDir.getAbsolutePath() ) )
+ try
{
- getLog().debug( "Directory " +
sourceDirectoryToCheck.getAbsolutePath()
- + " has been excluded as it matches
excludeRoot " + excludeDir.getAbsolutePath() );
- returnVal = true;
- break;
+ if ( sourceDirectoryToCheck.getCanonicalPath().startsWith(
excludeDir.getCanonicalPath() ) )
+ {
+ getLog().debug( "Directory " +
sourceDirectoryToCheck.getAbsolutePath()
+ + " has been excluded as it matches
excludeRoot "
+ + excludeDir.getAbsolutePath() );
+ returnVal = true;
+ break;
+ }
+ }
+ catch ( IOException e )
+ {
+ getLog().warn( "Error while checking " + sourceDirectoryToCheck
+ + " whether it should be excluded.", e );
}
}
return returnVal;