apache / apache/maven-wrapper

[MWRAPPER-91] Concurrent execution of mvnw to download wrapper fails

Open
#231 3 comments 0 reactions 1 assignee Claimed by @bmarwell View on GitHub
bug priority:major
Dominant language
Java
Stars
254
Forks
78
Avg merge
5h 26m
Merged PRs (30d)
2

Description

**[Alexander Schwartz](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=ahus1)** opened **[MWRAPPER-91](https://issues.apache.org/jira/browse/MWRAPPER-91?redirect=false)** and commented

The script will download the executable maven wrapper JAR file directly to the final file name.
When multiple calls do this concurrently, it happens that the first call executes the JAR file that is currently overwritten by the second parallel call.

This leads to error like:
* `NoClassDefFoundError: org/codehaus/plexus/PlexusContainer`
* `ClassNotFoundException: org.apache.maven.wrapper.MavenWrapperMain`

A different solution might be to first download the JAR file to a temporary file, and then use an atomic file operator like a rename once the download is complete.

---

**Affects:** 3.1.0

**Remote Links:**
- [GitHub Pull Request #137
](https://github.com/apache/maven-wrapper/pull/137)

1 votes, 5 watchers

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.