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 Tue, 16 Dec 2003 16:12:29 GMT

EG> It's being said on this list that "If Ant fails, it will return a non-zero exit
EG> code". Unfortunately, it doesn't work for me:

Taking a look on ant.bat I see:
"%_JAVACMD%" %ANT_OPTS% -classpath "%LOCALCLASSPATH%" "-Dant.home=%ANT_HOME%"
goto end

"%_JAVACMD%" %ANT_OPTS% -classpath "%LOCALCLASSPATH%" "-Dant.home=%ANT_HOME%" "-Djikes.class.path=%JIKESPATH%" %ANT_ARGS% %ANT_CMD_LINE_ARGS%
goto end


if "%OS%"=="Windows_NT" @endlocal

if exist "%HOME%\antrc_post.bat" call "%HOME%\antrc_post.bat"

So my thought is following: since running Java isn't the latest operation in
the batch file - all following operations simply overwrite the exit code of java
process which is indeed 1 when it fails. But since following operations do succeed -
what is finally returned to the outside world is *their* exit code, not java's
(never was a batch-files pro, so this is only a guess).

After I removed everything after first "%_JAVACMD%" in :runAnt label (to make sure
"%_JAVACMD%" is the latest operation executed) - the exit code I received from running
'ant' has become 1 for failed projects.

That's weird ... Did nobody notice this behavior before ?

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

View raw message