title: Why cannot Ant taskdef cannot load a resource outside ./net
body: <p>When declaring external ant tasks using taskdef, for instance ant-contrib, the proposed setup is to use the followin taskdef:</p>
  
  <pre><code>&lt;taskdef resource="net/sf/antcontrib/antcontrib.properties"&gt;
    &lt;classpath&gt;
      &lt;pathelement location="lib/ant-contrib/ant-contrib-1.0b3.jar"/&gt;
    &lt;/classpath&gt;
  &lt;/taskdef&gt;
  </code></pre>
  
  <p>This works when antcontrib.properties is located in net/sf/antcontrib relative to the build.xml file.</p>
  
  <p>But when I put it in lib/net/sf/antcontrib and changes the taskdef into</p>
  
  <pre><code>&lt;taskdef resource="lib/net/sf/antcontrib/antcontrib.properties"&gt;
    &lt;classpath&gt;
      &lt;pathelement location="lib/ant-contrib/ant-contrib-1.0b3.jar"/&gt;
    &lt;/classpath&gt;
  &lt;/taskdef&gt;
  </code></pre>
  
  <p>Ant is not able to find the properties file, it gives the error</p>
  
  <pre><code>[taskdef] Could not load definitions from resource
  lib/net/sf/antcontrib/antcontrib.properties. It could not be found.
  </code></pre>
  
  <p>It seems like ant treats the lib directory separately and fails to load a taskdef resource from there.</p>