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.2 KiB

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