I\'m fairly new to Ivy, so perhaps there\'s a straight forward way that I\'m not able to find in the documentation or what I\'m looking for is not possible, but here goes. I
I would echo @dbyrne's answer that ivy is designed to manage binary pre-compiled dependencies. You are best served in having a local repository manager like Nexus to store your project's 3rd party dependencies.
However....
It is technically possible for ivy to download and compile dependencies, using the packager resolver. This very clever resolver is designed to take a 3rd party zip or tar archive and then use ANT to extract out the required artifact.
Below is my example which downloads the "hello world" source from the github leachim6 repository and compiles it on the fly into a jar called "hello-world.jar".
Project files
|-- build.xml
|-- ivysettings.xml
|-- ivy.xml
`-- repository
`-- leachim6
`-- hello-world
`-- 1.0
`-- packager.xml
Declares a dependency against version 1.0 of the "hello-world" artifact. At this level ivy would be expected to fetch a jar from some sort of 3rd party repository.
This is where we define the repositories (or resolvers in ivy-speak) to be used. By default ivy retrieves from Maven Central, however, we've additionally specified that the "hello-world" module should instead be retrieved using a packager resolver.
The packager attributes need some further explanation:
Here is where we place the ANT script logic that creates the "hello-world.jar" artifact.
This file is used to generate an ANT script that downloads the remote artifact (using it's checksum for security) and extracts out or in our case compiles the artifact that will be returned to the ivy task.
Final notes: