[ https://issues.apache.org/jira/browse/MARTIFACT-75?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17891859#comment-17891859 ]
ASF GitHub Bot commented on MARTIFACT-75: ----------------------------------------- elharo commented on PR #66: URL: https://github.com/apache/maven-artifact-plugin/pull/66#issuecomment-2429217436 MARTIFACT-75 is a very interesting and uncommon exception pattern. If I'm following the discussion correctly, there is in fact a bug in the maven-dependency-plugin code that causes it to load the wrong file. That leads to this zip exception. So yes, in this one case the stacktrace does help. However that's the zebra case. The horses cases (i.e. when you hear hoof beats think horses, not zebras) is that the file is in fact corrupt. I have seen corrupt jar files in Maven repos, central included, many, many times over the years, though more frequently when I was in the business of deep scanning large dependency trees in groups of many projects. Back when I was doing that, it was pretty routine that somewhere in a scan of thousands of artifacts, you'd hit one or two corrupt jars. Stack traces should be reserved for program bugs, usually indicated by runtime exceptions. In this very specific case, it turns out the ZipException actually is a program bug so a stack trace is helpful, but the vast majority of the time a ZipException or IOException indicates a problem in external data and not in the program itself. IN that far more common case, the stack trace is unactionable noise. > stacktrace when running compare: trying to open .pom file as zip > ---------------------------------------------------------------- > > Key: MARTIFACT-75 > URL: https://issues.apache.org/jira/browse/MARTIFACT-75 > Project: Maven Artifact Plugin > Issue Type: Bug > Components: artifact:compare > Affects Versions: 3.5.2 > Reporter: Herve Boutemy > Assignee: Herve Boutemy > Priority: Major > Labels: pull-request-available > Fix For: 3.5.3 > > > # when rebuilding > https://github.com/jvm-repo-rebuild/reproducible-central/pull/437 > just a warning, does not fail anything, but noisy > {noformat} > [INFO] --- artifact:3.5.2:compare (default-cli) @ nisse --- > [INFO] Reference buildinfo file not found: it will be generated from > downloaded reference artifacts > [WARNING] unable to open jar file > /var/maven/app/target/reference/eu.maveniverse.maven.nisse/nisse-0.3.3.pom > java.util.zip.ZipException: zip END header not found > at java.util.zip.ZipFile$Source.findEND (ZipFile.java:1649) > at java.util.zip.ZipFile$Source.initCEN (ZipFile.java:1657) > at java.util.zip.ZipFile$Source.<init> (ZipFile.java:1495) > at java.util.zip.ZipFile$Source.get (ZipFile.java:1458) > at java.util.zip.ZipFile$CleanableResource.<init> (ZipFile.java:724) > at java.util.zip.ZipFile.<init> (ZipFile.java:251) > at java.util.zip.ZipFile.<init> (ZipFile.java:180) > at java.util.jar.JarFile.<init> (JarFile.java:345) > at java.util.jar.JarFile.<init> (JarFile.java:316) > at java.util.jar.JarFile.<init> (JarFile.java:282) > at > org.apache.maven.plugins.artifact.buildinfo.ReferenceBuildinfoUtil.extractEnv > (ReferenceBuildinfoUtil.java:207) > at > org.apache.maven.plugins.artifact.buildinfo.ReferenceBuildinfoUtil.downloadOrCreateReferenceBuildinfo > (ReferenceBuildinfoUtil.java:131) > at > org.apache.maven.plugins.artifact.buildinfo.CompareMojo.downloadOrCreateReferenceBuildinfo > (CompareMojo.java:144) > at > org.apache.maven.plugins.artifact.buildinfo.CompareMojo.checkAgainstReference > (CompareMojo.java:131) > at org.apache.maven.plugins.artifact.buildinfo.CompareMojo.skip > (CompareMojo.java:115) > at > org.apache.maven.plugins.artifact.buildinfo.AbstractBuildinfoMojo.execute > (AbstractBuildinfoMojo.java:160) > at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo > (DefaultBuildPluginManager.java:126) > {noformat} -- This message was sent by Atlassian Jira (v8.20.10#820010)