You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by br...@apache.org on 2005/05/01 06:41:48 UTC

svn commit: r165456 - /maven/maven-1/core/trunk/src/bin/maven.bat

Author: brett
Date: Sat Apr 30 21:41:46 2005
New Revision: 165456

URL: http://svn.apache.org/viewcvs?rev=165456&view=rev
Log:
propogate error codes from windows batch file

Modified:
    maven/maven-1/core/trunk/src/bin/maven.bat

Modified: maven/maven-1/core/trunk/src/bin/maven.bat
URL: http://svn.apache.org/viewcvs/maven/maven-1/core/trunk/src/bin/maven.bat?rev=165456&r1=165455&r2=165456&view=diff
==============================================================================
--- maven/maven-1/core/trunk/src/bin/maven.bat (original)
+++ maven/maven-1/core/trunk/src/bin/maven.bat Sat Apr 30 21:41:46 2005
@@ -42,6 +42,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
 
@@ -50,6 +52,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
@@ -61,6 +64,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
@@ -71,6 +75,7 @@
 echo Please set the MAVEN_HOME variable in your environment to match the
 echo location of the Maven installation
 echo.
+set ERROR_CODE=1
 goto end
 
 :valMHome
@@ -82,6 +87,7 @@
 echo Please set the MAVEN_HOME variable in your environment to match the
 echo location of the Maven installation
 echo.
+set ERROR_CODE=1
 goto end
 @REM ==== END VALIDATION ====
 
@@ -124,14 +130,22 @@
 
 @REM Start MAVEN without MAVEN_HOME_LOCAL override
 %MAVEN_JAVA_EXE% -Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl -Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl "-Dmaven.home=%MAVEN_HOME%" "-Dtools.jar=%JAVA_HOME%\lib\tools.jar" "-Dforehead.conf.file=%MAVEN_HOME%\bin\forehead.conf" -Djava.endorsed.dirs=%MAVEN_ENDORSED% %MAVEN_OPTS% -classpath %MAVEN_CLASSPATH% %MAVEN_MAIN_CLASS% %MAVEN_CMD_LINE_ARGS%
+if errorlevel 1 goto error
 @REM %MAVEN_JAVA_EXE% -Dorg.xml.sax.driver=org.apache.xerces.parsers.SAXParser -Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl -Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl "-Dmaven.home=%MAVEN_HOME%" "-Dtools.jar=%JAVA_HOME%\lib\tools.jar" "-Dforehead.conf.file=%MAVEN_HOME%\bin\forehead.conf" -Djava.endorsed.dirs=%MAVEN_ENDORSED% %MAVEN_OPTS% -classpath %MAVEN_CLASSPATH% %MAVEN_MAIN_CLASS% %MAVEN_CMD_LINE_ARGS%
 goto :end
 
 @REM Start MAVEN with MAVEN_HOME_LOCAL override
 :StartMHL
 %MAVEN_JAVA_EXE% -Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl -Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl "-Dmaven.home=%MAVEN_HOME%" "-Dmaven.home.local=%MAVEN_HOME_LOCAL%" "-Dtools.jar=%JAVA_HOME%\lib\tools.jar" "-Dforehead.conf.file=%MAVEN_HOME%\bin\forehead.conf" -Djava.endorsed.dirs=%MAVEN_ENDORSED% %MAVEN_OPTS% -classpath %MAVEN_CLASSPATH% %MAVEN_MAIN_CLASS% %MAVEN_CMD_LINE_ARGS%
+if errorlevel 1 goto error
 @REM %MAVEN_JAVA_EXE% -Dorg.xml.sax.driver=org.apache.xerces.parsers.SAXParser -Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl -Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl "-Dmaven.home=%MAVEN_HOME%" "-Dmaven.home.local=%MAVEN_HOME_LOCAL%" "-Dtools.jar=%JAVA_HOME%\lib\tools.jar" "-Dforehead.conf.file=%MAVEN_HOME%\bin\forehead.conf" -Djava.endorsed.dirs=%MAVEN_ENDORSED% %MAVEN_OPTS% -classpath %MAVEN_CLASSPATH% %MAVEN_MAIN_CLASS% %MAVEN_CMD_LINE_ARGS%
 
+goto end
+
+:error
+if "%OS%"=="Windows_NT" @endlocal
+set ERROR_CODE=1
+
 :end
 @REM set local scope for the variables with windows NT shell
 if "%OS%"=="Windows_NT" goto endNT
@@ -151,4 +165,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 %ERROR_CODE%
 



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: svn commit: r165456 - /maven/maven-1/core/trunk/src/bin/maven.bat

Posted by Brett Porter <br...@apache.org>.
Thanks, I'll try it.

- Brett

Arnaud HERITIER wrote:

>Brett, this change is very annoying !!
>
>Each time we call maven (under XP) the exit function is called and the CMD.exe shell is closed :-(
>
>
>[SNIP]
>  
>
>>+exit %ERROR_CODE%
>>    
>>
>
>
>Under XP you must used the flag /b
>
>exit /b %ERROR_CODE%
>
>The shell will exit the error_level but the cmd.exe will not be closed.
>
>I can't test it with other windows ...
>
>Anyone else ?
>
>Arnaud
>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>For additional commands, e-mail: dev-help@maven.apache.org
>
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


RE: svn commit: r165456 - /maven/maven-1/core/trunk/src/bin/maven.bat

Posted by Arnaud HERITIER <ah...@gmail.com>.
Brett, this change is very annoying !!

Each time we call maven (under XP) the exit function is called and the CMD.exe shell is closed :-(


[SNIP]
> +exit %ERROR_CODE%


Under XP you must used the flag /b

exit /b %ERROR_CODE%

The shell will exit the error_level but the cmd.exe will not be closed.

I can't test it with other windows ...

Anyone else ?

Arnaud




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org