[ 
https://issues.apache.org/jira/browse/MWRAPPER-102?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17700586#comment-17700586
 ] 

Niels Basjes edited comment on MWRAPPER-102 at 3/15/23 10:54 AM:
-----------------------------------------------------------------

I think it is a different issue.

What I see is that the script IS updated by doing these steps.

What is wrong is the path to the maven download URL from the custom repo that 
is removed (see previous reproduction).

*Reproduction to show the script is updated:*
Assume a project without the maven wrapper present and the ~/.m2/wrapper/dists 
is empty.
{code:bash}
$ mvn org.apache.maven.plugins:maven-wrapper-plugin:3.1.1:wrapper 
...
[INFO] --- wrapper:3.1.1:wrapper (default-cli) @ test ---
...
$ fgrep version mvnw
# Apache Maven Wrapper startup batch script, version 3.1.1
{code}
and then with the 3.2.0 version:
{code:bash}
$ ./mvnw wrapper:wrapper 
...
[INFO] --- wrapper:3.2.0:wrapper (default-cli) @ test ---
...
$ fgrep version mvnw
# Apache Maven Wrapper startup batch script, version 3.2.0
...
{code}


was (Author: nielsbasjes):
I think it is a different issue.

What I see is that the script IS updated by doing these steps.

What is wrong is the path to the maven download URL from the custom repo that 
is removed (see previous reproduction).

*Reproduction to show the script is updated:*
Assume a project without the maven wrapper present and the ~/.m2/wrapper/dists 
is empty.
{code:bash}
$ mvn org.apache.maven.plugins:maven-wrapper-plugin:3.1.1:wrapper 
...
[INFO] --- wrapper:3.1.1:wrapper (default-cli) @ test ---
...
$ fgrep version mvnw
# Apache Maven Wrapper startup batch script, version 3.1.1
{code}
and then with the 3.2.0 version:
{code:bash}
$ mvn wrapper:wrapper 
...
[INFO] --- wrapper:3.2.0:wrapper (default-cli) @ test ---
...
$ fgrep version mvnw
# Apache Maven Wrapper startup batch script, version 3.2.0
...
{code}

> Self upgrading with a custom repository url fails
> -------------------------------------------------
>
>                 Key: MWRAPPER-102
>                 URL: https://issues.apache.org/jira/browse/MWRAPPER-102
>             Project: Maven Wrapper
>          Issue Type: Bug
>          Components: Maven Wrapper Scripts
>    Affects Versions: 3.1.1, 3.2.0
>            Reporter: Niels Basjes
>            Priority: Major
>
> Assume a project without the maven wrapper present and the 
> ~/.m2/wrapper/dists is empty.
> In the project install the 3.1.1 wrapper version with a different REPO url
> {code:bash}
> $ MVNW_REPOURL=https://repo1.maven.org/maven2 mvn 
> org.apache.maven.plugins:maven-wrapper-plugin:3.1.1:wrapper 
> {code}
> The config now contains
> {code:bash}
> $ fgrep Url .mvn/wrapper/maven-wrapper.properties 
> distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.9.0/apache-maven-3.9.0-bin.zip
> wrapperUrl=https://repo1.maven.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.1/maven-wrapper-3.1.1.jar
>  {code}
> Now try to self upgrade
> {code:bash}
> $ MVNW_REPOURL=https://repo1.maven.org/maven2 ./mvnw wrapper:wrapper   
> Exception in thread "main" java.io.FileNotFoundException: 
> https://repo1.maven.org/org/apache/maven/apache-maven/3.9.0/apache-maven-3.9.0-bin.zip
>      at 
> {code}
> Important to note here
> 1. The URL it is trying to download from is the specified hostname but 
> without the specified path on that host.
> 2. The {{distributionUrl}} specified in  
> {{.mvn/wrapper/maven-wrapper.properties}} is the valid URL that yields the 
> correct file.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to