You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

ear.html 7.3 KiB

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