source: release-kits/lirk3/bin/ant-installer/web/manual/manual/CoreTasks/ear.html@ 14982

Last change on this file since 14982 was 14982, checked in by oranfry, 16 years ago

initial import of LiRK3

File size: 7.3 KB
Line 
1<!--
2 Licensed to the Apache Software Foundation (ASF) under one or more
3 contributor license agreements. See the NOTICE file distributed with
4 this work for additional information regarding copyright ownership.
5 The ASF licenses this file to You under the Apache License, Version 2.0
6 (the "License"); you may not use this file except in compliance with
7 the License. You may obtain a copy of the License at
8
9 http://www.apache.org/licenses/LICENSE-2.0
10
11 Unless required by applicable law or agreed to in writing, software
12 distributed under the License is distributed on an "AS IS" BASIS,
13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 See the License for the specific language governing permissions and
15 limitations under the License.
16-->
17<html>
18
19<head>
20<meta http-equiv="Content-Language" content="en-us">
21<link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
22<title>EAR Task</title>
23</head>
24
25<body>
26
27<h2><a name="ear">Ear</a></h2>
28<h3>Description</h3>
29<p>An extension of the <a href="jar.html">Jar</a> task with special
30treatment for files that should end up in an Enterprise Application archive.</p>
31<p>(The Ear task is a shortcut for specifying the particular layout of a EAR file.
32The same thing can be accomplished by using the <i>prefix</i> and <i>fullpath</i>
33attributes of zipfilesets in a Zip or Jar task.)</p>
34<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>
35
36<p><b>Please note that the zip format allows multiple files of the same
37fully-qualified name to exist within a single archive. This has been
38documented as causing various problems for unsuspecting users. If you wish
39to avoid this behavior you must set the <code>duplicate</code> attribute
40to a value other than its default, <code>&quot;add&quot;</code>.</b></p>
41
42<h3>Parameters</h3>
43<table border="1" cellpadding="2" cellspacing="0">
44 <tr>
45 <td valign="top"><b>Attribute</b></td>
46 <td valign="top"><b>Description</b></td>
47 <td align="center" valign="top"><b>Required</b></td>
48 </tr>
49 <tr>
50 <td valign="top">destfile</td>
51 <td valign="top">the EAR file to create.</td>
52 <td valign="top" align="center">Yes</td>
53 </tr>
54 <tr>
55 <td valign="top">appxml</td>
56 <td valign="top">The deployment descriptor to use (META-INF/application.xml).</td>
57 <td valign="top" align="center">Yes, unless update is set to true</td>
58 </tr>
59 <tr>
60 <td valign="top">basedir</td>
61 <td valign="top">the directory from which to jar the files.</td>
62 <td valign="top" align="center">No</td>
63 </tr>
64 <tr>
65 <td valign="top">compress</td>
66 <td valign="top">Not only store data but also compress them,
67 defaults to true. Unless you set the <em>keepcompression</em>
68 attribute to false, this will apply to the entire archive, not
69 only the files you've added while updating.</td>
70 <td align="center" valign="top">No</td>
71 </tr>
72 <tr>
73 <td valign="top">keepcompression</td>
74 <td valign="top">For entries coming from existing archives (like
75 nested <em>zipfileset</em>s or while updating the archive), keep
76 the compression as it has been originally instead of using the
77 <em>compress</em> attribute. Defaults false. <em>Since Ant
78 1.6</em></td>
79 <td align="center" valign="top">No</td>
80 </tr>
81 <tr>
82 <td valign="top">encoding</td>
83 <td valign="top">The character encoding to use for filenames
84 inside the archive. Defaults to UTF8. <strong>It is not
85 recommended to change this value as the created archive will most
86 likely be unreadable for Java otherwise.</strong></td>
87 <td align="center" valign="top">No</td>
88 </tr>
89 <tr>
90 <td valign="top">filesonly</td>
91 <td valign="top">Store only file entries, defaults to false</td>
92 <td align="center" valign="top">No</td>
93 </tr>
94 <tr>
95 <td valign="top">includes</td>
96 <td valign="top">comma- or space-separated list of patterns of files that must be
97 included. All files are included when omitted.</td>
98 <td valign="top" align="center">No</td>
99 </tr>
100 <tr>
101 <td valign="top">includesfile</td>
102 <td valign="top">the name of a file. Each line of this file is
103 taken to be an include pattern</td>
104 <td valign="top" align="center">No</td>
105 </tr>
106 <tr>
107 <td valign="top">excludes</td>
108 <td valign="top">comma- or space-separated list of patterns of files that must be
109 excluded. No files (except default excludes) are excluded when omitted.</td>
110 <td valign="top" align="center">No</td>
111 </tr>
112 <tr>
113 <td valign="top">excludesfile</td>
114 <td valign="top">the name of a file. Each line of this file is
115 taken to be an exclude pattern</td>
116 <td valign="top" align="center">No</td>
117 </tr>
118 <tr>
119 <td valign="top">defaultexcludes</td>
120 <td valign="top">indicates whether default excludes should be used or not
121 (&quot;yes&quot;/&quot;no&quot;). Default excludes are used when omitted.</td>
122 <td valign="top" align="center">No</td>
123 </tr>
124 <tr>
125 <td valign="top">manifest</td>
126 <td valign="top">the manifest file to use.</td>
127 <td valign="top" align="center">No</td>
128 </tr>
129 <tr>
130 <td valign="top">update</td>
131 <td valign="top">indicates whether to update or overwrite
132 the destination file if it already exists. Default is &quot;false&quot;.</td>
133 <td valign="top" align="center">No</td>
134 </tr>
135 <tr>
136 <td valign="top">duplicate</td>
137 <td valign="top">behavior when a duplicate file is found. Valid values are &quot;add&quot;, &quot;preserve&quot;, and &quot;fail&quot;. The default value is &quot;add&quot;. </td>
138 <td valign="top" align="center">No</td>
139 </tr>
140 <tr>
141 <td valign="top">roundup</td>
142 <td valign="top">Whether the file modification times will be
143 rounded up to the next even number of seconds.<br>
144 Zip archives store file modification times with a granularity of
145 two seconds, so the times will either be rounded up or down. If
146 you round down, the archive will always seem out-of-date when you
147 rerun the task, so the default is to round up. Rounding up may
148 lead to a different type of problems like JSPs inside a web
149 archive that seem to be slightly more recent than precompiled
150 pages, rendering precompilation useless.<br>
151 Defaults to true. <em>Since Ant 1.6.2</em></td>
152 <td align="center" valign="top">No</td>
153 </tr>
154 <tr>
155 <td valign="top">level</td>
156 <td valign="top">Non-default level at which file compression should be
157 performed. Valid values range from 0 (no compression/fastest) to 9
158 (maximum compression/slowest). <em>Since Ant 1.7</em></td>
159 <td valign="top" align="center">No</td>
160 </tr>
161</table>
162<h3>Nested elements</h3>
163<h4>metainf</h4>
164<p>The nested <code>metainf</code> element specifies a <a
165href="../CoreTypes/fileset.html">FileSet</a>. All files included in this fileset will
166end up in the <code>META-INF</code> directory of the ear file. If this
167fileset includes a file named <code>MANIFEST.MF</code>, the file is
168ignored and you will get a warning.</p>
169<h2>Example</h2>
170<pre>
171 &lt;ear destfile=&quot;${build.dir}/myapp.ear&quot; appxml=&quot;${src.dir}/metadata/application.xml&quot;&gt;
172 &lt;fileset dir=&quot;${build.dir}&quot; includes=&quot;*.jar,*.war&quot;/&gt;
173 &lt;/ear&gt;
174</pre>
175
176
177</body>
178</html>
179
180
Note: See TracBrowser for help on using the repository browser.