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