我想使用'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.我不知道其他的解决方案,我可以遍历一个文件集/自定义列表,一个接一个地对它们做一些事情。这就是为什么它对我很重要。老实说,为什么没有清晰的文档?
发布于 2013-05-18 13:59:28
问题是上面提到的严。我的身体里有更多的蚂蚁。
总而言之,我删除了它们,用一个全新下载的ant重新尝试了我的构建xml。什么不在路径上,并从它所在的目录开始。
我知道这不是最好的设置,但我可以尝试我想要的,解决正确的设置只是时间问题。
感谢你们的时间和努力。
https://stackoverflow.com/questions/16608415
复制相似问题