You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Nils Breunese <ni...@breun.nl> on 2022/02/18 12:43:23 UTC

zip file is empty

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.

Re: zip file is empty

Posted by Nils Breunese <ni...@breun.nl>.
Good news: Michael Osipov reports in the comments that this issue should go away with the fixes for concurrency issues that are coming up in Maven 3.9.0.

Nils.

> Op 28 feb. 2022, om 01:04 heeft Nils Breunese <ni...@breun.nl> het volgende geschreven:
> 
> 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 <ni...@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.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: zip file is empty

Posted by David Karr <da...@gmail.com>.
On Sun, Feb 27, 2022 at 4:05 PM Nils Breunese <ni...@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 <ni...@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.

Re: zip file is empty

Posted by Nils Breunese <ni...@breun.nl>.
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 <ni...@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.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: zip file is empty

Posted by Mantas Gridinas <mg...@gmail.com>.
I can confirm. I've encountered this on windows machines where downloads
from overloaded nexuses would time out.

On Sat, Feb 19, 2022, 09:04 Nils Breunese <ni...@breun.nl> wrote:

> Tushar Kapila <tg...@gmail.com> wrote:
>
> > Just out of curiosity which os are you using?
>
> I run macOS myself, but I’ve also seen it happen on Linux. On
> StackOverflow I also find posts from people who encountered this issue on
> Windows, so it doesn’t seem to be an OS-specific issue.
>
> > And are you doing parallel
> > builds (more than one mvn command running at the same time?)
>
> Maybe sometimes, but not generally and I’ve also seen this happening on
> GitLab CI builds, which run a single Maven build in a Docker container.
>
> Nils.
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: zip file is empty

Posted by Nils Breunese <ni...@breun.nl>.
Tushar Kapila <tg...@gmail.com> wrote:

> Just out of curiosity which os are you using?

I run macOS myself, but I’ve also seen it happen on Linux. On StackOverflow I also find posts from people who encountered this issue on Windows, so it doesn’t seem to be an OS-specific issue.

> And are you doing parallel
> builds (more than one mvn command running at the same time?)

Maybe sometimes, but not generally and I’ve also seen this happening on GitLab CI builds, which run a single Maven build in a Docker container.

Nils.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: zip file is empty

Posted by Tushar Kapila <tg...@gmail.com>.
Until the bug is fixed you could run a cleaner program. That checks for
jars or zips that are 0kb size, and deletes them.

I saw this in 2015. Using windows. Have not seen it on Ubuntu.

Just out of curiosity which os are you using? And are you doing parallel
builds (more than one mvn command running at the same time?)

My team mate had the issue with just one running.


On Sat, Feb 19, 2022, 04:18 Nils Breunese <ni...@breun.nl> wrote:

> Bernd Eckenfels <ec...@zusammenkunft.net> wrote:
>
> > First thing would be to determine if those are failed downloads or
> creates (installed from local built). In both cases however failures should
> not result in that. For downloads you have checksum checks and for build
> artifacts they are copied from target/ (depending on the plugins used to
> install them of course).
> >
> > Is that a groupid and Version you built on that machine or are those
> external artifacts?
>
> The empty files are for artifacts available on our Artifactory server. The
> files are non-empty on the server and get downloaded ok after removing the
> local empty ones and running Maven again.
>
> > Are there any remote.properties in the artifact directory in your Repo
> cache dir?
>
> I personally don’t have any in my ~/.m2/repository folder. What would
> having such a file mean?
>
> > One possible cause could be process or OS crashes since maven does
> probably not fdsync new files (before rename). But you probably would know
> if that happens more often.
>
> Yeah, there were no OS crashes.
>
> Nils.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: zip file is empty

Posted by Nils Breunese <ni...@breun.nl>.
Bernd Eckenfels <ec...@zusammenkunft.net> wrote:

> First thing would be to determine if those are failed downloads or creates (installed from local built). In both cases however failures should not result in that. For downloads you have checksum checks and for build artifacts they are copied from target/ (depending on the plugins used to install them of course).
> 
> Is that a groupid and Version you built on that machine or are those external artifacts?

The empty files are for artifacts available on our Artifactory server. The files are non-empty on the server and get downloaded ok after removing the local empty ones and running Maven again.

> Are there any remote.properties in the artifact directory in your Repo cache dir?

I personally don’t have any in my ~/.m2/repository folder. What would having such a file mean?

> One possible cause could be process or OS crashes since maven does probably not fdsync new files (before rename). But you probably would know if that happens more often.

