WebSphere Enterprise Service Bus for z/OS, Version 6.2.0 Operating Systems: z/OS


Deploying applications using Apache Ant tasks

ANT tasks allow you to define the deployment of multiple applications to WebSphere® ESB and have them run unattended on a server.

Before you begin

This task assumes the following:
  • The applications being deployed have already been developed and tested.
  • The applications are to be installed on the same server or servers.
  • You have some knowledge of Apache Ant tasks.
  • You understand the deployment process.

Information about developing and testing applications is located in the WebSphere Integration Developer information center.

The Generated API and SPI documentation reference section provides details of application programming interfaces. Apache Ant tasks are described in the package com.ibm.websphere.ant.tasks. For the purpose of this topic, the tasks of interest are ServiceDeploy and InstallApplication.

About this task

If you need to install multiple applications concurrently, develop an Apache Ant task before deployment. The Apache Ant task can then deploy and install the applications on the servers without your involvement in the process.
Procedure
  1. Identify the applications to deploy.
  2. Create a JAR file for each application.
  3. Copy the JAR files to the target servers.
  4. Create an Apache Ant task to run the ServiceDeploy command to create the EAR file for each server.
  5. Create an Apache Ant task to run the InstallApplication command for each EAR file from step 4 on the applicable servers.
  6. Run the ServiceDeploy Apache Ant task to create the EAR file for the applications.
  7. Run the InstallApplication Apache Ant task to install the EAR files from step 6.

Results

The applications are correctly deployed on the target servers.

Example of deploying an application unattended

This example of deploying an application unattended shows an Apache ANT task contained in a file myBuildScript.xml.
<?xml version="1.0">

<project name="OwnTaskExample" default="main" basedir=".">
	<taskdef name="servicedeploy" 
			classname="com.ibm.websphere.ant.tasks.ServiceDeployTask" />
	<target name="main" depends="main2">
		<servicedeploy scaModule="c:/synctest/SyncTargetJAR"
			ignoreErrors="true"
			outputApplication="c:/synctest/SyncTargetEAREAR"
			workingDirectory="c:/synctest"
			noJ2eeDeploy="true"
			cleanStagingModules="true"/>
	</target>
</project>
This statement shows how to invoke the Apache Ant task.
${WAS}/bin/ws_ant -f myBuildScript.xml
Tip: Multiple applications can be deployed unattended by adding additional project statements into the file.

What to do next

Use the administrative console to verify that the newly-installed applications are started and processing the workflow correctly.

task Task topic

Terms of use | Feedback


Timestamp icon Last updated: 21 June 2010


http://publib.boulder.ibm.com/infocenter/dmndhelp/v6r2mx/topic//com.ibm.websphere.wesb620.zseries.doc/doc/tdep_usingant.html
Copyright IBM Corporation 2005, 2010. All Rights Reserved.
This information center is powered by Eclipse technology (http://www.eclipse.org).