【发布时间】:2013-05-17 11:56:58
【问题描述】:
我想使用“ant-contrib”,但我无法使用它。我尝试使用 3 方式,但没有成功。
Apache Ant(TM) version 1.8.2
echo $ANT_HOME
/usr/share/ant
./usr/share/ant/lib/ant-contrib-1.0b2.jar
./usr/share/java/ant/ant-contrib-1.0b2.jar
./usr/share/java/ant.jar
*1.*
<taskdef resource="net/sf/antcontrib/antcontrib.properties" />
RESULT:
Buildfile: /home/username/build.xml
[taskdef] Could not load definitions from resource net/sf/antcontrib
/antcontrib.properties. It could not be found.
*2.*
<taskdef resource="net/sf/antcontrib/antlib.xml"/>
RESULT:
Buildfile: /home/username/build.xml
[taskdef] Could not load definitions from resource net/sf/antcontrib/antlib.xml. It could not be found.
*3.* build.xml in my home, and ant-contrib in home/lib
<classpath id="contrib.classpath.ref">
<fileset dir="${basedir}/lib"/>
</classpath>
<taskdef resource="net/sf/antcontrib/antcontrib.properties" classpathref="contrib.classpath.ref"/>
RESULT:
Buildfile: /home/username/build.xml:2: Problem: failed to create task or type classpath
Cause: The name is undefined.
Action: Check the spelling.
我不知道其他解决方案,我可以在其中迭代文件集/自定义列表,对它们一一进行。这就是为什么它对我很重要。 老实说,为什么没有明确的文档?
【问题讨论】:
-
你可能跑错了蚂蚁?
-
另一个可能有帮助的答案stackoverflow.com/questions/15304845/…
-
谢谢大家的帮助和努力,我还是没有头绪。
标签: ant