title: How do I convert an Ant Path into a FileSet?
body: <p>I'm writing an Ant script to package a project into a WAR file. The software consists of several projects with their own source directories, libraries, etc.</p>
  
  <p>The WAR task has a nested element <code>lib</code> which I'm currently working on. I currently have a reference of the required libs as a <code>Path</code> (containing several <code>FileSets</code>, which I use in a classpath reference. The <code>lib</code>, however, wants the input to be a <code>FileSet</code>, and it refuses a <code>Path</code>.</p>
  
  <p>I tried converting my <code>Path</code> into a <code>FileSet</code>, but then I didn't get it to work as a classpath elsewhere.</p>
  
  <p>Is there a way to convert a <code>Path</code> into a <code>FileSet</code>? I would hate to copy-paste the directories.</p>
  
  <pre><code>&lt;path id="compile.libs"&gt;
      &lt;fileset dir="${common.path}/lib" includes="*.jar"/&gt;
      &lt;fileset dir="${data.path}/lib" includes="*.jar"/&gt;
      &lt;fileset dir="${gui.path}/lib" includes="*.jar"/&gt;
      &lt;fileset dir="${gui.path}/WebContent/WEB-INF/lib" includes="*.jar"/&gt;
  &lt;/path&gt;
  </code></pre>
  
  <p>...when used with <code>&lt;war ..&gt;&lt;../&gt; &lt;lib refid="compile.libs"/&gt; &lt;/war&gt;</code> leads to:</p>
  
  <pre>
  BUILD FAILED
  build.xml:173: compile.libs doesn't denote a zipfileset or a fileset
  </pre>