title: ANT error: failed to create task or type antlib:com.salesforce:deploy
body: <p>I've started to play with the Force.com Migration Tool. I want to use it from an ANT build file. I've created this one:</p>
  
  <pre><code>&lt;project name="Subversion to Org" default="deploy" basedir="." xmlns:sf="antlib:com.salesforce"&gt;
      &lt;target name="deploy"&gt;
          &lt;echo message="deploying from metadata" /&gt;
          &lt;echo message="ANT_HOME=${ant.home}"/&gt;
          &lt;echo message="BASEDIR=${basedir}"/&gt;
          &lt;echo message="ANT_CORE_LIB=${ant.core.lib}"/&gt;
          &lt;echo message="JAVA_VERSION=${ant.java.version}"/&gt;
          &lt;echo message="ANT_LIBRARY_DIR=${ant.library.dir}"/&gt;
          &lt;echo message="classpath=${java.class.path}"/&gt;
          &lt;sf:deploy username="${properties.username}"
                          password="${properties.password}"
                          serverurl="${properties.url}"
                          deployroot="${properties.root}"
                          singlePackage="${properties.singlePackage}"
                          runAllTests="${properties.allTest}" /&gt;
          &lt;/target&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>I've copied the ant-salesforce.jar in ant.lib folder. When I execute this file throught ANT  I get this:</p>
  
  <pre><code>     Buildfile: build.xml
  
  deploy:
       [echo] deploying from metadata
       [echo] ANT_HOME=/usr/share/ant
       [echo] BASEDIR=/usr/share/tomcat6/.jenkins/jobs/Salesforce Deploy Test/workspace/deploy script
       [echo] ANT_CORE_LIB=/usr/share/java/ant-1.7.1.jar
       [echo] JAVA_VERSION=1.6
       [echo] ANT_LIBRARY_DIR=/usr/share/ant/lib
       [echo] classpath=/usr/share/java/ant.jar:/usr/share/java/ant-launcher.jar:/usr/share/java/jaxp_parser_impl.jar:/usr/share/java/xml-commons-apis.jar:/usr/lib/jvm/java/lib/tools.jar:/usr/share/ant/lib/ant.jar:/usr/share/ant/lib/ant-launcher.jar:/usr/share/ant/lib/ant-salesforce.jar:/usr/share/ant/lib/ant-bootstrap.jar
  
  BUILD FAILED
  /usr/share/tomcat6/.jenkins/jobs/Salesforce Deploy Test/workspace/deploy script/build.xml:16: Problem: failed to create task or type antlib:com.salesforce:deploy
  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:
          -/usr/share/ant/lib
          -/root/.ant/lib
          -a directory added on the command line with the -lib argument
  
  
  Total time: 0 seconds
  </code></pre>
  
  <p>It seems that ant-salesforce.jar file it isn't found, but it appears listed in the output. Any ideas?</p>
  
  <p>More info:</p>
  
  <p>Permissions check</p>
  
  <pre><code>ls -al /usr/share/ant/lib
  total 3412
  drwxr-xr-x. 2 root root    4096 feb 12 15:36 .
  drwxr-xr-x. 4 root root    4096 feb 12 09:49 ..
  lrwxrwxrwx. 1 root root      28 feb 12 09:49 ant-bootstrap.jar -&gt; ../../java/ant-bootstrap.jar
  lrwxrwxrwx. 1 root root      18 feb 12 09:49 ant.jar -&gt; ../../java/ant.jar
  lrwxrwxrwx. 1 root root      27 feb 12 09:49 ant-launcher.jar -&gt; ../../java/ant-launcher.jar
  -rwxrwxrwx. 1 root root 3483648 feb 12 12:58 ant-salesforce.jar
  </code></pre>
  
  <p>Jar contents check:</p>
  
  <pre><code>...
  com/salesforce/ant/BulkRetrieveTask.class
  com/salesforce/ant/CompileAndTest$CodeNameElement.class
  com/salesforce/ant/CompileAndTest$RunTestsElement.class
  com/salesforce/ant/CompileAndTest.class
  com/salesforce/ant/Configuration.class
  com/salesforce/ant/ConnectionFactory.class
  com/salesforce/ant/DeployTask$CodeNameElement.class
  com/salesforce/ant/DeployTask.class
  com/salesforce/ant/DescribeMetadataTask.class
  com/salesforce/ant/ListMetadataTask.class
  com/salesforce/ant/RetrieveTask$PackageManifestParser.class
  com/salesforce/ant/RetrieveTask.class
  com/salesforce/ant/SFDCAntTask.class
  com/salesforce/ant/SFDCMDAPIAntTask.class
  com/salesforce/ant/SFDCMDAPIAntTaskRunner.class
  com/salesforce/ant/ZipUtil.class
  com/salesforce/antlib.xml
  ...
  </code></pre>
  
  <p>antlib File contents (as expected):</p>
  
  <pre><code>&lt;antlib&gt;
      &lt;typedef name="compileAndTest" classname="com.salesforce.ant.CompileAndTest"/&gt;
      &lt;typedef name="deploy" classname="com.salesforce.ant.DeployTask"/&gt;
      &lt;typedef name="retrieve" classname="com.salesforce.ant.RetrieveTask"/&gt;
      &lt;typedef name="bulkRetrieve" classname="com.salesforce.ant.BulkRetrieveTask"/&gt;
      &lt;typedef name="listMetadata" classname="com.salesforce.ant.ListMetadataTask"/&gt;
      &lt;typedef name="describeMetadata" classname="com.salesforce.ant.DescribeMetadataTask"/&gt;
  &lt;/antlib&gt;
  </code></pre>
  
  <p>Thanks in advance.</p>