ant-ivy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Maarten Coene <>
Subject Re: Use ivy-dependencies to create ant-tasks
Date Wed, 10 Mar 2010 22:13:30 GMT
It's not required to create an ivy.xml for you build-dependencies, you can resolve them inline
in your build.xml.
The build.xml of Ivy uses this approach, for instance to load the emma taskdef:

    <target name="emma" depends="jar" unless="skip.test">
        <ivy:cachepath organisation="emma" module="emma" revision="2.0.5312" 
                       inline="true" conf="default" pathid="emma.classpath" 
                       log="download-only" /> 
        <ivy:cachepath organisation="emma" module="emma_ant" revision="2.0.5312" 
                       inline="true" conf="default" pathid="emma.ant.classpath" transitive="false"

                       log="download-only" /> 
        <taskdef resource="">
            <classpath refid="emma.classpath" />
            <classpath refid="emma.ant.classpath" />


----- Original Message ----
From: Mitch Gitman <>
Sent: Wed, March 10, 2010 10:02:56 PM
Subject: Re: Use ivy-dependencies to create ant-tasks

Marc, doing everything at once at init sounds a bit heavyweight and
monolithic. Imagine you're resolving and retrieving 15 different task
libraries when all you need for a given build is two or three.

Instead, I would obtain tasks on an as-needed basis. So for example, the
moment you need a particular task is the moment you do:

   1. ivy:resolve
   2. ivy:retrieve
   3. taskdef

But this approach also presumes that you've created more fine-grained Ivy
confs that correspond to your different optional tasks.

BTW, when you're using two different Ivy module descriptors in a build, make
sure to specify the file attribute on the ivy:resolve each time so Ivy
doesn't use the wrong one. Good habit anyway, as far as I'm concerned.

On Wed, Mar 10, 2010 at 12:46 PM, marcdb <> wrote:

> Hi Mitch,
> Thanks for your suggestion. I'll try to do the following:
> In my central build file (used for building all projects), I will create an
> init-target which will:
> * execute an ivy:init
> * do an ivy:retrieve using that common ivy.xml file for the dependencies of
> my build-system itself. The appropriate versions of the jars that I need to
> create my ant-tasks will then be retrieved in an appropriate directory for
> my build-system.
> * call the <taskdef> task in ant, to create/define the additional ant-tasks
> that I need.
> I hope this will work. It actually seems simplier than I first thought
> :thinking:
> Regards,
> Marc
> --
> View this message in context:
> Sent from the ivy-user mailing list archive at


View raw message