Browse Source

Add a <metainf> element to <jar>

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@268915 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 24 years ago
parent
commit
c22df87cd8
5 changed files with 29 additions and 1 deletions
  1. +3
    -0
      WHATSNEW
  2. +8
    -1
      docs/manual/CoreTasks/ear.html
  3. +7
    -0
      docs/manual/CoreTasks/jar.html
  4. +6
    -0
      docs/manual/CoreTasks/war.html
  5. +5
    -0
      src/main/org/apache/tools/ant/taskdefs/Jar.java

+ 3
- 0
WHATSNEW View File

@@ -36,6 +36,9 @@ Other changes:

* <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:
-----------



+ 8
- 1
docs/manual/CoreTasks/ear.html View File

@@ -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.
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>
<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>
<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>
</tr>
</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>
<pre>
&lt;ear earfile="${build.dir}/myapp.ear" appxml="${src.dir}/metadata/application.xml"&gt;


+ 7
- 0
docs/manual/CoreTasks/jar.html View File

@@ -106,6 +106,13 @@ include an empty one for you.)</p>
<td valign="top" align="center">No</td>
</tr>
</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>
<pre> &lt;jar jarfile=&quot;${dist}/lib/app.jar&quot; basedir=&quot;${build}/classes&quot;/&gt;</pre>
<p>jars all files in the <code>${build}/classes</code> directory into a file


+ 6
- 0
docs/manual/CoreTasks/war.html View 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
fileset includes a file named <code>web.xml</code>, the file is
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>
<p>Assume the following structure in the project's base directory:</p>
<pre>


+ 5
- 0
src/main/org/apache/tools/ant/taskdefs/Jar.java View File

@@ -94,6 +94,11 @@ public class Jar extends Zip {
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)
throws IOException, BuildException


Loading…
Cancel
Save