Ant Tasks for Websphere Deployment

The following is my ant for websphere deployment, application start & stop, etc. The complete API doc can be found in IBM website: https://publib.boulder.ibm.com/infocenter/dmndhelp/v6rxmx/index.jsp?topic=/com.ibm.wsps.602.javadoc.doc/doc/index.html
For this tasks to run, you need to have the jar file com.ibm.ws.runtime.jar. This jar file can be found in plugins directory of your Websphere installation.

<property name="hostName" value="localhost" />
<property name="connType" value="SOAP" />
<property name="port" value="8880" />
<property name="deployEar.dir" value="C:\Users\firmanw\Documents\zw2\OSMS\build" />
<property name="deployEar" value="osms.war" />
<property name="wasHome.dir" value="C:\Program Files (x86)\IBM\TeamConcert\runtimes\base_v7" />
<property name="app.name" value="osms_war" />
<property name="profile.name" value="profilexfirman" />
<taskdef name="wsInstallApp" classname="com.ibm.websphere.ant.tasks.InstallApplication" classpath="com.ibm.ws.runtime.jar" />
<taskdef name="wsStartApplication" classname="com.ibm.websphere.ant.tasks.StartApplication" classpath="com.ibm.ws.runtime.jar" />
<taskdef name="wsStopApplication" classname="com.ibm.websphere.ant.tasks.StopApplication" classpath="com.ibm.ws.runtime.jar" />
<target name="installEar" depends="build.osms">
<echo message="Deployable EAR File found at: ${deployEar.dir}/${deployEar}" />
<wsInstallApp ear="${deployEar.dir}/${deployEar}" wasHome="${wasHome.dir}" conntype="${connType}" port="${port}" host="${hostName}" profilename="profilexfirman" options="-appname ${app.name} -usedefaultbindings -update" />
</target>
<target name="startInstallEar" depends="installEar">
<echo message="Mulai ngestart" />
<wsStartApplication wasHome="${wasHome.dir}" conntype="${connType}" port="${port}" host="${hostName}" profilename="${profile.name}" application="${app.name}" />
</target>
<target name="startEar">
<echo message="Mulai ngestart" />
<wsStartApplication wasHome="${wasHome.dir}" conntype="${connType}" port="${port}" host="${hostName}" profilename="${profile.name}" application="${app.name}" />
</target>
<target name="stopEar">
<echo message="Mulai nyetop" />
<wsStopApplication wasHome="${wasHome.dir}" conntype="${connType}" port="${port}" host="${hostName}" profilename="${profile.name}" application="${app.name}" />
</target>

<target name="restartEar" depends="stopEar, startEar"></target>

0 komentar:

Posting Komentar