From b3dcf38c52211c189b9b2c21936f4f35279f138a Mon Sep 17 00:00:00 2001 From: BJ Hargrave Date: Fri, 19 Aug 2022 08:22:31 -0400 Subject: [PATCH] maven: Use actual file name for jar file type test Since we care about the file and not just the artifact object, we check the file name for ending in ".jar" (jar extension) instead of relying on the artifact reporting the "jar" type. Fixes https://github.com/bndtools/bnd/issues/5349 Signed-off-by: BJ Hargrave --- .../java/aQute/bnd/maven/plugin/AbstractBndMavenPlugin.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/maven/bnd-maven-plugin/src/main/java/aQute/bnd/maven/plugin/AbstractBndMavenPlugin.java b/maven/bnd-maven-plugin/src/main/java/aQute/bnd/maven/plugin/AbstractBndMavenPlugin.java index dc64de77ef..7b8bac54bd 100644 --- a/maven/bnd-maven-plugin/src/main/java/aQute/bnd/maven/plugin/AbstractBndMavenPlugin.java +++ b/maven/bnd-maven-plugin/src/main/java/aQute/bnd/maven/plugin/AbstractBndMavenPlugin.java @@ -302,8 +302,7 @@ public void execute() throws MojoExecutionException, MojoFailureException { builder.updateModified(cpeJar.lastModified(), cpe.getPath()); buildpath.add(cpeJar); } else { - if (!artifact.getType() - .equals("jar")) { + if (!cpe.getName().endsWith(".jar")) { /* * Check if it is a valid zip file. We don't create a * Jar object here because we want to avoid the cost of