Yeah, there were no OS crashes.

Nils.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: zip file is empty

Posted by Bernd Eckenfels <ec...@zusammenkunft.net>.
First thing would be to determine if those are failed downloads or creates (installed from local built). In both cases however failures should not result in that. For downloads you have checksum checks and for build artifacts they are copied from target/ (depending on the plugins used to install them of course).

Is that a groupid and Version you built on that machine or are those external artifacts? Are there any remote.properties in the artifact directory in your Repo cache dir?

One possible cause could be process or OS crashes since maven does probably not fdsync new files (before rename). But you probably would know if that happens more often.


--
http://bernd.eckenfels.net
________________________________
Von: Thomas Matthijs <li...@selckin.be>
Gesendet: Friday, February 18, 2022 4:14:52 PM
An: Maven Users List <us...@maven.apache.org>
Betreff: Re: zip file is empty

If maven is creating these and then failing to write to them, then maybe instead
it can write to a tmp file first and then move/rename it into place to
solve the
problem more nicely

Regards

On Fri, 18 Feb 2022 at 16:07, Andy Feldman <an...@wealthfront.com> wrote:
>
> This is also common at my workplace, with the resolution always being to
> delete the empty file and try again. We haven't nailed down a
> reproducible way to cause it, but it does seem to happen more often when
> network conditions are flaky. I agree that deleting the file would be a
> user-friendly thing for Maven to do automatically, assuming only one Maven
> process is operating on the repository at once (which I think Maven already
> assumes).
>
> On Fri, Feb 18, 2022 at 7:03 AM Mantas Gridinas <mg...@gmail.com> wrote:
>
> > Even empty jars that were produced by maven would contain
> > META-INF/maven.{groupid}.{artifactid}/pom.* files, wouldn't they? Looking
> > at ZipFile.java such error is thrown when the file is truly empty, and
> > doesnt contain the zip metadata (ZipFile.java:1409 as per adopt openjdk
> > sources).
> >
> > On Fri, Feb 18, 2022, 14:57 Jacques Etienne Beaudet <je...@gmail.com>
> > wrote:
> >
> > > Maven repository is not safe when running multiple concurrent builds (not
> > > the -T1C option). You need to use an external synchronization technique
> > if
> > > you need this.
> > >
> > https://maven.apache.org/resolver/maven-resolver-named-locks-redisson/index.html
> > >
> > > Not sure of the implications of assuming an empty zip file means a failed
> > > download, it seems reasonable to me but I'll let others chip in.
> > > On Feb 18, 2022, 7:43 AM -0500, Nils Breunese <ni...@breun.nl>, wrote:
> > > > 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.
> > >
> >

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: zip file is empty

Posted by Thomas Matthijs <li...@selckin.be>.
If maven is creating these and then failing to write to them, then maybe instead
it can write to a tmp file first and then move/rename it into place to
solve the
problem more nicely

Regards

On Fri, 18 Feb 2022 at 16:07, Andy Feldman <an...@wealthfront.com> wrote:
>
> This is also common at my workplace, with the resolution always being to
> delete the empty file and try again. We haven't nailed down a
> reproducible way to cause it, but it does seem to happen more often when
> network conditions are flaky. I agree that deleting the file would be a
> user-friendly thing for Maven to do automatically, assuming only one Maven
> process is operating on the repository at once (which I think Maven already
> assumes).
>
> On Fri, Feb 18, 2022 at 7:03 AM Mantas Gridinas <mg...@gmail.com> wrote:
>
> > Even empty jars that were produced by maven would contain
> > META-INF/maven.{groupid}.{artifactid}/pom.* files, wouldn't they? Looking
> > at ZipFile.java such error is thrown when the file is truly empty, and
> > doesnt contain the zip metadata (ZipFile.java:1409 as per adopt openjdk
> > sources).
> >
> > On Fri, Feb 18, 2022, 14:57 Jacques Etienne Beaudet <je...@gmail.com>
> > wrote:
> >
> > > Maven repository is not safe when running multiple concurrent builds (not
> > > the -T1C option). You need to use an external synchronization technique
> > if
> > > you need this.
> > >
> > https://maven.apache.org/resolver/maven-resolver-named-locks-redisson/index.html
> > >
> > > Not sure of the implications of assuming an empty zip file means a failed
> > > download, it seems reasonable to me but I'll let others chip in.
> > > On Feb 18, 2022, 7:43 AM -0500, Nils Breunese <ni...@breun.nl>, wrote:
> > > > 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.
> > >
> >

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: zip file is empty

