You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bo...@apache.org on 2010/08/20 05:42:43 UTC
svn commit: r987373 - /ant/core/trunk/docs/manual/Tasks/jar.html
Author: bodewig
Date: Fri Aug 20 03:42:43 2010
New Revision: 987373
URL: http://svn.apache.org/viewvc?rev=987373&view=rev
Log:
the zipfileset example is simply wrong
Modified:
ant/core/trunk/docs/manual/Tasks/jar.html
Modified: ant/core/trunk/docs/manual/Tasks/jar.html
URL: http://svn.apache.org/viewvc/ant/core/trunk/docs/manual/Tasks/jar.html?rev=987373&r1=987372&r2=987373&view=diff
==============================================================================
--- ant/core/trunk/docs/manual/Tasks/jar.html (original)
+++ ant/core/trunk/docs/manual/Tasks/jar.html Fri Aug 20 03:42:43 2010
@@ -468,13 +468,31 @@ and <code>${src}/resources/mypackage/ima
in the same directory in the JAR (and thus be considered in the same package
by Java).</p>
-<h4>Using zipfileset</h4>
+<h4>Merging archives</h4>
<blockquote><pre> <jar destfile="build/main/checksites.jar">
<fileset dir="build/main/classes"/>
- <zipfileset includes="**/*.class">
- <fileset dir="lib/main" includes="**/*.jar"/>
- </zipfileset>
+ <zipfileset includes="**/*.class" src="lib/main/some.jar"/>
+ <manifest>
+ <attribute name="Main-Class"
+ value="com.acme.checksites.Main"/>
+ </manifest>
+ </jar></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> <jar destfile="build/main/checksites.jar">
+ <fileset dir="build/main/classes"/>
+ <restrict>
+ <name name="**/*.class"/>
+ <archives>
+ <zips>
+ <fileset dir="lib/main" includes="**/*.jar"/>
+ </zips>
+ </archives>
+ </restrict>
<manifest>
<attribute name="Main-Class"
value="com.acme.checksites.Main"/>