title: How do I get and use the Apache Ivy.jar file from inside my project, without having it in my .ant folder?
body: <p>At the moment I have this configuration:</p>
  
  <p>build.xml:</p>
  
  <pre><code>&lt;!-- Ivy settings start--&gt;
  
      &lt;condition property="ivy.home" value="${env.IVY_HOME}"&gt;
          &lt;isset property="env.IVY_HOME" /&gt;
      &lt;/condition&gt;
  
  
      &lt;target name="download-ivy" unless="offline" description="Download Ivy"&gt;
          &lt;mkdir dir="${ivy.jar.dir}"/&gt;
              &lt;!-- download Ivy from web site so that it can be used even without any special installation --&gt;
          &lt;get src="http://repo2.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar" 
              dest="${ivy.jar.file}" usetimestamp="true"/&gt;
      &lt;/target&gt;
  
  
      &lt;target name="init-ivy" depends="download-ivy" description="Initialize Ivy"&gt;
          &lt;!-- try to load ivy here from ivy home, in case the user has not already dropped
          it into ant's lib dir (note that the latter copy will always take precedence).
          We will not fail as long as local lib dir exists (it may be empty) and
          ivy is in at least one of ant's lib dir or the local lib dir. --&gt;
          &lt;path id="ivy.lib.path"&gt;
              &lt;fileset dir="${ivy.jar.dir}" includes="*.jar"/&gt;
          &lt;/path&gt;
          &lt;taskdef resource="org/apache/ivy/ant/antlib.xml"
          uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path"/&gt;
      &lt;/target&gt;
  
      &lt;target name="update" depends="init-ivy" description="Download project dependencies"&gt;
          &lt;!-- edited for brevity --&gt;
  
          &lt;ivy:retrieve pattern="war/WEB-INF/lib/[artifact]-[revision].[ext]" /&gt;
          &lt;!-- edited for brevity --&gt;
      &lt;/target&gt;
  
  
      &lt;target name="clean-all" depends="clean" description="Purge ivy cache"&gt;
          &lt;ivy:cleancache/&gt;
      &lt;/target&gt;
  
  &lt;!-- Ivy settings end--&gt;
  </code></pre>
  
  <p>build.properties:</p>
  
  <pre><code>ivy.install.version=2.2.0
  ivy.home=${user.home}/.ant
  ivy.jar.dir=${ivy.home}/lib
  ivy.jar.file=${ivy.jar.dir}/ivy-${ivy.install.version}.jar
  </code></pre>
  
  <p>ivy.xml:</p>
  
  <pre><code>&lt;ivy-module version="2.0"&gt;
      &lt;info organisation="org.apache" module="hello-ivy"/&gt;
      &lt;dependencies&gt;
          &lt;dependency org="commons-lang" name="commons-lang" rev="2.1" conf="default-&gt;master"/&gt;
  
      &lt;/dependencies&gt;
  &lt;/ivy-module&gt;
  </code></pre>
  
  <p>This means that Ivy will be downloaded to my <code>${user.home}/.ant/lib</code> and will be used from there.</p>
  
  <p>How can I download it to my project library(for example war/WEB-INF/lib) and use it from there, so all my files are together and not scattered around my computer?</p>