Search code examples
antivy

ivy jar located in my dep lib


how can I tell ant to find Ivy's jar in my own lib? ant just kept looking at it's home folder even when I've explicitly told it to find the jar somewhere else.


Solution

  • You can place Ivy binaries in some folder inside you project folder. For example, in my case, it's etc/build/. I put where ivy.jar and jsch.jar.

    After that provide the correct namespace in project defenfition and load Ivy.

    <project name="somename" basedir="." xmlns:ivy="antlib:org.apache.ivy.ant">
        <target name="ivy-load">
            <path id="ivy.lib.path">
                <pathelement location="${basedir}/etc/build/ivy.jar"/>
                <pathelement location="${basedir}/etc/build/jsch.jar"/>
            </path>
            <taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path"/>
        </target>
        <target name="ivy-init" depends="ivy-load">
            <ivy:settings file="${basedir}/etc/ivysettings/ivysettings.xml"/>
            <ivy:resolve conf="${ivy.conf}"/>
        </target>
        ...
    </project>