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

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

ascopes commented on code in PR #44:
URL: https://github.com/apache/maven-wrapper/pull/44#discussion_r1083434014


##########
maven-wrapper-distribution/src/resources/mvnw:
##########
@@ -194,7 +194,9 @@ else
       
wrapperUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/@@project.version@@/maven-wrapper-@@project.version@@.jar";
     fi
     while IFS="=" read -r key value; do

Review Comment:
   as a side note, don't think it is necesarilly related to this issue, but 
https://docs.oracle.com/cd/E23095_01/Platform.93/ATGProgGuide/html/s0204propertiesfileformat01.html
 suggests that `:` is a valid character here too.
   
   Along with spaces around these operators, it may be worth passing `key` and 
`value` through `sed 's/[ \t]//g'` to deal with this case at the same time (or 
use TR).
   
   e.g.
   
   ```
      while IFS=':=' read -r key value; do
          key="$(echo "${key}" | tr $' \t' '')"
          value="$(echo "${value}" | tr $' \t\r')"
          ...
      done
   ```
   
   There is one other case that is potentially missed which is line 
continuations in the file but that is kinda out of scope for this.





> mvnw script does not download jar if used in git bash in windows
> ----------------------------------------------------------------
>
>                 Key: MWRAPPER-67
>                 URL: https://issues.apache.org/jira/browse/MWRAPPER-67
>             Project: Maven Wrapper
>          Issue Type: Bug
>          Components: Maven Wrapper Scripts
>    Affects Versions: 3.1.1
>            Reporter: Jeremy Landis
>            Priority: Minor
>
> Usage of git bash will not download the maven wrapper jar along with curl 
> (probably others) due to having windows line endings in the URL (trailing).  
> To ensure that is not the case, make sure to strip invalid line endings out 
> before usage.
> Use case, ./mvnw in powershell will use mvnw.cmd and has no issues 
> downloading.  If user does same in git bash, it will fail with invalid URL 
> error with curl.  Using ./mvnw.cmd there will work but not natural usage.  To 
> ensure this simply just works for full support, trim out invalid line feeds.
> note: This only affected the download.  It worked otherwise.



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

Reply via email to