You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by el...@apache.org on 2024/10/20 21:16:10 UTC

(maven-artifact-plugin) branch MARTIFACT-75 created (now f79bc00)

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

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


      at f79bc00  Don't print stack trace from correctly functioning code

This branch includes the following new commits:

     new f79bc00  Don't print stack trace from correctly functioning code

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(maven-artifact-plugin) 01/01: Don't print stack trace from correctly functioning code

Posted by el...@apache.org.
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 <el...@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;
     }