ant-ivy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Trevin Beattie <>
Subject Re: Problem: failed to create task or type antlib:org.apache.ivy.ant:retrieve
Date Fri, 18 Apr 2008 18:35:22 GMT
Bug #35060 appears to have the same symptoms that I'm seeing, but I
don't see the resolution for that bug.  The poster claims to have moved
ant.jar and ant-launcher.jar to /usr/share/java/ant/, but the classpath
in the second command line shows that he is still using the ones
in /usr/share/java/.  In any event, when I copy ant.jar and
ant-launcher.jar to /usr/share/java/ant on my system, it has no effect;
the build still fails.

Another difference I noticed in the two command lines is that one puts
all of the jars in the -classpath option, while the other moves
everything except ant-launcher.jar over to the -cp option.  But that
didn't work for me either.  In fact, it didn't even work when I added
ivy-2.0.0-beta2.jar to -cp (either with the rest of the jars under -cp
or -classpath).  It only works when I add ivy-2.0.0-beta2.jar to the
-classpath option.

I tried adding another external task to ~/.ant/lib/, and it didn't work
either.  I'm going to try debugging the ant launcher, though I have no
idea when it's supposed to load the jars...

-- Trevin

On Thu, 2008-04-17 at 23:20 -0700, Maarten Coene wrote:
> Can you use other tasks when you put them in your ~/.ant/lib, or do you have only problems
with the ivy.jar? 
> Maybe your problem is related to
> Maarten
> ----- Original Message ----
> From: Trevin Beattie <>
> To:
> Sent: Friday, April 18, 2008 12:44:43 AM
> Subject: Re: Problem: failed to create task or type antlib:org.apache.ivy.ant:retrieve
> On Thu, 2008-04-17 at 23:00 +0200, Jacob Grydholt Jensen wrote:
> > On 17/04/2008, Trevin Beattie <> wrote:
> > > More details: I downloaded a fresh copy of the source tarballs of both
> > >  ant-1.6.2 and ant-1.6.5 from, built them (without any
> > >  vendor patches), and ran the full command line for each, *without*
> > >  explicitly adding ivy on the classpath.  With ant-1.6.2, the build
> > >  succeeded.  With ant-1.6.5, the build failed.  So it looks like ivy is
> > >  incompatible with newer versions of ant.  (1.6.5 is 3 years old, BTW)
> > 
> > I just tested 1.6.5 with 2.0.0-beta2 on Windows XP and it worked fine.
> > So it doesn't seem that ivy is incompatible with ant 1.6.5 in general.
> > But, it is strange that your combination of OS, ant and ivy does not
> > work. What is the output of ant -v (version 1.6.5 and ivy in
> > ~/.ant/lib)? I am also curious to see the value of ${user.home}.
> > 
> > Best regards,
> > Jacob Grydholt Jensen
> I don't see user.home or any other properties in the '-v' output.  But
> `ant -diagnostics' shows me: "user.home : /home/tbeattie".  Here's the
> '-v' output:
> Apache Ant version 1.6.5 compiled on August 30 2006
> Buildfile: build.xml
> Detected Java version: 1.5 in: /usr/java/jdk1.6.0_03/jre
> Detected OS: Linux
> parsing buildfile /home/tbeattie/src/apache-ivy-2.0.0-beta2/src/example/hello-ivy/build.xml
with URI = file:///home/tbeattie/src/apache-ivy-2.0.0-beta2/src/example/hello-ivy/build.xml
> Project base dir set to: /home/tbeattie/src/apache-ivy-2.0.0-beta2/src/example/hello-ivy
> Build sequence for target(s) `run' is [resolve, run]
> Complete build sequence is [resolve, run, report, clean, clean-cache, ]
> resolve:
> /home/tbeattie/src/apache-ivy-2.0.0-beta2/src/example/hello-ivy/build.xml:38: Could not
create task or type of type: antlib:org.apache.ivy.ant:retrieve.
> 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 'antlib:org.apache.ivy.ant:retrieve'.
>    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.
>     at
>     at
>     at
>     at
>     at
>     at
>     at
>     at
>     at
>     at
>     at
>     at
>     at
>     at
> Total time: 0 seconds

View raw message