diff --git a/maven-embedder/src/bin/mvn.bat b/maven-embedder/src/bin/mvn.bat index 71fba715e0..32878976f0 100644 --- a/maven-embedder/src/bin/mvn.bat +++ b/maven-embedder/src/bin/mvn.bat @@ -37,6 +37,9 @@ @REM enable echoing my setting MAVEN_BATCH_ECHO to 'on' @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% +@REM set %HOME% to equivalent of $HOME +if "%HOME%" == "" (set HOME=%HOMEDRIVE%%HOMEPATH%) + @REM Execute a user defined script before this one if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" @@ -44,6 +47,7 @@ set ERROR_CODE=0 @REM set local scope for the variables with windows NT shell if "%OS%"=="Windows_NT" @setlocal +if "%OS%"=="WINNT" @setlocal @REM ==== START VALIDATION ==== if not "%JAVA_HOME%" == "" goto OkJHome @@ -70,6 +74,7 @@ goto error if not "%M2_HOME%"=="" goto valMHome if "%OS%"=="Windows_NT" SET M2_HOME=%~dp0\.. +if "%OS%"=="WINNT" SET M2_HOME=%~dp0\.. if not "%M2_HOME%"=="" goto valMHome echo. @@ -101,11 +106,16 @@ goto error :init @REM Decide how to startup depending on the version of windows +@REM -- Windows NT with Novell Login +if "%OS%"=="WINNT" goto WinNTNovell + @REM -- Win98ME if NOT "%OS%"=="Windows_NT" goto Win9xArg +:WinNTNovell + @REM -- 4NT shell -if "%eval[2+2]" == "4" goto 4NTArgs +if "%@eval[2+2]" == "4" goto 4NTArgs @REM -- Regular WinNT shell set MAVEN_CMD_LINE_ARGS=%* @@ -130,19 +140,33 @@ goto Win9xApp :endInit SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" +@REM -- 4NT shell +if "%@eval[2+2]" == "4" goto 4NTCWJars + +@REM -- Regular WinNT shell +for %%i in ("%M2_HOME%"\boot\classworlds-*) do set CLASSWORLDS_JAR="%%i" +goto runm2 + +@REM The 4NT Shell from jp software +:4NTCWJars +for %%i in ("%M2_HOME%\boot\classworlds-*") do set CLASSWORLDS_JAR="%%i" +goto runm2 + @REM Start MAVEN2 -for %%i in ("%M2_HOME%"\boot\plexus-classworlds-*) do set CLASSWORLDS_JAR="%%i" -%MAVEN_JAVA_EXE% %MAVEN_OPTS% -classpath %CLASSWORLDS_JAR% "-Dclassworlds.conf=%M2_HOME%\bin\m2.conf" "-Dmaven.home=%M2_HOME%" org.codehaus.plexus.classworlds.launcher.Launcher %MAVEN_CMD_LINE_ARGS% +:runm2 +%MAVEN_JAVA_EXE% %MAVEN_OPTS% -classpath %CLASSWORLDS_JAR% "-Dclassworlds.conf=%M2_HOME%\bin\m2.conf" "-Dmaven.home=%M2_HOME%" org.codehaus.classworlds.Launcher %MAVEN_CMD_LINE_ARGS% if ERRORLEVEL 1 goto error goto end :error if "%OS%"=="Windows_NT" @endlocal +if "%OS%"=="WINNT" @endlocal set ERROR_CODE=1 :end @REM set local scope for the variables with windows NT shell if "%OS%"=="Windows_NT" goto endNT +if "%OS%"=="WINNT" goto endNT @REM For old DOS remove the set variables from ENV - we assume they were not set @REM before we started - at least we don't leave any baggage around @@ -151,7 +175,7 @@ set MAVEN_CMD_LINE_ARGS= goto postExec :endNT -@endlocal +@endlocal & set ERROR_CODE=%ERROR_CODE% :postExec if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" diff --git a/maven-embedder/src/bin/mvnDebug.bat b/maven-embedder/src/bin/mvnDebug.bat index 2576295401..2a3a4b887d 100644 --- a/maven-embedder/src/bin/mvnDebug.bat +++ b/maven-embedder/src/bin/mvnDebug.bat @@ -40,6 +40,9 @@ set INT_MAVEN_OPTS=%MAVEN_OPTS% -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp @REM enable echoing my setting MAVEN_BATCH_ECHO to 'on' @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% +@REM set %HOME% to equivalent of $HOME +if "%HOME%" == "" (set HOME=%HOMEDRIVE%%HOMEPATH%) + @REM Execute a user defined script before this one if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" @@ -47,6 +50,7 @@ set ERROR_CODE=0 @REM set local scope for the variables with windows NT shell if "%OS%"=="Windows_NT" @setlocal +if "%OS%"=="WINNT" @setlocal @REM ==== START VALIDATION ==== if not "%JAVA_HOME%" == "" goto OkJHome @@ -73,6 +77,7 @@ goto error if not "%M2_HOME%"=="" goto valMHome if "%OS%"=="Windows_NT" SET M2_HOME=%~dp0\.. +if "%OS%"=="WINNT" SET M2_HOME=%~dp0\.. if not "%M2_HOME%"=="" goto valMHome echo. @@ -104,11 +109,16 @@ goto error :init @REM Decide how to startup depending on the version of windows +@REM -- Windows NT with Novell Login +if "%OS%"=="WINNT" goto WinNTNovell + @REM -- Win98ME if NOT "%OS%"=="Windows_NT" goto Win9xArg +:WinNTNovell + @REM -- 4NT shell -if "%eval[2+2]" == "4" goto 4NTArgs +if "%@eval[2+2]" == "4" goto 4NTArgs @REM -- Regular WinNT shell set MAVEN_CMD_LINE_ARGS=%* @@ -133,19 +143,34 @@ goto Win9xApp :endInit SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" +@REM -- 4NT shell +if "%@eval[2+2]" == "4" goto 4NTCWJars + +@REM -- Regular WinNT shell +for %%i in ("%M2_HOME%"\boot\classworlds-*) do set CLASSWORLDS_JAR="%%i" +goto runm2 + +@REM The 4NT Shell from jp software +:4NTCWJars +for %%i in ("%M2_HOME%\boot\classworlds-*") do set CLASSWORLDS_JAR="%%i" +goto runm2 + @REM Start MAVEN2 -for %%i in ("%M2_HOME%"\boot\plexus-classworlds-*) do set CLASSWORLDS_JAR="%%i" -%MAVEN_JAVA_EXE% %INT_MAVEN_OPTS% -classpath %CLASSWORLDS_JAR% "-Dclassworlds.conf=%M2_HOME%\bin\m2.conf" "-Dmaven.home=%M2_HOME%" org.codehaus.plexus.classworlds.launcher.Launcher %MAVEN_CMD_LINE_ARGS% +:runm2 + +%MAVEN_JAVA_EXE% %INT_MAVEN_OPTS% -classpath %CLASSWORLDS_JAR% "-Dclassworlds.conf=%M2_HOME%\bin\m2.conf" "-Dmaven.home=%M2_HOME%" org.codehaus.classworlds.Launcher %MAVEN_CMD_LINE_ARGS% if ERRORLEVEL 1 goto error goto end :error if "%OS%"=="Windows_NT" @endlocal +if "%OS%"=="WINNT" @endlocal set ERROR_CODE=1 :end @REM set local scope for the variables with windows NT shell if "%OS%"=="Windows_NT" goto endNT +if "%OS%"=="WINNT" goto endNT @REM For old DOS remove the set variables from ENV - we assume they were not set @REM before we started - at least we don't leave any baggage around @@ -154,7 +179,7 @@ set MAVEN_CMD_LINE_ARGS= goto postExec :endNT -@endlocal +@endlocal & set ERROR_CODE=%ERROR_CODE% :postExec if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"