using ANT to package the Web app directory with the executable jar
<p>I am working on an open source project that uses ANT which can perform all kind of useful targets. 
One of them generate an executable jar and a <code>webapp</code> directory in the same directory. I tried to find ways to package that <code>webapp</code> directory with the jar, there is tons of information out there but non of them provide a example that fits my problem.</p>

<p>Open Refine is a great data cleansing tool, you can start it using a script that takes different start up arguments. 
It is built using jetty Web server and Web app for UI. <a href="https://github.com/OpenRefine/OpenRefine/wiki/Documentation-For-Developers" rel="nofollow">Architecture here</a>. 
It uses ANT for deployment management, where there is a task that create the Linux kit:</p>

<pre><code>&lt;target name="linux" depends="jar, prepare_webapp"&gt;
    &lt;mkdir dir="${linux.dir}"/&gt;

    &lt;copy todir="${linux.dir}/server/lib"&gt;
        &lt;fileset dir="${server.lib.dir}"&gt;
            &lt;include name="**/*.jar"/&gt;
        &lt;/fileset&gt;
    &lt;/copy&gt;

    &lt;copy file="${build.dir}/${fullname}-server.jar" tofile="${linux.dir}/server/lib/${fullname}-server.jar"/&gt;

    &lt;copy todir="${linux.dir}/webapp"&gt;
        &lt;fileset dir="${built.webapp.dir}"&gt;
            &lt;include name="**"/&gt;
        &lt;/fileset&gt;
    &lt;/copy&gt;

    &lt;mkdir dir="${linux.dir}/licenses"/&gt;
    &lt;fixcrlf srcDir="${basedir}/licenses" destDir="${linux.dir}/licenses" eol="lf"/&gt;

    &lt;fixcrlf srcDir="${basedir}" destDir="${linux.dir}" eol="lf"&gt;
        &lt;include name="refine"/&gt;
        &lt;include name="refine.ini"/&gt;
        &lt;include name="README.txt"/&gt;
        &lt;include name="LICENSE.txt"/&gt;
    &lt;/fixcrlf&gt;

    &lt;mkdir dir="${dist.dir}"/&gt;
    &lt;tar longfile="gnu" compression="gzip" destfile="${dist.dir}/openrefine-linux-${version}.tar.gz"&gt;
       &lt;tarfileset dir="${linux.dir}/.." filemode="755"&gt;
           &lt;include name="${release.name}/refine"/&gt;
       &lt;/tarfileset&gt;        
       &lt;tarfileset dir="${linux.dir}/.."&gt;
           &lt;include name="${release.name}/**"/&gt;
           &lt;exclude name="${release.name}/refine"/&gt;
       &lt;/tarfileset&gt;        
    &lt;/tar&gt;
&lt;/target&gt;
</code></pre>

<p>This task creates a web directory, which is used in the previous task:</p>

<pre><code>&lt;target name="prepare_webapp" depends="jar_webapp, build"&gt;
    &lt;mkdir dir="${built.webapp.dir}" /&gt;

    &lt;copy todir="${built.webapp.dir}"&gt;
        &lt;fileset dir="${webapp.dir}"&gt;
            &lt;include name="**/*"/&gt;
            &lt;exclude name="WEB-INF/classes/**"/&gt;
            &lt;exclude name="WEB-INF/lib-src/**"/&gt;
            &lt;exclude name="WEB-INF/lib/icu4j*.jar"/&gt;
        &lt;/fileset&gt;
    &lt;/copy&gt;
</code></pre>

<p>and the Jar are prepared using another ANT target as following:</p>

<pre><code>&lt;target name="jar_webapp" depends="prepare_jar, build_webapp"&gt;
    &lt;jar destfile="${build.dir}/${fullname}.jar" basedir="${webapp.classes.dir}"/&gt;
&lt;/target&gt;
</code></pre>

<p>The result of running <code>ant linux</code> is an executable jar and a webapp directory, Is it possible to package the entire thing as one fat jar? </p>