Skip to content

Commit

Permalink
ignore meta-inf
Browse files Browse the repository at this point in the history
  • Loading branch information
wagyourtail committed May 13, 2024
1 parent de8f07e commit b384d77
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,16 @@ public void scan(Path root, Filter filter) throws IOException {
public Map<Path, Type> preScan(final Path root) throws IOException {
final Map<Path, Type> newScanTargets = new HashMap<>();
Files.walkFileTree(root, new SimpleFileVisitor<Path>() {

@Override
public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException {
if (root.relativize(dir).toString().startsWith("META-INF/versions")) {
return FileVisitResult.SKIP_SUBTREE;
} else {
return FileVisitResult.CONTINUE;
}
}

@Override
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
if (file.getFileName().toString().equals("module-info.class")) {
Expand Down

0 comments on commit b384d77

Please sign in to comment.