On Sun, Feb 27, 2022 at 4:05 PM Nils Breunese <n...@breun.nl> wrote: > After reading the various responses to this thread with people recognizing > this issue on various operating systems, I’ve opened an issue in the Maven > issue tracker: https://issues.apache.org/jira/browse/MNG-7425 > > Nils. > > > Op 18 feb. 2022, om 13:43 heeft Nils Breunese <n...@breun.nl> het > volgende geschreven: > > > > Hi, > > > > I’ve been encountering Maven warnings like these for years from time to > time: > > > > ---- > > 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 > > ---- > > > > 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 recently I’ve been > getting questions from a lot of colleagues with this issue. I was > wondering: would it make sense for Maven to assume that an empty JAR file > was not downloaded correctly and try re-downloading it automatically? > > > > Nils. >
Not disagreeing, just pointing out a detail about this. I imagine these cases are likely zip files that had a "prefix" section, but with no actual zip file entries, where the "prefix" in this case is just messages about failed http connections, or something like that. I only recently discovered that some zip files can have "prefixes", and sometimes intentionally. From the point of view of the Java api, it may appear to be a valid zip file.