去http://ant-contrib.sourceforge.net/
下载和配置
使用方法参考下面
1: <trycatch property="error.message">
2: <try>
3: <echo message="Run integration test..."/>
4: <echo message="Start process"/>
5: <antcall target="launchTests"/>
6: </try>
7:
8: <catch>
9: <echo message="Integration test failed"/>
10: </catch>
11:
12: <finally>
13: <echo message="Kill the process"/>
14: <exec executable="kill -9 ..."/>
15: </finally>
16: </trycatch>