I'm a total newbie with Ivy, and have been trying it out very simply, for fetching commonly used libraries such as Guava and Gson that are available in the central Maven repository:
<ivy-module version="2.0">
<info organisation="com.company" module="foobar"/>
<dependencies>
<dependency org="com.google.guava" name="guava" rev="10.0.1"/>
<dependency org="com.google.code.gson" name="gson" rev="2.0"/>
</dependencies>
</ivy-module>
On Windows, by default, Ivy stores its files in %USERPROFILE%\.ivy2\cache\
; on Unix-y systems, they are downloaded under $HOME/.ivy2/
.
I suppose this is pretty basic question: how to tell Ivy to download both binaries and sources, and to put the binary jars in one (arbitrary) directory and source jars in another directory?
For example, I'd like Ivy to put all downloaded binary jars in [project_home]/WebContent/WEB-INF/lib
.
Note that I'm using Ivy via Ant, along the following lines, not an IDE plugin.
<project xmlns:ivy="antlib:org.apache.ivy.ant" name="ivy" default="resolve" >
<target name="resolve" description="retrieve dependencies with ivy">
<ivy:retrieve/>
</target>
<path id="ivy.lib.path">
<fileset dir="tools/buildlibs" includes="*.jar"/>
</path>
<taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path"/>
</project>