You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sl...@apache.org on 2020/01/01 22:49:17 UTC

[maven] 01/01: [MNG-6837] Simplify detection of the MAVEN_HOME and make it fully qualified

This is an automated email from the ASF dual-hosted git repository.

slachiewicz pushed a commit to branch MNG-6837
in repository https://gitbox.apache.org/repos/asf/maven.git

commit 488a555a9796b64e926daf2fde076e6cf4492683
Author: Rostislav Krasny <45...@users.noreply.github.com>
AuthorDate: Wed Jan 1 20:30:15 2020 +0200

    [MNG-6837] Simplify detection of the MAVEN_HOME and make it fully qualified
    
    The removed 'stripMHome' recursive function is not needed anymore
---
 apache-maven/src/bin/mvn.cmd | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/apache-maven/src/bin/mvn.cmd b/apache-maven/src/bin/mvn.cmd
index fd1b21e..66ce90d 100644
--- a/apache-maven/src/bin/mvn.cmd
+++ b/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:\bin\=%"
+if not "%MAVEN_HOME%"=="" goto checkMCmd
 goto error
 
-:stripMHome
-if not "_%MAVEN_HOME:~-1%"=="_\" goto checkMCmd
-set "MAVEN_HOME=%MAVEN_HOME:~0,-1%"
-goto stripMHome
-
 :checkMCmd
 if exist "%MAVEN_HOME%\bin\mvn.cmd" goto init
 goto error