Using the Coherence*Web Installer Ant Task

Description

The Coherence*Web Installer Ant task allows you to run the Coherence*Web Installer from within your existing Ant build files. To use the Coherence*Web Installer Ant task, add the following task import statement to your Ant build file:

<taskdef name="cwi" classname="com.tangosol.coherence.misc.CoherenceWebAntTask">
    <classpath>
        <pathelement location="${tangosol.home}/lib/webInstaller.jar"/>
    </classpath>
</taskdef>

where ${tangosol.home} refers to the root directory of your Coherence installation.

The basic process of installing Coherence*Web into a J2EE application from an Ant build is as follows:

  1. Build your J2EE application as you normally would
  2. Run the Coherence*Web Ant task with the operations attribute set to inspect
  3. Make any necessary changes to the generated Coherence*Web XML descriptor
  4. Run the Coherence*Web Ant task with the operations attribute set to install

If you are performing iterative development on your application (modifying JSPs, Servlets, static resources, etc.), the installation process would consist of the following steps:

  1. Run the Coherence*Web Ant task with the operations attribute set to uninstall, the failonerror attribute set to false, and the descriptor attribute set to the location of the previously generated Coherence*Web XML descriptor (from step 2 above)
  2. Build your J2EE application as you normally would
  3. Run the Coherence*Web Ant task with the operations attribute set to inspect, install and the descriptor attribute set to the location of the previously generated Coherence*Web XML descriptor (from step 2 above)

If you want to change the Coherence*Web configuration settings of a J2EE application that already has Coherence*Web installed:

  1. Run the Coherence*Web Ant task with the operations attribute set to uninstall and the descriptor attribute set to the location of the Coherence*Web XML descriptor for the J2EE application.
  2. Change the necessary configuration parameters in the Coherence*Web XML descriptor.
  3. Run the Coherence*Web Ant task with the operations attribute set to install and the descriptor attribute set to the location of the modified Coherence*Web XML descriptor (from step 2).

Parameters

Attribute Description Required
app Path to the target J2EE application. This can be a path to a WAR file, an EAR file, an exploded WAR directory, or an exploded EAR directory. true, if the operations attribute is set to any value other than version
backup Path to a directory that will hold a backup of the original target J2EE application. This attribute defaults to the directory that contains the J2EE application. false
descriptor Path to the Coherence*Web XML descriptor. This attribute defaults to coherence-web.xml in the directory that contains the target J2EE application. false
failonerror Stop the Ant build if the Coherence*Web installer exits with a status other than 0. The default is true. false
nowarn Suppress warning messages. This attribute can be either true or false. The default is false. false
operations comma- or space-separated list of operations to perform; each operation must be one of inspect, install, uninstall, or version. true
server The alias of the target J2EE application server. false
touch Touch JSPs and TLDs that are modified by the Coherence*Web installer. This attribute can be either true, false, or 'M/d/y h:mm a'. The default is false. false
verbose Show verbose output. This attribute can be either true or false. The default is false. false

Examples

Inspect the myWebApp.war web application and generate a Coherence*Web XML descriptor called my-coherence-web.xml in the current working directory:

<cwi app="myWebApp.war" operations="inspect" descriptor="my-coherence-web.xml"/>

Install Coherence*Web into the myWebApp.war web application using the Coherence*Web XML descriptor called my-coherence-web.xml found in the current working directory:

<cwi app="myWebApp.war" operations="install" descriptor="my-coherence-web.xml"/>

Uninstall Coherence*Web from the myWebApp.war web application:

<cwi app="myWebApp.war" operations="uninstall">

Install Coherence*Web into the myWebApp.war web application located in the /dev/myWebApp/build directory using the Coherence*Web XML descriptor called my-coherence-web.xml found in the /dev/myWebApp/src directory, and place a backup of the original web application in the /dev/myWebApp/work directory:

<cwi app="/dev/myWebApp/build/myWebApp.war" operations="install" descriptor="/dev/myWebApp/src/my-coherence-web.xml" backup="/dev/myWebApp/work"/>

Install Coherence*Web into the myWebApp.war web application located in the /dev/myWebApp/build directory using the Coherence*Web XML descriptor called coherence-web.xml found in the /dev/myWebApp/build directory. If the web application has not already been inspected (i.e. /dev/myWebApp/build/coherence-web.xml does not exists), inspect the web application prior to installing Coherence*Web:

<cwi app="/dev/myWebApp/build/myWebApp.war" operations="inspect,install"/>

Reinstall Coherence*Web into the myWebApp.war web application located in the /dev/myWebApp/build directory using the Coherence*Web XML descriptor called my-coherence-web.xml found in the /dev/myWebApp/src directory:

<cwi app="/dev/myWebApp/build/myWebApp.war" operations="uninstall,install" descriptor="/dev/myWebApp/src/my-coherence-web.xml"/>