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 6.6 KiB

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