Posted by Andy Feldman <an...@wealthfront.com>.
This is also common at my workplace, with the resolution always being to
delete the empty file and try again. We haven't nailed down a
reproducible way to cause it, but it does seem to happen more often when
network conditions are flaky. I agree that deleting the file would be a
user-friendly thing for Maven to do automatically, assuming only one Maven
process is operating on the repository at once (which I think Maven already
assumes).

On Fri, Feb 18, 2022 at 7:03 AM Mantas Gridinas <mg...@gmail.com> wrote:

> Even empty jars that were produced by maven would contain
> META-INF/maven.{groupid}.{artifactid}/pom.* files, wouldn't they? Looking
> at ZipFile.java such error is thrown when the file is truly empty, and
> doesnt contain the zip metadata (ZipFile.java:1409 as per adopt openjdk
> sources).
>
> On Fri, Feb 18, 2022, 14:57 Jacques Etienne Beaudet <je...@gmail.com>
> wrote:
>
> > Maven repository is not safe when running multiple concurrent builds (not
> > the -T1C option). You need to use an external synchronization technique
> if
> > you need this.
> >
> https://maven.apache.org/resolver/maven-resolver-named-locks-redisson/index.html
> >
> > Not sure of the implications of assuming an empty zip file means a failed
> > download, it seems reasonable to me but I'll let others chip in.
> > On Feb 18, 2022, 7:43 AM -0500, Nils Breunese <ni...@breun.nl>, wrote:
> > > 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.
> >
>

Re: zip file is empty

Posted by Mantas Gridinas <mg...@gmail.com>.
Even empty jars that were produced by maven would contain
META-INF/maven.{groupid}.{artifactid}/pom.* files, wouldn't they? Looking
at ZipFile.java such error is thrown when the file is truly empty, and
doesnt contain the zip metadata (ZipFile.java:1409 as per adopt openjdk
sources).

On Fri, Feb 18, 2022, 14:57 Jacques Etienne Beaudet <je...@gmail.com>
wrote:

> Maven repository is not safe when running multiple concurrent builds (not
> the -T1C option). You need to use an external synchronization technique if
> you need this.
> https://maven.apache.org/resolver/maven-resolver-named-locks-redisson/index.html
>
> Not sure of the implications of assuming an empty zip file means a failed
> download, it seems reasonable to me but I'll let others chip in.
> On Feb 18, 2022, 7:43 AM -0500, Nils Breunese <ni...@breun.nl>, wrote:
> > 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.
>

Re: zip file is empty

Posted by Nils Breunese <ni...@breun.nl>.
Tamás Cservenák <ta...@cservenak.net> wrote:

> Would be good to know
> - OS (from path I guess macOS)

Got recent reports from both macOS and Linux hosts.

> - Java

Mostly Azul Zulu OpenJDK, but probably also other OpenJDK-based distributions.

> - maven version (w/ any modding, if applicable)

Mostly 3.8.4, maybe also some older 3.x versions.

> - any extension present?

No.

The cause of these failed downloads could be a network issue in our company maybe, but since those can happen anywhere and any time, I’m interested if Maven could be made more resilient to network issues.

Nils.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: zip file is empty

Posted by Tamás Cservenák <ta...@cservenak.net>.
Would be good to know
- OS (from path I guess macOS)
- Java
- maven version (w/ any modding, if applicable)
- any extension present?

Thanks
T

On Fri, Feb 18, 2022, 18:07 Nils Breunese <ni...@breun.nl> wrote:

> Ah, ok. But colleagues also report this happening in GitLab CI builds,
> which really only have one build running per Docker container.
>
> Nils.
>
> > Op 18 feb. 2022, om 18:05 heeft jebeaudet@gmail.com het volgende
> geschreven:
> >
> > I'm not talking about the -T option, I'm talking about running 2 builds
> in
> > parallel, something like
> > cd /some/repo1
> > mvn clean verify &
> > cd /some/repo2
> > mvn clean verify &
> >
> > It could also be your IDE auto building too, I've seen that happen.
> >
> >
> > On Fri, Feb 18, 2022 at 11:13 AM Nils Breunese <ni...@breun.nl> wrote:
> >
> >> Jacques Etienne Beaudet <je...@gmail.com> wrote:
> >>
> >>> Maven repository is not safe when running multiple concurrent builds
> >> (not the -T1C option). You need to use an external synchronization
> >> technique if you need this.
> >>
> https://maven.apache.org/resolver/maven-resolver-named-locks-redisson/index.html
> >>
> >> I’ve asked my colleagues, but they weren’t doing parallel builds (-T or
> >> --threads).
> >>
> >> Nils.
> >>
> >>> Not sure of the implications of assuming an empty zip file means a
> >> failed download, it seems reasonable to me but I'll let others chip in.
> >>> On Feb 18, 2022, 7:43 AM -0500, Nils Breunese <ni...@breun.nl>, wrote:
> >>>> 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.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: users-help@maven.apache.org
> >>
> >>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: zip file is empty

