git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@114681 13f79535-47bb-0310-9956-ffa450edef68
215 lines
8.5 KiB
XML
215 lines
8.5 KiB
XML
<?xml version="1.0"?>
|
|
<project
|
|
xmlns:define="jelly:define"
|
|
xmlns:j="jelly:core"
|
|
xmlns:u="jelly:util"
|
|
xmlns:was40wscp="was40wscp">
|
|
|
|
<!-- set up maven.was40.script -->
|
|
<j:choose>
|
|
<j:when test="${systemScope['os.name'].startsWith('Windows')}">
|
|
<j:set var="maven.was40.script" value="${maven.was40.wscpExe}.bat"/>
|
|
<j:set var="maven.was40.startServer.script"
|
|
value="${maven.was40.bin}/adminserver.bat" />
|
|
<j:set var="maven.was40.plugin" value="${maven.was40.bin}/GenPluginCfg.bat" />
|
|
<j:set var="maven.was40.dumpNameSpace" value="${maven.was40.bin}/dumpNameSpace.bat" />
|
|
<j:set var="maven.was40.earExpander" value="${maven.was40.bin}/EARExpander.bat" />
|
|
</j:when>
|
|
<j:otherwise>
|
|
<j:set var="maven.was40.script" value="${maven.was40.wscpExe}.sh"/>
|
|
<j:set var="maven.was40.startServer.script"
|
|
value="${maven.was40.startNode}.sh" />
|
|
<j:set var="maven.was40.plugin" value="${maven.was40.bin}/GenPluginCfg.sh" />
|
|
<j:set var="maven.was40.hackplug.hic" value="${maven.was40.bin}/hackplug.sh" />
|
|
<j:set var="maven.was40.dumpNameSpace" value="${maven.was40.bin}/dumpNameSpace.sh" />
|
|
<j:set var="maven.was40.earExpander" value="${maven.was40.bin}/EARExpander.sh" />
|
|
</j:otherwise>
|
|
</j:choose>
|
|
|
|
<!-- set up some tags to make calling wscp easier -->
|
|
<define:taglib uri="was40wscp">
|
|
|
|
<!--
|
|
! Execute a command using the WebSphere Control Program
|
|
! @param command the wscp command to execute
|
|
! @param var (optional) a variable to set with the results of the execution
|
|
!-->
|
|
<define:tag name="exec">
|
|
<j:if test="${empty(command)}">
|
|
<fail>attribute command must be provided</fail>
|
|
</j:if>
|
|
|
|
<!--
|
|
wscp.qualifyHomeName=true
|
|
wscp.remotePasswordFile=
|
|
wscp.remoteConnectionTimeout=300
|
|
wscp.remoteConnectionsAllowed=true
|
|
wscp.remoteHostListAccept=
|
|
wscp.remoteHostListReject=
|
|
#
|
|
# set traceString to enable tracing
|
|
#
|
|
# wscp.traceString=com.ibm.ejs.sm.client.ui.desc.*=all=enabled
|
|
# wscp.traceString=com.ibm.ejs.sm.ejscp.*=all=enabled
|
|
##
|
|
# Typically, these need to be set if only ContextExtension is loaded
|
|
# (otherwise, EjscpExtension sets them as noted above)
|
|
#
|
|
# com.ibm.CORBA.BootstrapHost=pc-dev1
|
|
# com.ibm.CORBA.BootstrapPort=900
|
|
# java.naming.factory.initial=com.ibm.ejs.ns.jndi.CNInitialContextFactory
|
|
-->
|
|
|
|
<!-- delete the properties file here and recreate it -->
|
|
<delete file="${java.io.tmpdir}/was40.properties" />
|
|
<j:file name="${java.io.tmpdir}/was40.properties" omitXmlDeclaration="true" escapeText="false">
|
|
wscp.hostName=${maven.was40.node}
|
|
wscp.hostPort=${maven.was40.hostPort}
|
|
wscp.primaryNode=${maven.was40.primaryNode}
|
|
</j:file>
|
|
|
|
<!-- properties file -->
|
|
<u:file name="${java.io.tmpdir}/was40.properties" var="props" />
|
|
<echo>Executing '${command}' using wscp</echo>
|
|
<exec executable="${maven.was40.script}" outputproperty="results">
|
|
<arg value="-p" />
|
|
<arg value="${props.canonicalPath}" />
|
|
<arg value="${maven.was40.wscpArgs}" />
|
|
<arg value="${command}" />
|
|
</exec>
|
|
|
|
<!-- test if arguments have been passed -->
|
|
<j:if test="${empty(var)}">
|
|
<echo>${results}</echo>
|
|
</j:if>
|
|
<j:if test="${!empty(var)}">
|
|
<j:set scope="parent" var="${var}" value="${results}" />
|
|
</j:if>
|
|
</define:tag>
|
|
</define:taglib>
|
|
|
|
<!-- default goal -->
|
|
<goal name="was40"
|
|
description="Obtain the list of nodes on the WebSphere Application Server">
|
|
<attainGoal name="was40:list-node" />
|
|
</goal>
|
|
|
|
<goal name="was40:start"
|
|
description="Starts the specified node.">
|
|
<echo>Staring Node: '${maven.was40.node}'</echo>
|
|
<exec executable="${maven.was40.startServer.script}" />
|
|
</goal>
|
|
|
|
<goal name="was40:stop"
|
|
description="Stops the specified websphere node.">
|
|
<echo>Stopping node: '${maven.was40.node}'</echo>
|
|
<was40wscp:exec command="${maven.was40.stopNode}" />
|
|
</goal>
|
|
|
|
<goal name="was40:list-node" description="Obtain the list of nodes on the WebSphere Application Server">
|
|
<echo>Retreiving a list of available Nodes...</echo>
|
|
<was40wscp:exec command="${maven.was40.listNode}"/>
|
|
</goal>
|
|
|
|
<goal name="was40:deploy-ear"
|
|
description="Deploy an enterprise application">
|
|
|
|
<echo>Deploying enterprise application: '${maven.was40.enterprise.app.name}'</echo>
|
|
<was40wscp:exec command="${maven.was40.deployApp}" />
|
|
</goal>
|
|
|
|
<goal name="was40:app-stop"
|
|
description="Stop an enterprise application">
|
|
<echo>Stopping enterprise application: '${maven.was40.enterprise.app.name}'</echo>
|
|
<was40wscp:exec command="${maven.was40.stopApp}" />
|
|
</goal>
|
|
|
|
<goal name="was40:undeploy-ear"
|
|
description="Remove an enterprise application">
|
|
<echo>Removing enterprise application: '${maven.was40.enterprise.app.name}'</echo>
|
|
<was40wscp:exec command="${maven.was40.removeApp}" />
|
|
</goal>
|
|
|
|
<goal name="was40:app-start"
|
|
description="Start enterprise application">
|
|
<echo>Starting enterprise application: '${maven.was40.enterprise.app.name}'</echo>
|
|
<was40wscp:exec command="${maven.was40.startApp}" />
|
|
</goal>
|
|
|
|
<goal name="was40:deploy-to-servergroup"
|
|
description="Deploy an application to a server group">
|
|
<echo>Deploying enterprise application to server group: '${maven.was40.serverGroup.name}'</echo>
|
|
<was40wscp:exec command="${maven.was40.servergroup.install}" />
|
|
</goal>
|
|
|
|
<goal name="was40:start-appserver"
|
|
description="Start a websphere application server">
|
|
<echo>Starting Application Server: '${maven.was40.appserver.name}'</echo>
|
|
<was40wscp:exec command="${maven.was40.appserver.start}" />
|
|
</goal>
|
|
|
|
<goal name="was40:stop-appserver"
|
|
description="Stop a websphere application server">
|
|
<echo>Stopping Application Server: '${maven.was40.appserver.name}'</echo>
|
|
<was40wscp:exec command="${maven.was40.appserver.stop}" />
|
|
</goal>
|
|
|
|
<goal name="was40:start-servergroup"
|
|
description="Start a websphere server group">
|
|
<echo>Starting ServerGroup: '${maven.was40.serverGroup.name}'</echo>
|
|
<was40wscp:exec command="${maven.was40.servergroup.start}" />
|
|
</goal>
|
|
|
|
<goal name="was40:stop-servergroup"
|
|
description="Stop a websphere server group">
|
|
<echo>Stopping ServerGroup: '${maven.was40.serverGroup.name}'</echo>
|
|
<was40wscp:exec command="${maven.was40.servergroup.stop}" />
|
|
</goal>
|
|
|
|
<goal name="was40:list-apps" description="List the applications installed on this node">
|
|
<echo>Obtaining a list of Enterprise applications for node: '${maven.was40.node}'</echo>
|
|
<was40wscp:exec command="${maven.was40.listEnterpriseApps}" />
|
|
</goal>
|
|
|
|
<goal name="was40:app-show" description="Display extra information about the EAR">
|
|
<echo>Obtaining Details about EAR: '${maven.was40.enterprise.app.name}'</echo>
|
|
<was40wscp:exec command="${maven.was40.enterpriseAppShow}" />
|
|
</goal>
|
|
|
|
<goal name="was40:regen" description="Regenerate the Plugin">
|
|
<echo>Regenerating Plugin for node: '${maven.was40.node}'</echo>
|
|
<exec executable="${maven.was40.plugin}" outputproperty="results">
|
|
<arg value="-adminNodeName" />
|
|
<arg value="${maven.was40.primaryNode}" />
|
|
<arg value="-nodeName" />
|
|
<arg value="${maven.was40.node}" />
|
|
</exec>
|
|
<echo>${results}</echo>
|
|
</goal>
|
|
|
|
<goal name="was40:jndi-dump" description="Dump the appserver's JNDI namespace">
|
|
<echo>Dumping [jndi] Namespace for node: '${maven.was40.node}'</echo>
|
|
<exec executable="${maven.was40.dumpNameSpace}" outputproperty="result">
|
|
<arg value="-host" />
|
|
<arg value="${maven.was40.node}" />
|
|
<arg value="-port" />
|
|
<arg value="${maven.was40.hostPort}" />
|
|
</exec>
|
|
<echo>${result}</echo>
|
|
</goal>
|
|
|
|
<goal name="was40:expand" description="Expand EAR into the ../installedApps/appName.ear directory">
|
|
<echo>Expanding EAR: '${maven.was40.enterprise.app.name}' into '${maven.was40.expandDir}/${maven.was40.enterprise.app.name}.ear'</echo>
|
|
<exec executable="${maven.was40.earExpander}" outputproperty="results">
|
|
<arg value="-ear" />
|
|
<arg value="${maven.was40.enterprise.app}" />
|
|
<arg value="-expandDir" />
|
|
<arg value="${maven.was40.expandDir}/${maven.was40.enterprise.app.name}.ear" />
|
|
<arg value="-operation" />
|
|
<arg value="expand" />
|
|
<arg value="-expansionFlags" />
|
|
<arg value="all" />
|
|
</exec>
|
|
<echo>${results}</echo>
|
|
</goal>
|
|
</project> |