ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peter Reilly" <>
Subject Re: [HELP] How to use ant-contrib inside an ant plugin?
Date Fri, 24 Nov 2006 14:23:07 GMT
Use the antlib:net.sf.antcontrib namespace

<ac:for param="i" begin="0" step="1" end="5" xmns:ac="antlib:net.sf.antcontrib">
        <echo>i is @{i}</echo>

Also, you should upgrade to ant 1.6.5 as ant1.6.5 fixes
a number of bugs found in ant 1.6.3.

(or ant 1.7.0 when it comes out in a few weeks).


On 11/24/06, Dharmesh Vyas <> wrote:
> Hello Group,
> I am a new member of the group. I am trying to use ant-contrib plugin with
> ant. I have been facing an issue where in it shows that "Could not create
> task or type of type: for."
> The full error that I get is:
> ******************************************************************************************D:\Projects\Ant-trials\ant-tasks\BuildTestEnv.xml:42:
> Could not create task or t
> ype of type: for.
> Ant could not find the task or a class this task relies upon.
> This is common and has a number of causes; the usual
> solutions are to read the manual pages then download and
> install needed JAR files, or fix the build file:
>  - You have misspelt 'for'.
>    Fix: check your spelling.
>  - The task needs an external JAR file to execute
>      and this is not found at the right place in the classpath.
>    Fix: check the documentation for dependencies.
>    Fix: declare the task.
>  - The task is an Ant optional task and the JAR file and/or libraries
>      implementing the functionality were not found at the time you
>      yourself built your installation of Ant from the Ant sources.
>    Fix: Look in the ANT_HOME/lib for the 'ant-' JAR corresponding to the
>      task and make sure it contains more than merely a META-INF/MANIFEST.MF.
>      If all it contains is the manifest, then rebuild Ant with the needed
>      libraries present in ${ant.home}/lib/optional/ , or alternatively,
>      download a pre-built release version from
>  - The build file was written for a later version of Ant
>    Fix: upgrade to at least the latest release version of Ant
>  - The task is not an Ant core or optional task
>      and needs to be declared using <taskdef>.
>  - You are attempting to use a task defined using
>     <presetdef> or <macrodef> but have spelt wrong or not
>    defined it at the point of use
> Remember that for JAR files to be visible to Ant tasks implemented
> in ANT_HOME/lib, the files must be in the same directory or on the
> classpath
> Please neither file bug reports on this problem, nor email the
> Ant mailing lists, until all of these causes have been explored,
> as this is not an Ant bug.
> ******************************************************************************************
> I have the ant 1.6.3 and ant-contrib 1.0b3-bin on my machine. I have copied
> jar file of ant-contrib in to ant/lib and the initial name of jar file was '
> ant-contrib-1.0b3', I was not sure if this name has to be changed to
> ant-contrib or antcontrib. But to give it a try, I have tried out that also
> but din't work for me.
> This is how I am using the "For" task in my build.xml file
>  <target name="useoffor">
>   <for param="i" begin="0" step="1" end="5">
>        <sequential>
>          <echo>i is @{i}</echo>
>        </sequential>
>      </for>
>   </target>
> To use "for" task do i need to define any thing else also in my
> build.xmlfile ? Please let me know where am I going wrong.
> Thanks a lot in Advance,
> - Dharmesh Vyas

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message