ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <>
Subject RE: <apply> and failifexecutionfails
Date Tue, 20 Sep 2005 09:11:25 GMT
I must admit that this area seems to be a real shortcoming in existing ANT tasks - not being
able to reliably swallow errors in subtasks, whatever they may be.

When I was trying to solve this problem before, there were suggestions as to how I can check
that the specific task (tomcat undeploy) would succeed before executing it, rather than being
able to support a failonerror property. This pre-validation is of course much more complex
and less useful for similar problems but which aren't for tomcat related tasks.

Is there a straightforward way to create a Task which swallows errors generically, regardless
of the type of task. Can it be built?


-----Original Message-----
From: Nicolas Vervelle []
Sent: Mon 9/19/2005 8:28 PM
To: Ant Users List
Subject: Re: <apply> and failifexecutionfails
Hi again,

I found how to overcome this problem : I first try to run xgettext2 
with <exec> task and with only one arg (--help) abd with attributes 
failifexecutionfails="false" resultproperty="xxx" just to check for 
xgettext2 existence.

Then I can use <apply> if xgettext2 exists.

To me, it really seems to be a bug in failifexecutionfails="false" for 
the <apply> task. It doesn't work, at least not in the same way of the 
<exec> task.


De: Nicolas Vervelle <>

> Hi,
> I want to run an executable during the build only if the 
> executable is 
> available.
> How can I prevent the build from failing if the executable is not 
> here ?
> I tried the failifexecutionfails attribute :
>    <apply executable="xgettext2" dir="${src.dir}" parallel="true"
>           verbose="true" relative="true" forwardslash="true"
>           failifexecutionfails="false">
>      <arg value="-kGT._" />
>      <arg value="--language=Java" />
>      <arg value="--msgid-bugs-address=jmol-
>      <arg value="--output-dir=${basedir}/${Jmol.po.dir}/tmp" />
>      <arg value="--output=Jmol.pot" />
>      <fileset dir="${src.dir}">
>        <include name="**/*.java"/>
>        <exclude name="**/jmol/applet/*.java"/>
>      </fileset>
> I thought that it would do the trick, but when I run the build 
> with the 
> executable missing, I got the following exception:
> E:\Java\Jmol-HEAD\build-i18n.xml:54: Execute failed: 
> CreateProcess: xgettext2 -kGT._ --
> language=Java --
> --output-
> dir=E:\Java\Jmol-HEAD/src/org/jmol/translation/Jmol/tmp --
> output=Jmol.pot ...

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

View raw message