Author: brett
Date: Wed May 4 16:43:47 2005
New Revision: 168214
URL: http://svn.apache.org/viewcvs?rev=168214&view=rev
Log:
align error handling with that of m1
Modified:
maven/components/trunk/maven-core/src/bin/m2.bat
Modified: maven/components/trunk/maven-core/src/bin/m2.bat
URL:
http://svn.apache.org/viewcvs/maven/components/trunk/maven-core/src/bin/m2.bat?rev=168214&r1=168213&r2=168214&view=diff
==============================================================================
--- maven/components/trunk/maven-core/src/bin/m2.bat (original)
+++ maven/components/trunk/maven-core/src/bin/m2.bat Wed May 4 16:43:47 2005
@@ -41,6 +41,8 @@
@REM set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" @setlocal
+set ERROR_CODE=0
+
@REM ==== START VALIDATION ====
if not "%JAVA_HOME%" == "" goto OkJHome
@@ -49,6 +51,7 @@
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation
echo.
+set ERROR_CODE=1
goto end
:OkJHome
@@ -60,6 +63,7 @@
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation
echo.
+set ERROR_CODE=1
goto end
:chkMHome
@@ -73,6 +77,7 @@
echo Please set the M2_HOME variable in your environment to match the
echo location of the Maven installation
echo.
+set ERROR_CODE=1
goto end
:valMHome
@@ -84,6 +89,7 @@
echo Please set the M2_HOME variable in your environment to match the
echo location of the Maven installation
echo.
+set ERROR_CODE=1
goto end
@REM ==== END VALIDATION ====
@@ -122,7 +128,11 @@
@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%
-goto :end
+goto end
+
+:error
+if "%OS%"=="Windows_NT" @endlocal
+set ERROR_CODE=1
:end
@REM set local scope for the variables with windows NT shell
@@ -141,4 +151,6 @@
if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
@REM pause the batch file if MAVEN_BATCH_PAUSE is set to 'on'
if "%MAVEN_BATCH_PAUSE%" == "on" pause
+
+exit /B %ERROR_CODE%
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]