diff --git a/buildSrc/src/main/java/org/opensearch/gradle/precommit/ThirdPartyAuditTask.java b/buildSrc/src/main/java/org/opensearch/gradle/precommit/ThirdPartyAuditTask.java index 78304a4c7704d..4af46a7f9839f 100644 --- a/buildSrc/src/main/java/org/opensearch/gradle/precommit/ThirdPartyAuditTask.java +++ b/buildSrc/src/main/java/org/opensearch/gradle/precommit/ThirdPartyAuditTask.java @@ -313,7 +313,7 @@ private Set extractJars(Set jars) { getProject().delete(jarExpandDir); jars.forEach(jar -> { - String jarPrefix = jar.getName().replaceAll("-\\d+\\.\\d+\\.\\d+\\.jar$", ""); + String jarPrefix = jar.getName().split("[-.]")[0]; File jarSubDir = new File(jarExpandDir, jarPrefix); extractedJars.add(jarSubDir); FileTree jarFiles = getProject().zipTree(jar);