WebSphere WebSphere Enterprise Service Bus, Version 6.0.1 Operating Systems: AIX, HP-UX, Linux, Solaris, Windows

Deploying applications using ANT tasks

This topic describes how to use ANT tasks to automate the deployment of applications to WebSphere ESB. By using ANT tasks, you can define the deployment of multiple applications 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 ANT tasks.
  • You understand the deployment process.

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

The reference portion of the information center for WebSphere Application Server, v6.0 contains a section on application programming interfaces. 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.

Why and when to perform this task

If you need to install multiple applications concurrently, develop an ANT task before deployment. The ANT task can then deploy and install the applications on the servers without your involvement in the process.

Steps for this task

  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 ANT task to run the ServiceDeploy command to create the EAR file for each server.
  5. Create an ANT task to run the InstallApplication command for each EAR file from step 4 on the applicable servers.
  6. Run the ServiceDeploy ANT task to create the EAR file for the applications.
  7. Run the InstallApplication ANT task to install the EAR files from step 6.

Result

The applications are correctly deployed on the target servers.

Example of deploying an application unattended

Example of deploying an application unattended

This example shows an 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 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 topic

Terms of Use | Rate this page

Timestamp iconLast updated: 13 Dec 2005
http://publib.boulder.ibm.com/infocenter/dmndhelp/v6rxmx/index.jsp?topic=/com.ibm.websphere.wesb.doc\doc\tdep_usingant.html

(C) Copyright IBM Corporation 2005. All Rights Reserved.
This information center is powered by Eclipse technology. (http://www.eclipse.org)