only-script for Linux clobbers MVNW_REPOURL
Maintainers usually reply within 1 day
Assessment
This issue has not been assessed yet.
Description
Affected version
3.3.3
Bug description
Running the Maven Wrapper plugin through the Maven Wrapper's only-script distribution type causes MVNW_REPOURL to be discarded, leaving the distributionUrl written to maven-wrapper.properties at its default value. Consequently, only-script for Linux is unable to update itself in any environment that needs MVNW_REPOURL.
That is, the hypothetical execution
$ MVNW_REPOURL=asdfasdf ./mvnw org.apache.maven.plugins:maven-wrapper-plugin:3.3.3:wrapper -Dtype=only-script -Dmaven=3.9.11 -X
where asdfasdf is a functional mirror should have produced an output similar to
...
[DEBUG] Using repo URL from MVNW_REPOURL environment variable.
[DEBUG] Determined repo URL to use as asdfasdf
[INFO] Configuring .mvn/wrapper/maven-wrapper.properties to use Maven 3.9.11 and download from asdfasdf
but will end up producing
...
[DEBUG] Determined repo URL to use as https://repo.maven.apache.org/maven2
[INFO] Configuring .mvn/wrapper/maven-wrapper.properties to use Maven 3.9.11 and download from https://repo.maven.apache.org/maven2
and the result is consistent with the log messages.
This happens because only-mvnw explicitly unsets MVNW_REPOURL:
so by the time WrapperMojo tries to read the variable it sees null:
As far as I can see, this bug does not exist in only-mvnw.cmd.
The issue is exacerbated by the user property distributionUrl value representing the "final" URl. That is, it is not simply a domain substitution and therefore cannot take the place of MVNW_REPOURL.
- Dominant language
- Java
- Stars
- 254
- Forks
- 78
- Avg merge
- 23h 36m
- Merged PRs (30d)
- 8
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/maven-wrapper
-
mvnw.cmd selects the last matching extracted directory while mvnw selects the firstPossibly taken @tanvir-ux claimed this 36 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
apache/maven-wrapper#442 ·
Maintainers usually reply within 1 day
-
priority:trivial
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
apache/maven-wrapper#280 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 3/5 1-2 days Newbie friendliness 68/100
apache/maven-wrapper#454 ·
Maintainers usually reply within 1 day
-
mvnw silently continues when no download mechanism is available (missing final else)May be free again A pull request for this issue was closed without being merged. Open
Difficulty 3/5 1-2 days Newbie friendliness 68/100
apache/maven-wrapper#441 · 1 comment ·
Maintainers usually reply within 1 day
-
SHA-256 validation fails when unzip is unavailable because distribution format is silently changed to .tar.gzPossibly taken @simono claimed this 76 days ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 48/100
apache/maven-wrapper#425 · 1 comment · 4 reactions ·
Maintainers usually reply within 1 day
All issues in apache/maven-wrapper
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
java-native-access/jna#1740 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
portfolio-performance/portfolio#6119 ·
Maintainers usually reply within 8 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
jenkinsci/ec2-plugin#2041 ·
-
L: github:actions L: php:composer
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
dependabot/dependabot-core#16493 ·
Maintainers usually reply within 1 day