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.

serverdeploy.html 11 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320
  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>ServerDeploy Task</title>
  6. </head>
  7. <body>
  8. <h1><a name="serverdeploy">ANT ServerDeploy User Manual</a></h1>
  9. <p>by</p>
  10. <!-- Names are in alphabetical order, on last name -->
  11. <ul>
  12. <li>Christopher A. Longo (<a href="mailto:cal@cloud9.net">cal@cloud9.net</a>)</li>
  13. <li>Cyrille Morvan (<a href="mailto:cmorvan@ingenosya.com">cmorvan@ingenosya.com</a>)</li>
  14. </ul>
  15. </p>
  16. <hr>
  17. <p> At present the tasks support:<br>
  18. <ul>
  19. <li><a href="http://www.bea.com" target="_top">Weblogic</a> servers</li>
  20. <li><a href="http://www.objectweb.org/jonas/" target="_top">JOnAS</a>
  21. 2.4 Open Source EJB server</li>
  22. </ul>
  23. Over time we expect further optional tasks to support additional J2EE Servers.
  24. </p>
  25. <hr>
  26. <table border="1" cellpadding="5">
  27. <tr><td>Task</td><td colspan="2">Application Servers</td></tr>
  28. <tr><td rowspan="4"><a href="#serverdeploy_element">serverdeploy</a></td><td colspan="2" align="center"><b>Nested Elements</b></td></tr>
  29. <tr><td><a href="#serverdeploy_generic">generic</a></td><td>Generic task</td></tr>
  30. <tr><td><a href="#serverdeploy_jonas">jonas</a></td><td>JOnAS 2.4</td></tr>
  31. <tr><td><a href="#serverdeploy_weblogic">weblogic</a></td><td>Weblogic</td></tr>
  32. </table>
  33. <a name="serverdeploy_element">
  34. <h2>ServerDeploy element</h2>
  35. <h3><b>Description:</b></h3>
  36. <p>The <code>serverdeploy</code> task is used to run a "hot" deployment tool for
  37. vendor-specific J2EE server. The task requires nested elements which define
  38. the attributes of the vendor-specific deployment tool being executed.
  39. Vendor-specific deployment tools elements may enforce rules for which
  40. attributes are required, depending on the tool.
  41. </p>
  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 valign="top"><b>Required</b></td>
  48. </tr>
  49. <tr>
  50. <td valign="top">action</td>
  51. <td valign="top">This is the action to be performed. For most cases this
  52. will be "deploy". Some tools support additional actions, such as "delete", "list",
  53. "undeploy", "update"...</td>
  54. <td>Yes</td>
  55. </tr>
  56. <tr>
  57. <td valign="top">source</td>
  58. <td valign="top">A fully qualified path/filename of the component to be deployed.
  59. This may be an .ear, .jar, .war, or any other type that is supported by the server.
  60. </td>
  61. <td>Tool dependent</td>
  62. </tr>
  63. </table>
  64. <h3>Nested Elements</h3>
  65. <p>The serverdeploy task supports a nested <code>classpath</code> element to set the classpath.</p>
  66. <h3>Vendor-specific nested elements</h3>
  67. <h3>Parameters used for all tools:</h3>
  68. <table border="1" cellpadding="2" cellspacing="0">
  69. <tr>
  70. <td valign="top"><b>Attribute</b></td>
  71. <td valign="top"><b>Description</b></td>
  72. <td valign="top"><b>Required</b></td>
  73. </tr>
  74. <tr>
  75. <td valign="top">classpath</td>
  76. <td valign="top">The classpath to be passed to the JVM running the tool.
  77. The classpath may also be supplied as a nested element.</td>
  78. <td>Tool dependent</td>
  79. </tr>
  80. <tr>
  81. <td valign="top">server</td>
  82. <td valign="top">The address or URL for the server where the component will be deployed.</td>
  83. <td>Tool dependent</td>
  84. </tr>
  85. <tr>
  86. <td valign="top">username</td>
  87. <td valign="top">The user with privileges to deploy applications to the server.</td>
  88. <td>Tool dependent</td>
  89. </tr>
  90. <tr>
  91. <td valign="top">password</td>
  92. <td valign="top">The password of the user with privileges to deploy applications to the server.</td>
  93. <td>Tool dependent</td>
  94. </tr>
  95. </table>
  96. <p>Also supported are nested vendor-specific elements.</p>
  97. <a name="serverdeploy_generic">
  98. <h3>Generic element</h3>
  99. This element is provided for generic Java-based deployment tools.
  100. The generic task accepts (but does not require) nested <code>arg</code>
  101. and <code>jvmarg</code> elements.
  102. A JVM will be spawned with the provided attributes. It is recommended
  103. that a vendor-specific element be used over the generic one if at all
  104. possible.
  105. <p>The following attributes are supported by the generic element.</p>
  106. <p>
  107. <table border="1" cellpadding="2" cellspacing="0">
  108. <tr>
  109. <td valign="top"><b>Attribute</b></td>
  110. <td valign="top"><b>Description</b></td>
  111. <td valign="top"><b>Required</b></td>
  112. </tr>
  113. <tr>
  114. <td valign="top">classname</td>
  115. <td valign="top">This is the fully qualified classname of the Java based
  116. deployment tool to execute.</td>
  117. <td>Yes</td>
  118. </tr>
  119. </table>
  120. </p>
  121. <h3>Nested Elements</h3>
  122. <p>The generic element supports nested <code>&lt;arg&gt;</code> and <code>&lt;jvmarg&gt;</code> elements.</p>
  123. <h3>Example</h3>
  124. <p>This example shows the use of generic deploy element to deploy a component
  125. using a Java based deploy tool:</p>
  126. <pre>
  127. &lt;serverdeploy action=&quot;deploy&quot; source=&quot;${lib.dir}/ejb_myApp.ear&quot;&gt;
  128. &lt;generic classname="com.yamato.j2ee.tools.deploy.DeployTool"
  129. classpath=&quot;${classpath}&quot;
  130. username=&quot;${user.name}&quot;
  131. password=&quot;${user.password}&quot;&gt;
  132. &lt;arg value="-component=WildStar"/&gt;
  133. &lt;arg value="-force"/&gt;
  134. &lt;jvmarg value="-ms64m"/&gt;
  135. &lt;jvmarg value="-mx128m"/&gt;
  136. &lt;/generic&gt;
  137. &lt;/serverdeploy&gt;
  138. </pre>
  139. <a name="serverdeploy_weblogic">
  140. <h3>WebLogic element</h3>
  141. <p>
  142. The WebLogic element contains additional attributes to run the
  143. <code>weblogic.deploy</code> deployment tool.
  144. <p>Valid actions for the tool are <code>deploy</code>, <code>undeploy</code>,
  145. <code>list</code>, <code>update</code>, and <code>delete</code>.
  146. <p>If the action is <code>deploy</code> or <code>update</code>,
  147. the <code>application</code> and <code>source</code> attributes must be set.
  148. If the action is <code>undeploy</code> or <code>delete</code>,
  149. the <code>application</code> attribute must be set. If the <code>username</code>
  150. attribute is omitted, it defaults to "system". The <code>password</code> attribute is
  151. required for all actions.
  152. <p>
  153. <table border="1" cellpadding="2" cellspacing="0">
  154. <tr>
  155. <td valign="top"><b>Attribute</b></td>
  156. <td valign="top"><b>Description</b></td>
  157. <td valign="top"><b>Required</b></td>
  158. </tr>
  159. <tr>
  160. <td valign="top">application</td>
  161. <td valign="top">This is the name of the application being deployed</td>
  162. <td>Yes</td>
  163. </tr>
  164. <tr>
  165. <td valign="top">component</td>
  166. <td valign="top">This is the component string for deployment targets.
  167. It is in the form <code>&lt;component&gt;:&lt;target1&gt;,&lt;target2&gt;...</code>
  168. Where component is the archive name (minus the .jar, .ear, .war
  169. extension). Targets are the servers where the components will be deployed</td>
  170. <td>no</td>
  171. </tr>
  172. <tr>
  173. <td valign="top">debug</td>
  174. <td valign="top">If set to true, additional information will be
  175. printed during the deployment process.</td>
  176. <td>No</td>
  177. </tr>
  178. </table>
  179. <h3>Examples</h3>
  180. <p>This example shows the use of serverdeploy to deploy a component to a WebLogic server:</p>
  181. <pre>
  182. &lt;serverdeploy action=&quot;deploy&quot; source=&quot;${lib.dir}/ejb_myApp.ear&quot;&gt;
  183. &lt;weblogic application=&quot;myapp&quot;
  184. server=&quot;t3://myserver:7001&quot;
  185. classpath=&quot;${weblogic.home}/lib/weblogic.jar&quot;
  186. username=&quot;${user.name}&quot;
  187. password=&quot;${user.password}&quot;
  188. component=&quot;ejb_foobar:myserver,productionserver&quot;
  189. debug=&quot;true&quot;/&gt;
  190. &lt;/serverdeploy&gt;
  191. </pre>
  192. <p>This example shows serverdeploy being used to delete a component from a
  193. WebLogic server:</p>
  194. <pre>
  195. &lt;serverdeploy action=&quot;delete&quot; source=&quot;${lib.dir}/ejb_myApp.jar&quot;/&gt
  196. &lt;weblogic application=&quot;myapp&quot;
  197. server=&quot;t3://myserver:7001&quot;
  198. classpath=&quot;${weblogic.home}/lib/weblogic.jar&quot;
  199. username=&quot;${user.name}&quot;
  200. password=&quot;${user.password}&quot;/&gt;
  201. &lt;/serverdeploy&gt;
  202. </pre>
  203. <a name="serverdeploy_jonas">
  204. <h3>JOnAS (Java Open Application Server) element</h3>
  205. <p>
  206. The JOnAS element contains additional attributes to run the
  207. <code>JonasAdmin</code> deployment tool.
  208. <p>Valid actions for the tool are <code>deploy</code>, <code>undeploy</code>,
  209. <code>list</code> and <code>update</code>.
  210. <p>You can't use <code>user</code> and <code>password</code> property with this
  211. task.
  212. <p>
  213. <table border="1" cellpadding="2" cellspacing="0">
  214. <tr>
  215. <td valign="top"><b>Attribute</b></td>
  216. <td valign="top"><b>Description</b></td>
  217. <td valign="top"><b>Required</b></td>
  218. </tr>
  219. <tr>
  220. <td valign="top">jonasroot</td>
  221. <td valign="top">The root directory for JOnAS.</td>
  222. <td>Yes</td>
  223. </tr>
  224. <tr>
  225. <td valign="top">orb</td>
  226. <td valign="top">Choose your ORB : RMI, JEREMIE, DAVID, ... If omitted, it defaults
  227. to the one present in classpath. The corresponding JOnAS JAR is
  228. automatically added to the classpath. If your orb is DAVID (RMI/IIOP) you must
  229. specify davidhost and davidport properties.</td>
  230. <td>No</td>
  231. </tr>
  232. <tr>
  233. <td valign="top">davidhost</td>
  234. <td valign="top">The value for the system property : <code>david.CosNaming.default_host</code> .</td>
  235. <td>No</td>
  236. </tr>
  237. <tr>
  238. <td valign="top">davidport</td>
  239. <td valign="top">The value for the system property : <code>david.CosNaming.default_port</code> .</td>
  240. <td>No</td>
  241. </tr>
  242. <tr>
  243. <td valign="top">classname</td>
  244. <td valign="top">This is the fully qualified classname of the Java based
  245. deployment tool to execute. Default to <code>org.objectweb.jonas.adm.JonasAdmin</code></td>
  246. <td>No</td>
  247. </tr>
  248. </table>
  249. <h3>Nested Elements</h3>
  250. <p>The jonas element supports nested <code>&lt;arg&gt;</code> and <code>&lt;jvmarg&gt;</code> elements.</p>
  251. <h3>Examples</h3>
  252. <p>This example shows the use of serverdeploy to deploy a component to a JOnAS server:</p>
  253. <pre>
  254. &lt;serverdeploy action=&quot;deploy&quot; source=&quot;${lib.dir}/ejb_myApp.jar&quot;&gt;
  255. &lt;jonas server=&quot;MyJOnAS&quot; jonasroot="${jonas.root}"&gt;
  256. &lt;classpath&gt;
  257. &lt;pathelement path=&quot;${jonas.root}/lib/RMI_jonas.jar&quot;/&gt;
  258. &lt;pathelement path=&quot;${jonas.root}/config/&quot;/&gt;
  259. &lt;/classpath&gt;
  260. &lt;/jonas&gt;
  261. &lt;/serverdeploy&gt;
  262. </pre>
  263. <p>This example shows serverdeploy being used to list the components from a
  264. JOnAS server and a WebLogic server:</p>
  265. <pre>
  266. &lt;serverdeploy action=&quot;list&quot;/&gt
  267. &lt;jonas jonasroot=&quot;${jonas.root}&quot; orb=&quot;JEREMIE&quot;/&gt;
  268. &lt;weblogic application=&quot;myapp&quot
  269. server=&quot;t3://myserver:7001&quot;
  270. classpath=&quot;${weblogic.home}/lib/weblogic.jar&quot;
  271. username=&quot;${user.name}&quot;
  272. password=&quot;${user.password}&quot;/&gt;
  273. &lt;/serverdeploy&gt;
  274. </pre>
  275. <hr>
  276. <p align="center">Copyright &copy; 2002,2004-2005 The Apache Software Foundation. All rights Reserved.</p>
  277. </body>
  278. </html>