Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.1.1
-
None
Description
In Maven Wrapper v3.1.1, Installer::createDist(), file maven-wrapper/src/main/java/org/apache/maven/wrapper/Installer.java, was updated on line 74 to be:
distributionUrl = new URI( mvnwRepoUrl ).resolve( "/" ).resolve( mvnPath );
The above update is causing the distributionUrl to be improperly formed based on the MVNW_REPOURL environment variable and the mvnPath which is extracted from the distributionUrl in maven-wrapper.properties, specifically the substring starting with "org/apache/maven".
The update was introduced in the following commit:
An example of the results are shown below. Note the "Downloading" URI does not include the entire repo url, only the scheme, host, and port, then the maven path is appended.
The repo url is getting truncated by the call to resolve( "/" ) on line 74. I do not currently see a purpose for having this call in place. I made the following update to line 74 and it works fine:
distributionUrl = new URI( mvnwRepoUrl ).resolve( mvnPath );
Note that in Maven Wrapper v3.1.0, the distributionUrl was formed simply by appending the maven path to the MVNW_REPOURL:
distributionUrl = new URI( mvnwRepoUrl + "/" + mvnPath );
Example output demonstrating issue:
[exec] [INFO] Apache Maven Wrapper 3.1.1
[exec] [INFO] Detected MVNW_REPOURL environment variable http://localhost:8081/repository/repo-maven-apache-org-maven2/
[exec] [INFO] Installing Maven distribution /home/myexamplehome/maven/wrapper/dists/apache-maven-3.6.3-bin/cf3cf814
[exec] [INFO] Downloading http://localhost:8081/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
Attachments
Issue Links
- is duplicated by
-
MWRAPPER-102 Self upgrading with a custom repository url fails
- Open
-
MWRAPPER-69 MVNW_REPOURL path not considered
- Closed
- links to