Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you don't want to (or can't readily) list each file individually, one solution is to use the Zip task, which allows a nested <code>&lt;mappedresources&gt;</code> (Ant 1.8.0+). Once the Zip task completes, you can use the Jar task to add/update the manifest and/or add an index.</p> <p>Suppose, for example, that in addition to wanting</p> <pre> yay_my.jar boo_my.jar foo_my.jar bar_my.jar </pre> <p>in the output JAR, you also have a directory <code>stuff/</code>, containing some files and subdirectories. If you want the contents of <code>stuff/</code> included in the JAR, but you want <code>stuff/subdir/*</code> to be added as <code>other_subdir/*</code>, consider the following:</p> <pre><code>&lt;zip destfile="newjar.jar"&gt; &lt;zipfileset dir="yay" includes="my.jar" fullpath="yay_my.jar"/&gt; &lt;zipfileset dir="boo" includes="my.jar" fullpath="boo_my.jar"/&gt; &lt;!-- etc. --&gt; &lt;mappedresources&gt; &lt;fileset dir="stuff"/&gt; &lt;compositemapper&gt; &lt;globmapper from="subdir/*" to="other_subdir/*"/&gt; &lt;identitymapper/&gt; &lt;/compositemapper&gt; &lt;/mappedresources&gt; &lt;/zip&gt; &lt;!-- Update the newly-created ZIP in-place to add a basic manifest --&gt; &lt;jar destfile="newjar.jar" update="true"/&gt; </code></pre> <p>I tested this build file and it works with Ant 1.8.2. However, if after changing it Ant begins throwing a <code>NullPointerException</code>, see <a href="https://issues.apache.org/bugzilla/show_bug.cgi?id=54026" rel="nofollow">Bug 54026</a>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload