I assume this is an ant script and not an xsl target.
You can use the failifexecutionfails attribute of the exec task:
http://ant.apache.org/manual/Tasks/exec.html
Thus, if your execution fails for any reason, your assembly will also fail. By default, this value is true. You can also check the return code of your executable using attributes:
failonerror
and
resultproperty
eg.
<target name="refactor-ids"> <echo>Refactor IDs</echo> <exec executable="perl" dir="${basedir}" failonerror="false" resultproperty="return.code"> <arg value="script.pl" /> <arg value="input.xml" /> </exec> <fail> <condition> <equals arg1="-1" arg2="${return.code}"/> </condition> </fail> </target>
source share