diff --git a/src/main/java/io/xspec/maven/xspecMavenPlugin/utils/FileFinder.java b/src/main/java/io/xspec/maven/xspecMavenPlugin/utils/FileFinder.java index b62b163..1af7864 100644 --- a/src/main/java/io/xspec/maven/xspecMavenPlugin/utils/FileFinder.java +++ b/src/main/java/io/xspec/maven/xspecMavenPlugin/utils/FileFinder.java @@ -87,7 +87,7 @@ public List search() throws IOException { for(String exclude: excludes) { PathMatcher pmex = rootPath.getFileSystem().getPathMatcher(getSyntaxAndPattern(exclude)); for(int i=found.size()-1; i>=0; i--) { - Path p = found.get(i); + Path p = rootPath.relativize(found.get(i)); if(pmex.matches(p)) { found.remove(i); } @@ -98,7 +98,7 @@ public List search() throws IOException { private String getSyntaxAndPattern(String pattern) { String syntaxAndPattern = pattern.contains(":") ? pattern : "glob:"+pattern; - // fucking windows ! + // frakin' windows ! // TODO: FIXME if("\\".equals(File.pathSeparator)) { syntaxAndPattern = syntaxAndPattern.replaceAll("/", "\\"); diff --git a/src/test/java/io/xspec/maven/xspecMavenPlugin/utils/FileFinderTest.java b/src/test/java/io/xspec/maven/xspecMavenPlugin/utils/FileFinderTest.java index 1fb16bc..cc850fa 100644 --- a/src/test/java/io/xspec/maven/xspecMavenPlugin/utils/FileFinderTest.java +++ b/src/test/java/io/xspec/maven/xspecMavenPlugin/utils/FileFinderTest.java @@ -100,7 +100,7 @@ public void testFilenameWithoutWildCharBasedExclusions() throws Exception { @Test public void testFilenameWithWildCharBasedExclusions() throws Exception { File rootDir = new File(getProjectDirectory(), "src/test/resources/filesToTest"); - List excludes = Arrays.asList("**/imported.xspec", "**/schematron2.xspec"); + List excludes = Arrays.asList("**imported.xspec", "**schematron2.xspec"); FileFinder finder = new FileFinder(rootDir, "**/*.xspec", excludes, log); List ret = finder.search(); assertEquals(1, ret.size()); diff --git a/src/test/resources/filesToTest/imported.xspec b/src/test/resources/filesToTest/imported.xspec new file mode 100644 index 0000000..e69de29