title: Ant target failing: Antlib or Ivy issue?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/9853851/ivy-fails-to-resolve-a-dependancy-unable-to-find-cause">Ivy fails to resolve a dependancy, unable to find cause</a>  </p>
  </blockquote>
  
  
  
  <p>I'm trying to run the following build task (<code>initIvy</code>):</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;project name="myproject-build" default="package" basedir=".." xmlns:ivy="antlib:org.apache.ivy.ant"&gt;
      &lt;property file="build/build.properties"/&gt;
      &lt;property environment="env"/&gt;
  
      &lt;!-- Ant library path, including all of its plugins. --&gt;
      &lt;path id="ant.lib.path"&gt;
          &lt;fileset dir="${env.ANT_HOME}/lib" includes="*.jar"/&gt;
      &lt;/path&gt;
  
      &lt;!-- CONFIGURE IVY --&gt;
          &lt;taskdef resource="org/apache/ivy/ant/antlib.xml"
              uri="antlib:org.apache.ivy.ant" classpathref="ant.lib.path"/&gt;
  
      &lt;!-- Use Ivy tasks to resolve dependencies into the local Ivy cache. --&gt;
      &lt;target name="initIvy"&gt;
          &lt;!-- Initialize Ivy and connect to host repository. --&gt;
          &lt;echo message="Initializing Apache Ivy and connecting to the host repository."/&gt;
          &lt;ivy:settings url="${ivy.std.repo.settings.url}" realm="${ivy.std.repo.realm}" username="${ivy.std.repo.username}" passwd="${ivy.std.repo.password}"/&gt;
  
          &lt;!-- Clear/flush the Ivy cache. --&gt;
          &lt;echo message="Cleaning the local Ivy cache for the current build."/&gt;
          &lt;ivy:cleancache/&gt;
      &lt;/target&gt;
  
      &lt;!-- Rest of buildfile omitted for brevity. --&gt;
  
  &lt;/project&gt;
  </code></pre>
  
  <p>When I run <code>ant -buildfile build.xml initIvy</code> I get the following output:</p>
  
  <pre><code>Buildfile: /&lt;path-to-my-project&gt;/build/build.xml
      [taskdef] Could not load definitions from resource org/apache/ivy/ant/antlib.xml. It could not be found.
  
  initIvy:
      [echo] Initializing Apache Ivy and connecting to the host repository.
  
  BUILD FAILED
  /&lt;path-to-my-project&gt;/build/build.xml:81: Problem: failed to create task or type antlib:org.apache.ivy.ant:settings
      Cause: The name is undefined.
      Action: Check the spelling.
      Action: Check that any custom tasks/types have been declared.
      Action: Check that any &lt;presetdef&gt;/&lt;macrodef&gt; declarations have taken place.
      No types or tasks have been defined in this namespace yet
  
  This appears to be an antlib declaration. 
  Action: Check that the implementing library exists in one of:
      -/&lt;path-to-my-ANT_HOME&gt;/lib
      -/home/myUser/.ant/lib
      -a directory added on the command line with the -lib argument
  </code></pre>
  
  <p>When I go to ${ANT_HOME}/lib, I don't see any JARs labeled "antlib*.jar".</p>
  
  <p>So I'm <em>guessing</em> I downloaded a version of Ant that did not include Antlib, and now that I'm using Ivy (which uses Antlib), the build is choking?</p>
  
  <p>If this is an Antlib issue, then I believe I want one of the distros available <a href="http://ant.apache.org/antlibs/bindownload.cgi" rel="noreferrer">here</a>. If so, can someone confirm which one I should use (that only contains Antlib and not anything else), and confirm the process for installing it; i.e., is it just as simple as putting the correct JAR in ${ANT_HOME}/lib? Etc.</p>
  
  <p>If this is an Ivy issue, then can someone point me in the right direction as to what could be going on?</p>
  
  <p>And if this is neither Antlib nor Ivy, ditto for the question directly above. Thanks in advance!</p>