This is an automated email from the ASF dual-hosted git repository.

elharo pushed a commit to branch MARTIFACT-75
in repository https://gitbox.apache.org/repos/asf/maven-artifact-plugin.git

commit f79bc003a6d135941a831ab5ae5400967abd06f6
Author: Elliotte Rusty Harold <elh...@ibiblio.org>
AuthorDate: Sun Oct 20 17:16:01 2024 -0400

    Don't print stack trace from correctly functioning code
---
 .../maven/plugins/artifact/buildinfo/ReferenceBuildinfoUtil.java   | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git 
a/src/main/java/org/apache/maven/plugins/artifact/buildinfo/ReferenceBuildinfoUtil.java
 
b/src/main/java/org/apache/maven/plugins/artifact/buildinfo/ReferenceBuildinfoUtil.java
index e7892a0..f4fbb23 100644
--- 
a/src/main/java/org/apache/maven/plugins/artifact/buildinfo/ReferenceBuildinfoUtil.java
+++ 
b/src/main/java/org/apache/maven/plugins/artifact/buildinfo/ReferenceBuildinfoUtil.java
@@ -37,6 +37,7 @@ import java.util.jar.Attributes;
 import java.util.jar.JarFile;
 import java.util.jar.Manifest;
 import java.util.zip.ZipEntry;
+import java.util.zip.ZipException;
 
 import org.apache.commons.io.IOUtils;
 import org.apache.maven.plugin.MojoExecutionException;
@@ -213,8 +214,10 @@ class ReferenceBuildinfoUtil {
             } else {
                 log.warn("no MANIFEST.MF found in jar " + file);
             }
-        } catch (IOException e) {
-            log.warn("unable to open jar file " + file, e);
+        } catch (ZipException e) {
+            log.warn("Corrupt jar file " + file + "\n" + e.getMessage());
+        }  catch (IOException e) {
+            log.warn("unable to read jar file " + file + "\n" + 
e.getMessage());
         }
         return null;
     }

Reply via email to