title: How to install org.apache.tools.ant.taskdefs.optional.Rpm for ant
body: <p>I'm trying to launch:</p>
  
  <pre><code>ant rpm
  </code></pre>
  
  <p>command where my build.xml at line #126 looks like:</p>
  
  <pre><code>&lt;rpm specFile="whatever.spec" topDir="${basedir}/rpm" command="-bb" failOnError="true" /&gt;
  </code></pre>
  
  <p>I'm getting the error:</p>
  
  <pre><code>build.xml:126: Problem: failed to create task or type rpm
  Cause: the class org.apache.tools.ant.taskdefs.optional.Rpm was not found.
          This looks like one of Ant's optional components.
  Action: Check that the appropriate optional JAR exists in
          -/usr/share/ant/lib
          -/export/home/myuser/.ant/lib
          -a directory added on the command line with the -lib argument
  </code></pre>
  
  <p>I downloaded ant-nodeps-1.7.1.jar which contains:</p>
  
  <pre><code>jar tvf ant-nodeps-1.7.1.jar | grep Rpm
    7171 Fri Jun 27 05:03:48 CEST 2008 org/apache/tools/ant/taskdefs/optional/Rpm.class
  </code></pre>
  
  <p>I placed this jar file to directory: /usr/share/ant/lib</p>
  
  <pre><code>ant-1.7.0.jar -&gt; ../../java/ant-1.7.0.jar
  ant.jar -&gt; ../../java/ant.jar
  ant-launcher-1.7.0.jar -&gt; ../../java/ant-launcher-1.7.0.jar
  ant-launcher.jar -&gt; ../../java/ant-launcher.jar
  ant-nodeps-1.7.1.jar
  </code></pre>
  
  <p>but still getting that build error.
  I tried also with commands:</p>
  
  <pre><code>ant -lib /usr/share/ant/lib rpm
  ant -lib /usr/share/ant/lib/ant-nodeps-1.7.1.jar rpm
  ant -lib ant-nodeps-1.7.1.jar rpm
  </code></pre>
  
  <p>whithout succes, getting the same error.
  What is missing, what I need to do ?</p>
  
  <p>Thanks !</p>