ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Evgeny Goldin <>
Subject Re: "If Ant fails, it will return a non-zero exit code" - doesn't hold any more ?
Date Wed, 17 Dec 2003 17:40:35 GMT

MG> You can call cmd.exe and send along the command line parms of the batch file
MG> (and get all of the env vars set properly)
MG> OR you can call the perl script I mentioned earlier

I ended up with the following code (in fact, it was surprisingly simple to save
the java process exit code in variable and exit with it later on):

%JAVA_HOME%\jre\bin\java ...
set exit_code=%ERRORLEVEL%

... // some more commands

exit /b %exit_code%

If such a code was used in original ant.bat - it's exit code returned to the
outside world was indeed 1 for the failed projects.

DOS manual to the rescue !

"DOS Batch Language: A personal view"

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message