diff --git a/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/util/Selection.java b/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/util/Selection.java index 799a6f4fa..6199fb910 100755 --- a/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/util/Selection.java +++ b/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/util/Selection.java @@ -86,7 +86,7 @@ public ScanAction visitDirectory(final String name, final File directory) { if (debugEnabled) { log.debug("Skipping '" + new File(directory, name) + "' since it is excluded"); } - return ScanAction.ABORT_DIRECTORY; + return ScanAction.NO_RECURSE; } if (debugEnabled) { log.debug("Visiting '" + new File(directory, name) + "' since it is not excluded"); diff --git a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/util/SelectionTest.java b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/util/SelectionTest.java index 7cf28246e..288906ac8 100755 --- a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/util/SelectionTest.java +++ b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/util/SelectionTest.java @@ -26,6 +26,7 @@ import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; +import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.UUID; @@ -92,7 +93,20 @@ private String buildDebugMessage(DirectoryScanner scanner) { "includedDirsFiles=" + asList(scanner.getIncludedDirectories()) + ",\n" + "includedFiles=" + asList(scanner.getIncludedFiles()) + ",\n" + "notIncludedDirs=" + asList(scanner.getNotIncludedDirectories()) + ",\n" + - "notIncludedFiles=" + asList(scanner.getNotIncludedFiles()) + ",\n"; + "notIncludedFiles=" + asList(scanner.getNotIncludedFiles()) + ",\n" + + "diskFiles=" + listFiles(scanner.getBasedir(), new ArrayList()); + } + + private Collection listFiles(File basedir, Collection files) { + files.add(basedir); + for (File f : basedir.listFiles()) { + if (f.isDirectory()) { + listFiles(f, files); + } else { + files.add(f); + } + } + return files; } private void assertIncludedFilesInFakeProject(Selection selection, String debugMessage) {