diff --git a/common/src/main/java/org/openmetadata/common/utils/CommonUtil.java b/common/src/main/java/org/openmetadata/common/utils/CommonUtil.java index 08e0b5cc37e..e24d73d5617 100644 --- a/common/src/main/java/org/openmetadata/common/utils/CommonUtil.java +++ b/common/src/main/java/org/openmetadata/common/utils/CommonUtil.java @@ -38,6 +38,7 @@ import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; +import java.util.Set; import java.util.TimeZone; import java.util.regex.Pattern; import java.util.stream.Collectors; @@ -60,10 +61,10 @@ public final class CommonUtil { public static List getResources(Pattern pattern) throws IOException { ArrayList resources = new ArrayList<>(); String classPath = System.getProperty("java.class.path", "."); - List classPathElements = + Set classPathElements = Arrays.stream(classPath.split(File.pathSeparator)) .filter(jarName -> JAR_NAME_FILTER.stream().anyMatch(jarName.toLowerCase()::contains)) - .toList(); + .collect(Collectors.toSet()); for (String element : classPathElements) { File file = new File(element); @@ -84,6 +85,7 @@ public final class CommonUtil { } private static Collection getResourcesFromJarFile(File file, Pattern pattern) { + LOG.debug("Adding from file {}", file); ArrayList retval = new ArrayList<>(); try (ZipFile zf = new ZipFile(file)) { Enumeration e = zf.entries();