I find the Ivy API to be immensely complicated.
What is the simplest possible snippet to retrieve an artifact from Maven Central into a specific local directory using Ivy 100% programmatically (no Ant, no Xml files, ...)?
For the sake of an example say retrieving commons-logging:commons-logging:1.1:jar into /my/destination.
I have been working on using Ivy to remotely resolve artifacts (and dependencies) from Maven repository. Here is one code sample that downloads one artifact (w/o dependencies).
If you need dependencies, you need to adapt the dependency descriptor.
Some note:
Ivy uses a cache to store previously retrieved artifacts and their "ivy translations" (you will find ivy modules derived from Maven artifacts in the cache)
The general concept is that you programmatically create an Ivy module that has dependencies on Maven repository stored "pseudo-modules" (i.e. there is a mapping under the hood implemented by the resolver - I believe).
In general a good starting point, if you want to know how to programmatically use Ivy, is the main class
org.apache.ivy.Main
.The simplest way to retrieve an artifact (and it's dependencies) is to use ivy from the command-line
This will retrieve the files into the directory "/my/destination".
Other examples: