[GitHub] [maven] rosti-il opened a new pull request #307: Simplify detection of the MAVEN_HOME and make it fully qualified

classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

[GitHub] [maven] rosti-il opened a new pull request #307: Simplify detection of the MAVEN_HOME and make it fully qualified

GitBox
rosti-il opened a new pull request #307: Simplify detection of the MAVEN_HOME and make it fully qualified
URL: https://github.com/apache/maven/pull/307
 
 
   The removed 'stripMHome' recursive function is not needed anymore.
   
   Part of the 'mvn -version' output before this change:
   Maven home: D:\develop\apache-maven-3.6.3\bin\..
   
   Same part of the 'mvn -version' output after this change:
   Maven home: D:\develop\apache-maven-3.6.3
   I.e. now it's fully qualified.
   
   Following this checklist to help us incorporate your
   contribution quickly and easily:
   
    - [ ] Make sure there is a [JIRA issue](https://issues.apache.org/jira/browse/MNG) 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.
    - [ ] Each commit in the pull request should have a meaningful subject line and body.
    - [ ] Format the pull request title like `[MNG-XXX] - Fixes bug in ApproximateQuantiles`,
          where you replace `MNG-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.
    - [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
    - [ ] 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 [Core IT][core-its] successfully.
   
   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.
   
    - [ ] 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).
   
   [core-its]: https://maven.apache.org/core-its/core-it-suite/
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[hidden email]


With regards,
Apache Git Services
Reply | Threaded
Open this post in threaded view
|

[GitHub] [maven] slachiewicz commented on issue #307: Simplify detection of the MAVEN_HOME and make it fully qualified

GitBox
slachiewicz commented on issue #307: Simplify detection of the MAVEN_HOME and make it fully qualified
URL: https://github.com/apache/maven/pull/307#issuecomment-570074455
 
 
   Thank you for contribution - could you also create Jira here: https://issues.apache.org/jira/browse/MNG ?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[hidden email]


With regards,
Apache Git Services
Reply | Threaded
Open this post in threaded view
|

[GitHub] [maven] rosti-il commented on issue #307: Simplify detection of the MAVEN_HOME and make it fully qualified

GitBox
In reply to this post by GitBox
rosti-il commented on issue #307: Simplify detection of the MAVEN_HOME and make it fully qualified
URL: https://github.com/apache/maven/pull/307#issuecomment-570075705
 
 
   Created a Jira issue about this improvement:
   https://issues.apache.org/jira/browse/MNG-6837

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[hidden email]


With regards,
Apache Git Services
Reply | Threaded
Open this post in threaded view
|

[GitHub] [maven] slachiewicz commented on issue #307: Simplify detection of the MAVEN_HOME and make it fully qualified

GitBox
In reply to this post by GitBox
slachiewicz commented on issue #307: Simplify detection of the MAVEN_HOME and make it fully qualified
URL: https://github.com/apache/maven/pull/307#issuecomment-570090342
 
 
   https://gitbox.apache.org/repos/asf?p=maven.git;a=commit;h=488a555a9796b64e926daf2fde076e6cf4492683

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[hidden email]


With regards,
Apache Git Services
Reply | Threaded
Open this post in threaded view
|

[GitHub] [maven] rosti-il commented on issue #307: Simplify detection of the MAVEN_HOME and make it fully qualified

GitBox
In reply to this post by GitBox
rosti-il commented on issue #307: Simplify detection of the MAVEN_HOME and make it fully qualified
URL: https://github.com/apache/maven/pull/307#issuecomment-570222347
 
 
   I want to change this line in my commit:
   `set "MAVEN_HOME=%MAVEN_HOME:\bin\=%"`
   
   into this one:
   `set "MAVEN_HOME=%MAVEN_HOME:~0,-5%"`
   
   The reason: it's safer because theoretically the "/bin/" substring could appear more than once but we need to remove only the last one.
   
   I will amend my commit and push force it.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[hidden email]


With regards,
Apache Git Services
Reply | Threaded
Open this post in threaded view
|

[GitHub] [maven] rosti-il edited a comment on issue #307: Simplify detection of the MAVEN_HOME and make it fully qualified

GitBox
In reply to this post by GitBox
rosti-il edited a comment on issue #307: Simplify detection of the MAVEN_HOME and make it fully qualified
URL: https://github.com/apache/maven/pull/307#issuecomment-570222347
 
 
   I want to change this line in my commit:
   `set "MAVEN_HOME=%MAVEN_HOME:\bin\=%"`
   
   into this one:
   `set "MAVEN_HOME=%MAVEN_HOME:~0,-5%"`
   
   The reason: it's safer because theoretically the "\bin\" substring could appear more than once but we need to remove only the last one.
   
   I will amend my commit and push force it.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[hidden email]


With regards,
Apache Git Services
Reply | Threaded
Open this post in threaded view
|

[GitHub] [maven] rosti-il edited a comment on issue #307: Simplify detection of the MAVEN_HOME and make it fully qualified

GitBox
In reply to this post by GitBox
rosti-il edited a comment on issue #307: Simplify detection of the MAVEN_HOME and make it fully qualified
URL: https://github.com/apache/maven/pull/307#issuecomment-570222347
 
 
   I want to change this line in my commit:
   `set "MAVEN_HOME=%MAVEN_HOME:\bin\=%"`
   
   into this one:
   `set "MAVEN_HOME=%MAVEN_HOME:~0,-5%"`
   
   The reason: it's safer because theoretically the "\\bin\\" substring could appear more than once but we need to remove only the last one.
   
   I will amend my commit and push force it.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[hidden email]


With regards,
Apache Git Services
Reply | Threaded
Open this post in threaded view
|

[GitHub] [maven] slachiewicz commented on issue #307: Simplify detection of the MAVEN_HOME and make it fully qualified

GitBox
In reply to this post by GitBox
slachiewicz commented on issue #307: Simplify detection of the MAVEN_HOME and make it fully qualified
URL: https://github.com/apache/maven/pull/307#issuecomment-570411324
 
 
   Quick question - what form where we use `"` should be better?
   `set "MAVEN_HOME=xxxx"` or `set MAVEN_HOME="xxxx"`

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[hidden email]


With regards,
Apache Git Services
Reply | Threaded
Open this post in threaded view
|

[GitHub] [maven] rosti-il commented on issue #307: Simplify detection of the MAVEN_HOME and make it fully qualified

GitBox
In reply to this post by GitBox
rosti-il commented on issue #307: Simplify detection of the MAVEN_HOME and make it fully qualified
URL: https://github.com/apache/maven/pull/307#issuecomment-570478445
 
 
   I just kept the original style of using `"` in `set` commands. If you think another style is better I've no objection but this is another change that should be done on the whole `mvn.cmd` script, not only in set of the MAVEN_HOME. I think it should be different Jira and pull request anyway.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[hidden email]


With regards,
Apache Git Services
Reply | Threaded
Open this post in threaded view
|

[GitHub] [maven] rosti-il removed a comment on issue #307: Simplify detection of the MAVEN_HOME and make it fully qualified

GitBox
In reply to this post by GitBox
rosti-il removed a comment on issue #307: Simplify detection of the MAVEN_HOME and make it fully qualified
URL: https://github.com/apache/maven/pull/307#issuecomment-570478445
 
 
   I just kept the original style of using `"` in `set` commands. If you think another style is better I've no objection but this is another change that should be done on the whole `mvn.cmd` script, not only in set of the MAVEN_HOME. I think it should be different Jira and pull request anyway.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[hidden email]


With regards,
Apache Git Services
Reply | Threaded
Open this post in threaded view
|

[GitHub] [maven] rosti-il commented on issue #307: Simplify detection of the MAVEN_HOME and make it fully qualified

GitBox
In reply to this post by GitBox
rosti-il commented on issue #307: Simplify detection of the MAVEN_HOME and make it fully qualified
URL: https://github.com/apache/maven/pull/307#issuecomment-570480714
 
 
   I just kept the original style of using `"` in `set` commands. But now I found that this is not only a matter of style but a mandatory requirement. Using `set A="value with spaces"` inserts the double quotes into the variable value and we don't want this. Using `set "A=value with spaces"` doesn't insert the double quotes into the variable value and this is good.
   
   https://stackoverflow.com/questions/535975/dealing-with-quotes-in-windows-batch-scripts

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[hidden email]


With regards,
Apache Git Services
Reply | Threaded
Open this post in threaded view
|

[GitHub] [maven] michael-o commented on a change in pull request #307: Simplify detection of the MAVEN_HOME and make it fully qualified

GitBox
In reply to this post by GitBox
michael-o commented on a change in pull request #307: Simplify detection of the MAVEN_HOME and make it fully qualified
URL: https://github.com/apache/maven/pull/307#discussion_r364982393
 
 

 ##########
 File path: apache-maven/src/bin/mvn.cmd
 ##########
 @@ -60,15 +60,11 @@ echo NB: JAVA_HOME should point to a JDK not a JRE >&2
 goto error
 
 :chkMHome
-set "MAVEN_HOME=%~dp0.."
-if not "%MAVEN_HOME%"=="" goto stripMHome
+set "MAVEN_HOME=%~dp0"
+set "MAVEN_HOME=%MAVEN_HOME:~0,-5%"
 
 Review comment:
   This cannot be combined into one `set`?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[hidden email]


With regards,
Apache Git Services
Reply | Threaded
Open this post in threaded view
|

[GitHub] [maven] rosti-il commented on a change in pull request #307: Simplify detection of the MAVEN_HOME and make it fully qualified

GitBox
In reply to this post by GitBox
rosti-il commented on a change in pull request #307: Simplify detection of the MAVEN_HOME and make it fully qualified
URL: https://github.com/apache/maven/pull/307#discussion_r364997442
 
 

 ##########
 File path: apache-maven/src/bin/mvn.cmd
 ##########
 @@ -60,15 +60,11 @@ echo NB: JAVA_HOME should point to a JDK not a JRE >&2
 goto error
 
 :chkMHome
-set "MAVEN_HOME=%~dp0.."
-if not "%MAVEN_HOME%"=="" goto stripMHome
+set "MAVEN_HOME=%~dp0"
+set "MAVEN_HOME=%MAVEN_HOME:~0,-5%"
 
 Review comment:
   As far as I know this is impossible, unfortunately.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[hidden email]


With regards,
Apache Git Services
Reply | Threaded
Open this post in threaded view
|

[GitHub] [maven] asfgit closed pull request #307: Simplify detection of the MAVEN_HOME and make it fully qualified

GitBox
In reply to this post by GitBox
asfgit closed pull request #307: Simplify detection of the MAVEN_HOME and make it fully qualified
URL: https://github.com/apache/maven/pull/307
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[hidden email]


With regards,
Apache Git Services