align error handling with that of m1

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@168214 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Leslie Porter 2005-05-04 23:43:47 +00:00
parent 9e8bf3d291
commit d4af503a5c
1 changed files with 13 additions and 1 deletions

View File

@ -41,6 +41,8 @@ if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
@REM set local scope for the variables with windows NT shell @REM set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" @setlocal if "%OS%"=="Windows_NT" @setlocal
set ERROR_CODE=0
@REM ==== START VALIDATION ==== @REM ==== START VALIDATION ====
if not "%JAVA_HOME%" == "" goto OkJHome if not "%JAVA_HOME%" == "" goto OkJHome
@ -49,6 +51,7 @@ echo ERROR: JAVA_HOME not found in your environment.
echo Please set the JAVA_HOME variable in your environment to match the echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation echo location of your Java installation
echo. echo.
set ERROR_CODE=1
goto end goto end
:OkJHome :OkJHome
@ -60,6 +63,7 @@ echo JAVA_HOME = %JAVA_HOME%
echo Please set the JAVA_HOME variable in your environment to match the echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation echo location of your Java installation
echo. echo.
set ERROR_CODE=1
goto end goto end
:chkMHome :chkMHome
@ -73,6 +77,7 @@ echo ERROR: M2_HOME not found in your environment.
echo Please set the M2_HOME variable in your environment to match the echo Please set the M2_HOME variable in your environment to match the
echo location of the Maven installation echo location of the Maven installation
echo. echo.
set ERROR_CODE=1
goto end goto end
:valMHome :valMHome
@ -84,6 +89,7 @@ echo M2_HOME = %M2_HOME%
echo Please set the M2_HOME variable in your environment to match the echo Please set the M2_HOME variable in your environment to match the
echo location of the Maven installation echo location of the Maven installation
echo. echo.
set ERROR_CODE=1
goto end goto end
@REM ==== END VALIDATION ==== @REM ==== END VALIDATION ====
@ -122,7 +128,11 @@ SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
@REM Start MAVEN2 @REM Start MAVEN2
%MAVEN_JAVA_EXE% %MAVEN_OPTS% -classpath %M2_HOME%\core\boot\classworlds-*.jar "-Dclassworlds.conf=%M2_HOME%\bin\m2.conf" "-Dmaven.home=%M2_HOME%" org.codehaus.classworlds.Launcher %MAVEN_CMD_LINE_ARGS% %MAVEN_JAVA_EXE% %MAVEN_OPTS% -classpath %M2_HOME%\core\boot\classworlds-*.jar "-Dclassworlds.conf=%M2_HOME%\bin\m2.conf" "-Dmaven.home=%M2_HOME%" org.codehaus.classworlds.Launcher %MAVEN_CMD_LINE_ARGS%
goto :end goto end
:error
if "%OS%"=="Windows_NT" @endlocal
set ERROR_CODE=1
:end :end
@REM set local scope for the variables with windows NT shell @REM set local scope for the variables with windows NT shell
@ -142,3 +152,5 @@ if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
@REM pause the batch file if MAVEN_BATCH_PAUSE is set to 'on' @REM pause the batch file if MAVEN_BATCH_PAUSE is set to 'on'
if "%MAVEN_BATCH_PAUSE%" == "on" pause if "%MAVEN_BATCH_PAUSE%" == "on" pause
exit /B %ERROR_CODE%