I am building a project using Ant and Ivy. The build.xml file depends on ant-contrib, bean scripting framework, beanshell, and commons-logging.
Ant searches for libraries in several places, including ${user.home}/.ant/lib.
Is there any way in the build.xml file to have these libraries automatically download and install in the ${user.home}/.ant/lib directory if they are not already present, perhaps using Ivy itself?
Thanks, Ralph
I happened on this question as I was reading the Ivy cachefileset documentation, which states:
The Ivy cachepath documentation similarly states:
So, it would seem a better answer would be to modify Mark’s response to something that uses retrieve in conjunction with ant paths. Something along the lines of the following:
Mark’s Response (modified)
In your build.xml file you can create a path from this config
This would even allow you to move the retrieve task into a separate ant file that deals with dependencies. Thereby, you don’t have to rely on ivy after your dependencies are retrieved into their directories.
The intention of ivy is that you use it to pull down your jars (resolve & retrieve). Once you have them in place, you can switch back to using standard Ant.
Note: I would just pull these dependencies into the lib directory. That would simplify the retrieve task:
Also Note: visit the ‘Path-like Structures’ section of this page for more on “standard ant path creation”