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

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