Browse Source

the zipfileset example is simply wrong

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@987373 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 15 years ago
parent
commit
7119b3f030
1 changed files with 22 additions and 4 deletions
  1. +22
    -4
      docs/manual/Tasks/jar.html

+ 22
- 4
docs/manual/Tasks/jar.html View File

@@ -468,13 +468,31 @@ and <code>${src}/resources/mypackage/image.gif</code>, they will appear
in the same directory in the JAR (and thus be considered in the same package in the same directory in the JAR (and thus be considered in the same package
by Java).</p> by Java).</p>


<h4>Using zipfileset</h4>
<h4>Merging archives</h4>


<blockquote><pre> &lt;jar destfile="build/main/checksites.jar"&gt; <blockquote><pre> &lt;jar destfile="build/main/checksites.jar"&gt;
&lt;fileset dir="build/main/classes"/&gt; &lt;fileset dir="build/main/classes"/&gt;
&lt;zipfileset includes="**/*.class"&gt;
&lt;fileset dir="lib/main" includes="**/*.jar"/&gt;
&lt;/zipfileset&gt;
&lt;zipfileset includes="**/*.class" src="lib/main/some.jar"/&gt;
&lt;manifest&gt;
&lt;attribute name="Main-Class"
value="com.acme.checksites.Main"/&gt;
&lt;/manifest&gt;
&lt;/jar&gt;</pre></blockquote>
<p>
Creates an executable jar file with a main class "com.acme.checksites.Main", and
embeds all the classes from the jar <code>lib/main/some.jar</code>.
</p>

<blockquote><pre> &lt;jar destfile="build/main/checksites.jar"&gt;
&lt;fileset dir="build/main/classes"/&gt;
&lt;restrict&gt;
&lt;name name="**/*.class"/&gt;
&lt;archives&gt;
&lt;zips&gt;
&lt;fileset dir="lib/main" includes="**/*.jar"/&gt;
&lt;/zips&gt;
&lt;/archives&gt;
&lt;/restrict&gt;
&lt;manifest&gt; &lt;manifest&gt;
&lt;attribute name="Main-Class" &lt;attribute name="Main-Class"
value="com.acme.checksites.Main"/&gt; value="com.acme.checksites.Main"/&gt;


Loading…
Cancel
Save