我有这个 ant 脚本,它从参数中读取组件列表并运行其他 ant 任务(build.xml):
<for list="${components.locations}" param="component" failonany="false">
<sequential>
<property name="@{component}" value="true"/>
<if>
<and>
<available file="${repository.location}/@{component}"/>
<available file="${repository.location}/${jars.location}"/>
</and>
<then>
<ant inheritAll="false" antfile="${repository.location}/@{component}/build.xml">
<!-- failonerror="false" -->
<property name="copy.libs" value="${copy.libs}"/>
<property name="repository.location" value="${repository.location}"/>
<property name="jars.location" value="${repository.location}/${jars.location}"/>
</ant>
</then>
</if>
</sequential>
</for>
问题是如果一个组件发生故障,脚本不会继续下一个。
我尝试使用 -k (-keep-going) 参数运行,但没有帮助。我发现了这个属性 failonerror="false" 但它对“exec”任务有效,并且不能将它与“ant”任务或“目标”集成。
其他方向是“for”的“failonany”属性,但我没有明确设置它。
可以请教...
谢谢。