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:32:56 GMT

That's strange, my previous message doesn't seem to appear on list, so I'll
repeat it here. I think I've found the problem, taking a look on ant.bat:
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.

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

View raw message