title: Create directory structures during Ant jar task
body: <p>I want to create a jar with the following directory structure:</p>
  
  <pre><code>thejar.jar/
      classes/ --&gt; where all classes go
      lib/ --&gt; where all dependencies go
      res/ --&gt; where all non-classpath resources go (scripts, etc.)
      META-INF/
  </code></pre>
  
  <p>Here's my ant task:</p>
  
  <pre><code>&lt;jar destfile="dist/main/thejar.jar"&gt;
      &lt;!-- Create the manifest --&gt;
      &lt;manifest&gt;
          &lt;!-- JAR should be sealed. --&gt;
          &lt;attribute name="Sealed" value="true" /&gt;
      &lt;/manifest&gt;
  
      &lt;!-- Copy main build directory to classes/ directory in JAR. --&gt;
      &lt;fileset dir="dist/main/classes" includes="build/main"/&gt;
  
      &lt;!-- Copy main library directory to lib/ directory in JAR. --&gt;
      &lt;fileset dir="dist/main/lib" includes="lib/main"/&gt;
  
      &lt;!-- Copy main resources directory to res/ in JAR. --&gt;
      &lt;fileset dir="dist/main/res" includes="res/main"/&gt;
  &lt;/jar&gt;
  </code></pre>
  
  <p>If I am understanding this correctly, it should be:</p>
  
  <ul>
  <li>Copying all the built (.class) files in <code>build/main</code> to <code>dist/main/classes</code></li>
  <li>Copying all <code>lib/main</code> dependencies to <code>dist/main/lib</code></li>
  <li>Copying all <code>res/main</code> files to <code>dist/main/res</code></li>
  <li>JARring up <code>dist/main/*</code> into <code>thejar.jar</code></li>
  </ul>
  
  <p>The JAR task executes without errors, but when I go to view the contents of <code>thejar.jar</code> I just see META-INF/ (none of the subdirectories I mentioned above).</p>
  
  <p>What's going on here? Thanks in advance!</p>