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).
See http://ant.apache.org/ivy/history/latest-milestone/use/postresolvetask.html """ 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. """ Nicolas