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
- Identify the applications to deploy.
- Create a JAR file for each application.
- Copy the JAR files to the target servers.
- Create an ANT task to run the ServiceDeploy command
to create the EAR file for each server.
- Create an ANT task to run the InstallApplication command
for each EAR file from step 4 on
the applicable servers.
- Run the ServiceDeploy ANT
task to create the EAR file for the applications.
- 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.