Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

only-script for Linux clobbers MVNW_REPOURL

Open
#368 1 comment 2 reactions 1 assignee View on GitHub

Maintainers usually reply within 1 day

@bmarwell is already working on this.

Since Jun 8, 2026.

  • #415 by @armorbreak001 — open

Assessment

This issue has not been assessed yet.

Description

bug
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:

https://github.com/apache/maven-wrapper/blob/maven-wrapper-3.3.3/maven-wrapper-distribution/src/resources/only-mvnw#L149

so by the time WrapperMojo tries to read the variable it sees null:

https://github.com/apache/maven-wrapper/blob/maven-wrapper-3.3.3/maven-wrapper-distribution/src/resources/only-mvnw#L149

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/maven-wrapper

All issues in apache/maven-wrapper

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.