From 3a465e14779483c1c4f0be552298f5d2b232a29b Mon Sep 17 00:00:00 2001 From: Rostislav Krasny <45571812+rosti-il@users.noreply.github.com> Date: Wed, 1 Jan 2020 20:30:15 +0200 Subject: [PATCH] [MNG-6837] Simplify detection of the MAVEN_HOME and make it fully qualified on Windows The removed 'stripMHome' recursive function is not needed anymore This closes #307 --- 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 0b38157a79..50dafc7689 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:~0,-5%" +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