Is there a way to select which ivy.xml
file to use when I invoke ivy:retrieve
?
Looking at the documentation it appears that I can use the settingsRef
property to select which IVY settings file to use but it's not the ivysettings.xml
file I wish to modify, rather it's ivy.xml
. My use case is the following:
ivy.xml
file that I use to fetch my compile-time and run-time dependenciesivy.xml
file that I can simply copy across my projects.So this is how I did it in the end:
<target name="fetch-buildsystem-deps" depends="configure-ivy-settings">
<ivy:resolve file="ivy-buildsystem.xml"/>
<ivy:retrieve conf="build-system"
pattern="${lib-ivy-buildsystem.dir}/[artifact]-[revision](-[classifier]).[ext]"
sync="true"
type="jar, bundle"/>
</target>
… where the file ivy-buildsystem.xml
identifies only the dependencies of my Ivy tasks. E.g. contains stuff like:
<configurations>
<conf name="build-system" description="artifacts needed by the build-system itself"/>
</configurations>
<dependencies>
<!--dependency org="ant-contrib" name="ant-contrib" rev="1.0b3" conf="build-system->master"/-->
<dependency org="com.puppycrawl.tools" name="checkstyle" rev="5.9" conf="build-system->default"/>
<dependency org="com.google.code.findbugs" name="findbugs-ant" rev="3.0.0" conf="build-system->default"/>
<dependency org="net.sourceforge.pmd" name="pmd-java" rev="5.5.3" conf="build-system->default"/>
</dependencies>