PRODUCTS AND SERVICES INDUSTRIES SUPPORT PARTNERS COMMUNITIES ABOUT
  Coherence 3.5 User Guide
  Coherence*Web WebInstaller Ant Task
Added by Rob Misek, last edited by Rob Misek on Apr 13, 2009  (view change)

Labels

 

The Coherence*Web WebInstaller Ant task allows you to run the Coherence*Web WebInstaller from within your existing Ant build files.

This section contains the following information:

Usage

To use the Coherence*Web WebInstaller 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="${coherence.home}/lib/webInstaller.jar"/>
    </classpath>
</taskdef>

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

The basic process of installing Coherence*Web into a Java EE application from an Ant build is:

  1. Build your Java EE 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 (such as modifying JSPs, Servlets, static resources, etc.), use the following installation process:

  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 Java EE 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)

To change the Coherence*Web configuration settings of a Java EE application that already has Coherence*Web installed, use this procedure:

  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 Java EE 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 Java EE 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 Java EE application. This attribute defaults to the directory that contains the Java EE application. false
descriptor Path to the Coherence*Web XML descriptor. This attribute defaults to coherence-web.xml in the directory that contains the target Java EE 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 Java EE 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"/>