title: Modify Manifest.mf classpath using Ant
body: <p>I need help to modify the classpath in my JAR manifest.mf file. Here's my scenario:</p>
  
  <p>I am trying to make Netbeans build multiple JAR files for this project. I managed to create an Ant target that build the various JAR files. I used <strong><em>ant-contrib</em></strong>'s <strong><em>for</em></strong> task and Netbeans built-in <strong><em>-pre-jar</em></strong> target:</p>
  
  <pre><code>&lt;property name="multipleJar.basePackage" value="com.mycompany.myproject"/&gt;
  &lt;property name="multipleJar.baseDirectory" value="com/mycompany/myproject"/&gt;
  
  &lt;target name="-pre-jar"&gt;
      &lt;!-- Packing mutiple jars --&gt;
      &lt;dirset dir="build/classes/${multipleJar.baseDirectory}" includes="*" id="elementid"/&gt; 
      &lt;for list="${toString:elementid}" delimiter=";" param="filename"&gt; 
          &lt;sequential&gt;
              &lt;delete file="dist/multiple/lib/${multipleJar.basePackage}.@{filename}.jar"/&gt;
              &lt;jar destfile="dist/multiple/lib/${multipleJar.basePackage}.@{filename}.jar" 
                  filesetmanifest="skip"
                  basedir="build/classes/"
                  includes="**/${multipleJar.baseDirectory}/@{filename}/*"&gt;
              &lt;/jar&gt;
          &lt;/sequential&gt; 
      &lt;/for&gt;
  &lt;/target&gt;
  </code></pre>
  
  <p>The JAR generation seems OK, but now i have to modify the <strong>Manifest.mf</strong> file on the <strong>MAIN jar</strong>, so these new (dynamically generated) jar files are included in the ClassPath.</p>
  
  <p>Please Advise.</p>