I am getting following while doing ant build:
Build\\build.xml:247: Problem: failed to create task or type
for
Cause: The name is undefined.
Action: Check th
Ant needs to be aware of the the dependency. The following is a more succinct version of David W's answer. Add the equivalent of the following to your ant project:
<taskdef resource="net/sf/antcontrib/antcontrib.properties" classpath="relative/path/to/ant-contrib-1.0b3.jar"/>
<taskdef resource="net/sf/antcontrib/antlib.xml" classpath="relative/path/to/ant-contrib-1.0b3.jar"/>
If you placed the AntContrib jar in $ANT_HOME
/lib directory, all you really need to do is this:
<taskdef resource="net/sf/antcontrib/antcontrib.properties"/>
Actually to use the <for/>
task, you need to do this:
<taskdef resource="net/sf/antcontrib/antlib.xml"/>
Note you have to use antlib.xml
and not antcontrib.properties
. Read the Installation directions very carefully. It's easy to miss.
If you are doing this in a group project, I recommend that you put your ant-contrib.jar in your project. THen add them to your project in your version control system. That way, other developers can use your build with the ant-contrib tasks without downloading the ant-contrib jar and installing it in their $ANT_HOME directory themselves.
Let's say you create a directory called ant-contrib.dir
and put that in the root of your project, then put the ant-contrib jar in that folder. Just put this in your project:
<taskdef resource="net/sf/antcontrib/antlib.xml">
<classpath>
<fileset dir="${basedir}/ant-contrib.dir"/>
</classpath>
</taskdef>