From 6fbb85dc12ad3bfb53e3efdcabe345c5156fa507 Mon Sep 17 00:00:00 2001 From: Knut Wannheden Date: Wed, 11 Oct 2023 10:33:51 +0200 Subject: [PATCH] Disable nested jar scanning in `dependenciesFromClasspath()` Nested jar scanning is currently not supported and is thus explicitly disabled in `JavaParser#dependenciesFromClasspath()` so that it doesn't end up causing exceptions (due to missing `FileSystems#newFileSystem()` call). --- rewrite-java/src/main/java/org/openrewrite/java/JavaParser.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rewrite-java/src/main/java/org/openrewrite/java/JavaParser.java b/rewrite-java/src/main/java/org/openrewrite/java/JavaParser.java index 54a5d89354a..a868729ebb3 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/JavaParser.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/JavaParser.java @@ -79,7 +79,7 @@ static List runtimeClasspath() { * matching jars can be found. */ static List dependenciesFromClasspath(String... artifactNames) { - List runtimeClasspath = new ClassGraph().getClasspathURIs(); + List runtimeClasspath = new ClassGraph().disableNestedJarScanning().getClasspathURIs(); List artifacts = new ArrayList<>(artifactNames.length); List missingArtifactNames = new ArrayList<>(artifactNames.length); for (String artifactName : artifactNames) {