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