我的 ant-contrib-0.3 中没有 antlib.xml [英] There isn't antlib.xml in my ant-contrib-0.3
问题描述
我正在尝试使用任务 for
.我尝试使用此任务定义:
I am trying to use task for
. I tried with this task definition:
<taskdef resource="net/sf/antcontrib/antlib.xml">
<classpath>
<pathelement location="${infrastructure-base-dir}/apache-ant-1.9.6/lib/ant-contrib-0.3.jar"/>
</classpath>
</taskdef>
但是没有用.出现此消息:
But didn't work. This message appear:
问题:创建任务或类型失败
Problem: failed to create task or type for
所以我决定解压 ant-contrib-0.3.jar
看看里面有什么.并且此路径中没有 antlib.xml
:net/sf/antcontrib/
.那么,为了让 task FOR 工作,你会给我什么建议?
So I decider to unzip ant-contrib-0.3.jar
to see what's inside. And there wasn't antlib.xml
in this path: net/sf/antcontrib/
. So what would you advise me in order to make task FOR to work?
推荐答案
试试这个:
在你的 build.xml 中
In your build.xml
<taskdef name="for-contrib" classname="net.sf.antcontrib.logic.ForTask" classpath="${basedir}/lib/ant-contrib-1.0b3.jar"/>
将 jar 文件放置在正确的位置,即与 build.xml 处于同一级别的 lib 文件夹中.
Place jar file file in correct location, i.e. in lib folder at same level as build.xml.
根据需要使用 for,即
Use the for as needed, i.e
这篇关于我的 ant-contrib-0.3 中没有 antlib.xml的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!