git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@268915 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -36,6 +36,9 @@ Other changes: | |||||
| * <sql> now supports REM comments as well as // and -- | * <sql> now supports REM comments as well as // and -- | ||||
| * <jar> now has a nested <metainf> element following the same idea as | |||||
| <war>'s <webinf>. | |||||
| Fixed bugs: | Fixed bugs: | ||||
| ----------- | ----------- | ||||
| @@ -14,7 +14,7 @@ treatment for files that should end up in an Enterprise Application archive.</p> | |||||
| <p>(The Ear task is a shortcut for specifying the particular layout of a EAR file. | <p>(The Ear task is a shortcut for specifying the particular layout of a EAR file. | ||||
| The same thing can be accomplished by using the <i>prefix</i> and <i>fullpath</i> | The same thing can be accomplished by using the <i>prefix</i> and <i>fullpath</i> | ||||
| attributes of zipfilesets in a Zip or Jar task.)</p> | attributes of zipfilesets in a Zip or Jar task.)</p> | ||||
| <p>The extended zipfileset element from the zip task (with attributes <i>prefix</i>, <i>fullpath</i>, and <i>src</i>) is available in the War task.</p> | |||||
| <p>The extended zipfileset element from the zip task (with attributes <i>prefix</i>, <i>fullpath</i>, and <i>src</i>) is available in the Ear task.</p> | |||||
| <h3>Parameters</h3> | <h3>Parameters</h3> | ||||
| <table border="1" cellpadding="2" cellspacing="0"> | <table border="1" cellpadding="2" cellspacing="0"> | ||||
| @@ -84,6 +84,13 @@ attributes of zipfilesets in a Zip or Jar task.)</p> | |||||
| <td valign="top" align="center">No</td> | <td valign="top" align="center">No</td> | ||||
| </tr> | </tr> | ||||
| </table> | </table> | ||||
| <h3>Nested elements</h3> | |||||
| <h4>metainf</h4> | |||||
| <p>The nested <code>metainf</code> element specifies a <a | |||||
| href="../CoreTypes/fileset.html">FileSet</a>. All files included in this fileset will | |||||
| end up in the <code>META-INF</code> directory of the ear file. If this | |||||
| fileset includes a file named <code>MANIFEST.MF</code>, the file is | |||||
| ignored and you will get a warning.</p> | |||||
| <h2>Example</h2> | <h2>Example</h2> | ||||
| <pre> | <pre> | ||||
| <ear earfile="${build.dir}/myapp.ear" appxml="${src.dir}/metadata/application.xml"> | <ear earfile="${build.dir}/myapp.ear" appxml="${src.dir}/metadata/application.xml"> | ||||
| @@ -106,6 +106,13 @@ include an empty one for you.)</p> | |||||
| <td valign="top" align="center">No</td> | <td valign="top" align="center">No</td> | ||||
| </tr> | </tr> | ||||
| </table> | </table> | ||||
| <h3>Nested elements</h3> | |||||
| <h4>metainf</h4> | |||||
| <p>The nested <code>metainf</code> element specifies a <a | |||||
| href="../CoreTypes/fileset.html">FileSet</a>. All files included in this fileset will | |||||
| end up in the <code>META-INF</code> directory of the jar file. If this | |||||
| fileset includes a file named <code>MANIFEST.MF</code>, the file is | |||||
| ignored and you will get a warning.</p> | |||||
| <h3>Examples</h3> | <h3>Examples</h3> | ||||
| <pre> <jar jarfile="${dist}/lib/app.jar" basedir="${build}/classes"/></pre> | <pre> <jar jarfile="${dist}/lib/app.jar" basedir="${build}/classes"/></pre> | ||||
| <p>jars all files in the <code>${build}/classes</code> directory into a file | <p>jars all files in the <code>${build}/classes</code> directory into a file | ||||
| @@ -101,6 +101,12 @@ href="../CoreTypes/fileset.html">FileSet</a>. All files included in this fileset | |||||
| end up in the <code>WEB-INF</code> directory of the war file. If this | end up in the <code>WEB-INF</code> directory of the war file. If this | ||||
| fileset includes a file named <code>web.xml</code>, the file is | fileset includes a file named <code>web.xml</code>, the file is | ||||
| ignored and you will get a warning.</p> | ignored and you will get a warning.</p> | ||||
| <h4>metainf</h4> | |||||
| <p>The nested <code>metainf</code> element specifies a <a | |||||
| href="../CoreTypes/fileset.html">FileSet</a>. All files included in this fileset will | |||||
| end up in the <code>META-INF</code> directory of the war file. If this | |||||
| fileset includes a file named <code>MANIFEST.MF</code>, the file is | |||||
| ignored and you will get a warning.</p> | |||||
| <h3>Examples</h3> | <h3>Examples</h3> | ||||
| <p>Assume the following structure in the project's base directory:</p> | <p>Assume the following structure in the project's base directory:</p> | ||||
| <pre> | <pre> | ||||
| @@ -94,6 +94,11 @@ public class Jar extends Zip { | |||||
| super.addFileset(fs); | super.addFileset(fs); | ||||
| } | } | ||||
| public void addMetainf(ZipFileSet fs) { | |||||
| // We just set the prefix for this fileset, and pass it up. | |||||
| fs.setPrefix("META-INF/"); | |||||
| super.addFileset(fs); | |||||
| } | |||||
| protected void initZipOutputStream(ZipOutputStream zOut) | protected void initZipOutputStream(ZipOutputStream zOut) | ||||
| throws IOException, BuildException | throws IOException, BuildException | ||||