From eda9aa6982fbf00881fc00b8ebd841114dbf9bd2 Mon Sep 17 00:00:00 2001 From: Guillaume Nodet Date: Thu, 17 Oct 2024 11:28:11 +0200 Subject: [PATCH] [MNG-8315] Fix MAVEN_PROJECTBASEDIR in mvn.cmd when .mvn is at drive root (#1808) fixes https://issues.apache.org/jira/browse/MNG-8315 Co-authored-by: Francois Marot --- apache-maven/src/assembly/maven/bin/mvn.cmd | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apache-maven/src/assembly/maven/bin/mvn.cmd b/apache-maven/src/assembly/maven/bin/mvn.cmd index e370a81729..e51267e4d7 100644 --- a/apache-maven/src/assembly/maven/bin/mvn.cmd +++ b/apache-maven/src/assembly/maven/bin/mvn.cmd @@ -171,6 +171,9 @@ for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do s :endReadJvmConfig +@REM do not let MAVEN_PROJECTBASEDIR end with a single backslash which would escape the double quote. This happens when .mvn at drive root. +if "_%MAVEN_PROJECTBASEDIR:~-1%"=="_\" set "MAVEN_PROJECTBASEDIR=%MAVEN_PROJECTBASEDIR%\" + for %%i in ("%MAVEN_HOME%"\boot\plexus-classworlds-*) do set LAUNCHER_JAR="%%i" set LAUNCHER_CLASS=org.codehaus.plexus.classworlds.launcher.Launcher if "%MAVEN_MAIN_CLASS%"=="" @set MAVEN_MAIN_CLASS=org.apache.maven.cling.MavenCling