File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
native-maven-plugin/src/main/java/org/graalvm/buildtools/maven Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 6262import org .eclipse .aether .resolution .DependencyResult ;
6363import org .graalvm .buildtools .utils .NativeImageConfigurationUtils ;
6464
65+ import java .io .File ;
6566import java .io .IOException ;
6667import java .io .UncheckedIOException ;
6768import java .nio .file .Files ;
@@ -297,10 +298,19 @@ private List<Path> findJunitPlatformNativeJars(Set<Module> modulesAlreadyOnClass
297298 .stream ()
298299 .map (ArtifactResult ::getArtifact )
299300 .filter (a -> !modulesAlreadyOnClasspath .contains (new Module (a .getGroupId (), a .getArtifactId ())))
301+ .filter (a -> imageClasspath .stream ().noneMatch (entry -> matchGroup (entry , a .getGroupId ()) && matchArtifact (entry , a .getArtifactId ())))
300302 .map (a -> a .getFile ().toPath ())
301303 .collect (Collectors .toList ());
302304 }
303305
306+ private boolean matchGroup (Path entry , String groupId ) {
307+ return entry .toString ().contains (groupId .replace ("." , File .separator ));
308+ }
309+
310+ private boolean matchArtifact (Path entry , String artifactId ) {
311+ return entry .toString ().contains (artifactId );
312+ }
313+
304314 private static final class Module {
305315 private final String groupId ;
306316 private final String artifactId ;
You can’t perform that action at this time.
0 commit comments