Applied James CE Johnson's patch to add deploy/undeploy targets for jar/war/ear using JBoss' jmx console. Thanks James!

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@113337 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
vmassol 2003-04-13 10:24:12 +00:00
parent 39d24d840d
commit 6da0e91f22
4 changed files with 136 additions and 1 deletions

View File

@ -6,7 +6,10 @@
packaging and deploying applications.
=============================================================================
-->
<project xmlns:j="jelly:core">
<project
xmlns:j="jelly:core"
xmlns:jmx="jmx"
xmlns:define="jelly:define">
<!--
========================================================================
@ -168,4 +171,77 @@
</goal>
<!--
========================================================================
Various deploy/undeploy goals
========================================================================
-->
<goal name="jboss:deploy-exploded-warfile" prereqs="war:webapp"
description="Invoke the 'war:webapp' goal and deploy the result. Note that 'maven.war.webapp.dir' *must* end with '.war' for this to work correctly.">
<jmx:deploy jmx.deploy.file='${context.getVariable("maven.war.webapp.dir")}'/>
</goal>
<goal name="jboss:undeploy-exploded-warfile"
description="Undeploy the result of the 'war:webapp' goal. Note that 'maven.war.webapp.dir' *must* end with '.war' for this to work correctly.">
<jmx:undeploy jmx.deploy.file='${context.getVariable("maven.war.webapp.dir")}'/>
</goal>
<goal name="jboss:deploy-warfile" prereqs="war:war"
description="Invoke the 'war' goal and deploy the result">
<jmx:deploy jmx.deploy.file='${maven.build.dir}/${maven.war.final.name}'/>
</goal>
<goal name="jboss:undeploy-warfile" prereqs="war:init"
description="Undeploy the result of the 'war' goal">
<jmx:undeploy jmx.deploy.file='${maven.build.dir}/${maven.war.final.name}'/>
</goal>
<!-- Once maven has a goal that will build a jarfile of EJBs, this should
list it as a prereq -->
<goal name="jboss:deploy-ejb"
description="Deploy ${maven.final.name}.jar">
<jmx:deploy jmx.deploy.file='${maven.build.dir}/${maven.final.name}.jar'/>
</goal>
<goal name="jboss:undeploy-ejb"
description="Undeploy ${maven.final.name}.jar">
<jmx:undeploy jmx.deploy.file='${maven.build.dir}/${maven.final.name}.jar'/>
</goal>
<!-- Once maven has a goal that will build an earfile of EJBs, this should
list it as a prereq -->
<goal name="jboss:deploy-ear"
description="Deploy ${maven.final.name}.ear">
<jmx:deploy jmx.deploy.file='${maven.build.dir}/${maven.final.name}.ear'/>
</goal>
<goal name="jboss:undeploy-ear"
description="Undeploy ${maven.final.name}.ear">
<jmx:undeploy jmx.deploy.file='${maven.build.dir}/${maven.final.name}.ear'/>
</goal>
<!--
========================================================================
JMX tags to deploy and undeploy "things"
========================================================================
-->
<define:taglib uri="jmx">
<define:tag name="deploy">
<j:set var="maven.jboss.jmx.url.undeploy"
value='${pom.getPluginContext("maven-jboss-plugin").getVariable("maven.jboss.jmx.url.undeploy")}'/>
<get dest="deploy.log"
src="${maven.jboss.jmx.url.undeploy}file:${jmx.deploy.file}"/>
<j:set var="maven.jboss.jmx.url.deploy"
value='${pom.getPluginContext("maven-jboss-plugin").getVariable("maven.jboss.jmx.url.deploy")}'/>
<get dest="deploy.log"
src="${maven.jboss.jmx.url.deploy}file:${jmx.deploy.file}"/>
</define:tag>
<define:tag name="undeploy">
<j:set var="maven.jboss.jmx.url.undeploy"
value='${pom.getPluginContext("maven-jboss-plugin").getVariable("maven.jboss.jmx.url.undeploy")}'/>
<get dest="deploy.log"
src="${maven.jboss.jmx.url.undeploy}file:${jmx.deploy.file}"/>
</define:tag>
</define:taglib>
</project>

View File

@ -47,3 +47,19 @@ maven.jboss.default.deploy.excludes =
# Host name of the server where JBoss is running.
# Note: This is used to shut JBoss down.
maven.jboss.hostname = localhost
# ---------------------------------------------------------------------------
# Note: The properties listed below are only needed for the deploy/undeploy
# goals
# ---------------------------------------------------------------------------
# Port where JBoss is listening
maven.jboss.port = 8080
# URL which, when fed to <get>, will cause a thing
# to be deployed
maven.jboss.jmx.url.deploy = http://${maven.jboss.hostname}:${maven.jboss.port}/jmx-console/HtmlAdaptor?action=invokeOpByName&name=jboss.system:service%3DMainDeployer&methodName=deploy&argType=java.lang.String&arg=
# URL which, when fed to <get>, will cause a thing
# to be undeployed
maven.jboss.jmx.url.undeploy = http://${maven.jboss.hostname}:${maven.jboss.port}/jmx-console/HtmlAdaptor?action=invokeOpByName&name=jboss.system:service%3DMainDeployer&methodName=undeploy&argType=java.lang.String&arg=

View File

@ -8,6 +8,9 @@
<body>
<release version="1.1" date="in CVS">
<action dev="vmassol" type="add" due-to="James Johnson" due-to-email="jcej@tragus.org">
Added deploy/undeploy targets for jar/war/ear using JBoss' jmx console.
</action>
<action dev="vmassol" type="add" due-to="James Ward" due-to-email="james@ectropic.com">
Added new <code>maven.jboss.hostname</code> plugin property.
It defaults to <code>localhost</code> and gives the host name

View File

@ -65,6 +65,46 @@
</p>
</td>
</tr>
<tr>
<td>maven.jboss.hostname</td>
<td>No</td>
<td>
<p>
Hostname on which JBoss is executing. Default value is
<code>localhost</code>
</p>
</td>
</tr>
<tr>
<td>maven.jboss.port</td>
<td>No</td>
<td>
<p>
Port on which JBoss' jmx-console is available. Default value is
<code>8080</code>.
</p>
</td>
</tr>
<tr>
<td>maven.jboss.jmx.url.deploy</td>
<td>No</td>
<td>
<p>
URL at which an http get will deploy a target. Default value is
<code>http://${maven.jboss.hostname}:${maven.jboss.port}/jmx-console/HtmlAdaptor?action=invokeOpByName&amp;name=jboss.system:service%3DMainDeployer&amp;methodName=deploy&amp;argType=java.lang.String&amp;arg=</code>
</p>
</td>
</tr>
<tr>
<td>maven.jboss.jmx.url.undeploy</td>
<td>No</td>
<td>
<p>
URL at which an http get will undeploy a target. Default value is
<code>http://${maven.jboss.hostname}:${maven.jboss.port}/jmx-console/HtmlAdaptor?action=invokeOpByName&amp;name=jboss.system:service%3DMainDeployer&amp;methodName=undeploy&amp;argType=java.lang.String&amp;arg=</code>
</p>
</td>
</tr>
</table>
</section>
</body>