From bdb4fcd7a3cf1a8a52ce22e08539ea21ac1dfb43 Mon Sep 17 00:00:00 2001 From: Slawomir Jaranowski Date: Tue, 10 Jun 2025 23:39:36 +0200 Subject: [PATCH] [MNG-8315] Fix MAVEN_PROJECTBASEDIR in mvn.cmd when .mvn is at drive root --- dist/src/main/distro/bin/mvnd.cmd | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dist/src/main/distro/bin/mvnd.cmd b/dist/src/main/distro/bin/mvnd.cmd index b4075b50..5e2df6ab 100644 --- a/dist/src/main/distro/bin/mvnd.cmd +++ b/dist/src/main/distro/bin/mvnd.cmd @@ -189,6 +189,9 @@ for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do s :endReadAdditionalConfig +@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 ("%MVND_HOME%"\mvn\boot\plexus-classworlds-*) do set CLASSWORLDS_JAR="%%i" set CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher