[ https://issues.apache.org/jira/browse/MBUILDCACHE-64?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17759573#comment-17759573 ]
ASF GitHub Bot commented on MBUILDCACHE-64: ------------------------------------------- kbuntrock commented on PR #91: URL: https://github.com/apache/maven-build-cache-extension/pull/91#issuecomment-1695606322 > I'm starting to wonder if the use of the JDK `PathMatcher` is sufficient here. If we want to optimize the file system access and not traverse _all_ files / subdirectories, we'll have to use [`Files.walkFileTree`](https://docs.oracle.com/javase/8/docs/api/java/nio/file/Files.html#walkFileTree-java.nio.file.Path-java.nio.file.FileVisitor-) as it has built-in support for skipping subtrees. However, I'm not sure there is any good implementation of glob syntax that would skip subtree when known to not match. Well, good news, we are already using `Files#walkFileTree`. One of the discussion is precisely how I managed to keep as well as possible the capacity to skip subtree scanning (it is a key point for the projects I want to use this extension on). @All : Seems this PR draw attention to details about this functionality but I would suggest to not go too far with it. I already agreed to change it from a bugfix to an evolution. Maybe the current state is good enough for now. And if good ideas emerge they can be implemented in another PR. I have the feeling that in term of functionality / performance / test and documentation, this PR brings already a lot to the table. And people will be easily capable after merging to change some details they would have seen differently. > Apply global exclusions to folder names > --------------------------------------- > > Key: MBUILDCACHE-64 > URL: https://issues.apache.org/jira/browse/MBUILDCACHE-64 > Project: Maven Build Cache Extension > Issue Type: Bug > Affects Versions: 1.0.1 > Reporter: Frank Wagner > Assignee: Olivier Lamy > Priority: Major > Labels: pull-request-available > Fix For: 1.1.0 > > > It is currently not possible to exclude folders by their name, like > {quote}<input> > <global> > <excludes> > <exclude>node_modules</exclude> > <exclude>dist</exclude> > <exclude>build</exclude> > </excludes> > </global> > ... > {quote} > That's because isFilteredOutSubpath(), > [https://github.com/apache/maven-build-cache-extension/blob/master/src/main/java/org/apache/maven/buildcache/checksum/MavenProjectInput.java#L638,] > uses startWith on normalized absolute paths. > That function could be enhanced with an additional criterion like in > [https://github.com/apache/maven-build-cache-extension/blob/master/src/main/java/org/apache/maven/buildcache/checksum/MavenProjectInput.java#L510] > {{filteredOutPaths.stream().anyMatch(it -> > it.getFileName().equals(entry.getFileName()))}} > > -- This message was sent by Atlassian Jira (v8.20.10#820010)