Posted by Nils Breunese <ni...@breun.nl>.
Ah, ok. But colleagues also report this happening in GitLab CI builds, which really only have one build running per Docker container.

Nils.

> Op 18 feb. 2022, om 18:05 heeft jebeaudet@gmail.com het volgende geschreven:
> 
> I'm not talking about the -T option, I'm talking about running 2 builds in
> parallel, something like
> cd /some/repo1
> mvn clean verify &
> cd /some/repo2
> mvn clean verify &
> 
> It could also be your IDE auto building too, I've seen that happen.
> 
> 
> On Fri, Feb 18, 2022 at 11:13 AM Nils Breunese <ni...@breun.nl> wrote:
> 
>> Jacques Etienne Beaudet <je...@gmail.com> wrote:
>> 
>>> Maven repository is not safe when running multiple concurrent builds
>> (not the -T1C option). You need to use an external synchronization
>> technique if you need this.
>> https://maven.apache.org/resolver/maven-resolver-named-locks-redisson/index.html
>> 
>> I’ve asked my colleagues, but they weren’t doing parallel builds (-T or
>> --threads).
>> 
>> Nils.
>> 
>>> Not sure of the implications of assuming an empty zip file means a
>> failed download, it seems reasonable to me but I'll let others chip in.
>>> On Feb 18, 2022, 7:43 AM -0500, Nils Breunese <ni...@breun.nl>, wrote:
>>>> 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.
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>> 
>> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: zip file is empty

Posted by je...@gmail.com.
I'm not talking about the -T option, I'm talking about running 2 builds in
parallel, something like
cd /some/repo1
mvn clean verify &
cd /some/repo2
mvn clean verify &

It could also be your IDE auto building too, I've seen that happen.


On Fri, Feb 18, 2022 at 11:13 AM Nils Breunese <ni...@breun.nl> wrote:

> Jacques Etienne Beaudet <je...@gmail.com> wrote:
>
> > Maven repository is not safe when running multiple concurrent builds
> (not the -T1C option). You need to use an external synchronization
> technique if you need this.
> https://maven.apache.org/resolver/maven-resolver-named-locks-redisson/index.html
>
> I’ve asked my colleagues, but they weren’t doing parallel builds (-T or
> --threads).
>
> Nils.
>
> > Not sure of the implications of assuming an empty zip file means a
> failed download, it seems reasonable to me but I'll let others chip in.
> > On Feb 18, 2022, 7:43 AM -0500, Nils Breunese <ni...@breun.nl>, wrote:
> >> 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.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: zip file is empty

Posted by Nils Breunese <ni...@breun.nl>.
Jacques Etienne Beaudet <je...@gmail.com> wrote:

> Maven repository is not safe when running multiple concurrent builds (not the -T1C option). You need to use an external synchronization technique if you need this. https://maven.apache.org/resolver/maven-resolver-named-locks-redisson/index.html

I’ve asked my colleagues, but they weren’t doing parallel builds (-T or --threads).

Nils.

> Not sure of the implications of assuming an empty zip file means a failed download, it seems reasonable to me but I'll let others chip in.
> On Feb 18, 2022, 7:43 AM -0500, Nils Breunese <ni...@breun.nl>, wrote:
>> 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.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: zip file is empty

Posted by Jacques Etienne Beaudet <je...@gmail.com>.
Maven repository is not safe when running multiple concurrent builds (not the -T1C option). You need to use an external synchronization technique if you need this. https://maven.apache.org/resolver/maven-resolver-named-locks-redisson/index.html

Not sure of the implications of assuming an empty zip file means a failed download, it seems reasonable to me but I'll let others chip in.
On Feb 18, 2022, 7:43 AM -0500, Nils Breunese <ni...@breun.nl>, wrote:
> 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.