diff --git a/maven-embedder/src/bin/mvn.bat b/maven-embedder/src/bin/mvn.bat index 73b28bc6e0..71fba715e0 100644 --- a/maven-embedder/src/bin/mvn.bat +++ b/maven-embedder/src/bin/mvn.bat @@ -80,6 +80,13 @@ echo. goto error :valMHome + +:stripMHome +if not _%M2_HOME:~-1%==_\ goto checkMBat +set M2_HOME=%M2_HOME:~0,-1% +goto stripMHome + +:checkMBat if exist "%M2_HOME%\bin\mvn.bat" goto init echo. diff --git a/maven-embedder/src/bin/mvnDebug.bat b/maven-embedder/src/bin/mvnDebug.bat index 8d01c1a8fb..2576295401 100644 --- a/maven-embedder/src/bin/mvnDebug.bat +++ b/maven-embedder/src/bin/mvnDebug.bat @@ -83,6 +83,13 @@ echo. goto error :valMHome + +:stripMHome +if not _%M2_HOME:~-1%==_\ goto checkMBat +set M2_HOME=%M2_HOME:~0,-1% +goto stripMHome + +:checkMBat if exist "%M2_HOME%\bin\mvn.bat" goto init echo.