in src/main/java/org/apache/maven/plugins/pmd/AbstractPmdReport.java [381:400]
private boolean isDirectoryExcluded(Collection<File> excludeRootFiles, File sourceDirectoryToCheck) {
boolean returnVal = false;
for (File excludeDir : excludeRootFiles) {
try {
if (sourceDirectoryToCheck
.getCanonicalFile()
.toPath()
.startsWith(excludeDir.getCanonicalFile().toPath())) {
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;
}