1
在我的Ant构建我有以下代码:蚂蚁在try catch块失败
<trycatch reference="exception_ref">
<try>
<echo>Start Building Delivery</echo>
</try>
<catch>
<property name="exception" refid="exception_ref" />
<property name="message" value="Error in trycatch block:${line.separator}${exception}" />
<echo message="${message}" />
<fail message="${message}" />
</catch>
<finally>
<echo>Finally</echo>
</finally>
</trycatch>
蚂蚁说:
问题:无法创建任务或键入trycatch
原因:名称未定义。 操作:检查拼写。
操作:检查是否声明了任何自定义任务/类型。
操作:检查是否发生了任何/声明。
我在这里错过了什么?
//编辑:我在Eclipse
我在日食中使用ANt。我应该如何设置? – user3631654 2015-04-01 12:51:59
使用antcontrib.properties的taskdef定义错误。 antcontrib.properties只包含ant <1.6的taskdefs,声明它(假设antcontrib.jar已经在路径上): ... 或没有命名空间:<! - 进口AntContrib - > <的taskdef资源= “网/平方英尺/ antcontrib/antlib.xml”/> ... –
Rebse
2015-04-02 12:41:26