You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Nils Breunese (Jira)" <ji...@apache.org> on 2022/02/28 00:04:00 UTC

[jira] [Created] (MNG-7425) Maven artifact downloads sometimes result in empty zip files in local repository

Nils Breunese created MNG-7425:
----------------------------------

             Summary: Maven artifact downloads sometimes result in empty zip files in local repository
                 Key: MNG-7425
                 URL: https://issues.apache.org/jira/browse/MNG-7425
             Project: Maven
          Issue Type: Bug
          Components: Artifacts and Repositories
    Affects Versions: 3.8.4
            Reporter: Nils Breunese


I’ve been encountering Maven warnings like these for years from time to time:

{code}
WARN: zip file is empty: /Users/username/.m2/repository/com/example/example-artifact/1.2.3/example-artifact-1.2.3.jar
java.util.zip.ZipException: zip file is empty
{code}

So while I am sure that Maven 3.8.4 is affected, this is certainly not the oldest version that is affected.

According to [the thread I started about this on the Maven users mailinglist this issue|https://lists.apache.org/thread/5kq5xkwdm2583dhfor78vf0l5mc11l9x] occurs on at least macOS, Linux and Windows.

I know that when I encounter this I can just delete the file and run Maven again and then it’ll generally download ok, but this a manual workaround for an issue that shouldn't exist in the first place.

* Could Maven be modified to ensure that 0 bytes artifacts don't end up in the local repository?
* Would it make sense for Maven to assume that an empty JAR file was not downloaded correctly and the download should be retried automatically?



--
This message was sent by Atlassian Jira
(v8.20.1#820001)