ant-ivy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicolas Lalevée <>
Subject Re: setting classpath
Date Wed, 20 Apr 2011 15:24:59 GMT

Le 18 avr. 2011 à 15:56, Felix Drueke a écrit :

> Hi,
> I think the usual procedure to set the classpath via Ivy is to use the cachepath-task.
> So I assume the following is a very common structure:
> <target name="resolve" depends="ivy.bootstrap" description="--> resolve and retrieve
dependencies with ivy">
>        <ivy:resolve />
>        <ivy:cachepath pathid="build.path" conf="build" />
>        <ivy:cachepath pathid="runtime.path" conf="runtime" />
>        <ivy:cachepath pathid="test.path" conf="test" />
> </target>
> <target name="compile"  depends="resolve" description="Compile Component Source">
>    <javac target="1.6" srcdir="src" destdir="classes" debug="true" classpathref="build.path"
> </target>
> However if you do it like that Ant will always resolve prior to compiling.
> Since resolving can potentially be very slow I wonder if there's a more convenient approach
> that allows to make the cachepath persistent somehow (e.g. I resolved last week and
> want to use that cachepath in the next ten compilations without resolving again).


If you want to to reuse the resolved data obtained through a call to resolve in another build
(i.e. not the current one), then you have to set the organisation and module attributes. This
work only if the cache was not cleaned since your last resolve call. This does not work with
inline calls, which must be performed in the same build.


View raw message