You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2023/10/28 15:40:00 UTC

[jira] [Commented] (MWRAPPER-114) Maven wrapper relative distributionUrl does not work on Windows

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

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

melbeltagy commented on PR #107:
URL: https://github.com/apache/maven-wrapper/pull/107#issuecomment-1783851515

   I don't have access to leave this comment on https://issues.apache.org/jira/projects/MWRAPPER/issues/MWRAPPER-114.. so, I'll leave it here for now till I get access.
   
   The proposed fix does not actually fix the reported issue.
   Relative paths, such as `distributionUrl=apache-maven-3.8.8-bin.zip` does not have a `file` schema nor use a full local path (as per the tests provided).
   Or did I miss something?




> 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)