Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions src/main/java/org/codehaus/plexus/util/AbstractScanner.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public abstract class AbstractScanner implements Scanner {
* Patterns which should be excluded by default, like SCM files
* <ul>
* <li>Misc: &#42;&#42;/&#42;~, &#42;&#42;/#&#42;#, &#42;&#42;/.#&#42;, &#42;&#42;/%&#42;%, &#42;&#42;/._&#42;</li>
* <li>CVS: &#42;&#42;/CVS, &#42;&#42;/CVS/&#42;&#42;, &#42;&#42;/.cvsignore</li>
* <li>CVS: &#42;&#42;/CVS, &#42;&#42;/CVS/&#42;&#42;</li>
* <li>RCS: &#42;&#42;/RCS, &#42;&#42;/RCS/&#42;&#42;</li>
* <li>SCCS: &#42;&#42;/SCCS, &#42;&#42;/SCCS/&#42;&#42;</li>
* <li>VSSercer: &#42;&#42;/vssver.scc</li>
Expand All @@ -41,7 +41,7 @@ public abstract class AbstractScanner implements Scanner {
* <li>Mac: &#42;&#42;/.DS_Store</li>
* <li>Serena Dimension: &#42;&#42;/.metadata, &#42;&#42;/.metadata/&#42;&#42;</li>
* <li>Mercurial: &#42;&#42;/.hg, &#42;&#42;/.hg/&#42;&#42;</li>
* <li>Git: &#42;&#42;/.git, &#42;&#42;/.git/&#42;&#42;, &#42;&#42;/.gitignore</li>
* <li>Git: &#42;&#42;/.git, &#42;&#42;/.git/&#42;&#42;</li>
* <li>Bitkeeper: &#42;&#42;/BitKeeper, &#42;&#42;/BitKeeper/&#42;&#42;, &#42;&#42;/ChangeSet,
* &#42;&#42;/ChangeSet/&#42;&#42;</li>
* <li>Darcs: &#42;&#42;/_darcs, &#42;&#42;/_darcs/&#42;&#42;, &#42;&#42;/.darcsrepo,
Expand All @@ -61,7 +61,6 @@ public abstract class AbstractScanner implements Scanner {
// CVS
"**/CVS",
"**/CVS/**",
"**/.cvsignore",

// RCS
"**/RCS",
Expand Down Expand Up @@ -106,7 +105,6 @@ public abstract class AbstractScanner implements Scanner {
// git
"**/.git",
"**/.git/**",
"**/.gitignore",

// BitKeeper
"**/BitKeeper",
Expand Down
14 changes: 14 additions & 0 deletions src/test/java/org/codehaus/plexus/util/DirectoryScannerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,20 @@ void isParentSymbolicLink() throws Exception {
ds.isParentSymbolicLink(new File(directory, "symLinkToDirOnTheOutside"), "FileInDirOnTheOutside.txt"));
}

@Test
void defaultExcludes() throws Exception {
DirectoryScanner ds = new DirectoryScanner();
// work in src directory as target has filtering already applied with outdated default excludes
// (https://maven.apache.org/plugins/maven-resources-plugin/resources-mojo.html#addDefaultExcludes)
ds.setBasedir(new File("src/test/resources/directory-scanner-default-excludes").getCanonicalFile());

ds.addDefaultExcludes();
ds.scan();

assertInclusionsAndExclusions(
ds.getIncludedFiles(), new String[] {}, ".gitignore", ".gitattributes", ".cvsignore");
}

private void printTestHeader() {
StackTraceElement ste = new Throwable().getStackTrace()[1];
System.out.println("Test: " + ste.getMethodName());
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# must not be excluded, otherwise the project will not work
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# must not be excluded
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# must not be excluded