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

ASF GitHub Bot commented on MWRAPPER-114:
-----------------------------------------

danishcake opened a new pull request, #107:
URL: https://github.com/apache/maven-wrapper/pull/107

   … on Windows
   
   There is a Path -> URI -> Path roundtrip which was being incorrectly carried 
out. For Windows file URIs like
   
   file:///C:/test
   
   calling distUrl.getPath() resulted in /C:/test, which Paths.get could not 
handle. Existing behaviour is preserved for non-file URIs
   
   Following this checklist to help us incorporate your 
   contribution quickly and easily:
   
    - [x] Make sure there is a [JIRA 
issue](https://issues.apache.org/jira/browse/MWRAPPER) filed 
          for the change (usually before you start working on it).  Trivial 
changes like typos do not 
          require a JIRA issue.  Your pull request should address just this 
issue, without 
          pulling in other changes.
    - [x] Each commit in the pull request should have a meaningful subject line 
and body.
    - [x] Format the pull request title like `[MWRAPPER-XXX] - Fixes bug in 
ApproximateQuantiles`,
          where you replace `MWRAPPER-XXX` with the appropriate JIRA issue. 
Best practice
          is to use the JIRA issue title in the pull request title and in the 
first line of the 
          commit message.
    - [x] Write a pull request description that is detailed enough to 
understand what the pull request does, how, and why.
    - [x] Run `mvn clean verify` to make sure basic checks pass. A more 
thorough check will 
          be performed on your pull request automatically.
    - [ ] You have run the integration tests successfully (`mvn -Prun-its clean 
verify`)**This fails, but so does master. I could not find any documentation on 
how to create a suitable development environment to have the tests pass**
   
   If your pull request is about ~20 lines of code you don't need to sign an
   [Individual Contributor License 
Agreement](https://www.apache.org/licenses/icla.pdf) if you are unsure
   please ask on the developers list.
   
   To make clear that you license your contribution under 
   the [Apache License Version 2.0, January 
2004](http://www.apache.org/licenses/LICENSE-2.0)
   you have to acknowledge this by using the following check-box.
   
    - [x] I hereby declare this contribution to be licenced under the [Apache 
License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)
   
    - [ ] In any other case, please file an [Apache Individual Contributor 
License Agreement](https://www.apache.org/licenses/icla.pdf).
   
   




> Maven wrapper relative distributionUrl does not work on Windows
> ---------------------------------------------------------------
>
>                 Key: MWRAPPER-114
>                 URL: https://issues.apache.org/jira/browse/MWRAPPER-114
>             Project: Maven Wrapper
>          Issue Type: Bug
>          Components: Maven Wrapper Jar
>    Affects Versions: 3.2.0
>         Environment: Windows
>            Reporter: Edward Woolhouse
>            Priority: Normal
>
> If Maven Wrapper is used with a relative distributionUrl on Windows then an 
> error message indicating invalid path characters is shown.
>  
> {code:java}
> # Directory structure 
> ./mvnw
> ./mvnw.cmd
> ./.mvn/wrapper/maven-wrapper.jar
> ./.mvn/wrapper/maven-wrapper.properties
> ...{code}
> {code:java}
> # maven-wrapper.properties
> distributionUrl=apache-maven-3.8.8-bin.zip
> wrapperUrl=maven-wrapper.jar{code}
> When run
> {code:java}
> ./mvnw
> ...
> java.nio.file.InvalidPathException: Illegal char <:> at index 2: 
> /C:/some-path/apache-maven-3.8.8.zip {code}
> This is caused by PathAssembler.java:getBaseName unnecessarilly stringifying 
> the distibution URL. The fix is as follows
> {code:java}
>     private String getBaseName(URI distUrl) {
> -       return Paths.get(distUrl.getPath()).getFileName().toString();
> +       return Paths.get(distUrl).getFileName().toString();
>     }{code}
>  



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

Reply via email to