The Coherence*Web Installer Ant task enables 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="${coherence.home}/lib/webInstaller.jar"/> </classpath> </taskdef>
In this code fragment, ${coherence.home}
refers to the root directory of your Coherence installation.
To Install Coherence*Web into a Java EE Application:
Build your Java EE application as you normally would.
Run the Coherence*Web Ant task with the operations attribute set to inspect.
Make any necessary changes to the generated Coherence*Web XML descriptor.
Run the Coherence*Web Ant task with the operations attribute set to install.
To Use the Ant Task in an Iterative Development Environment:
If you are performing iterative development on your application (such as modifying JSPs, Servlets, static resources, and so on), use the following installation process:
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 in the previous section).
Build your Java EE application as you normally would.
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 in the previous section).
To Change a Coherence*Web Configuration where it is already Installed:
To change the Coherence*Web configuration settings of a Java EE application that already has Coherence*Web installed, use this procedure:
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.
Change the necessary configuration parameters in the Coherence*Web XML descriptor.
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).
Table 25-1 describes the Ant task installation parameters.
Table 25-1 Parameters for the Coherence*Web Installer Ant Task
Attribute | Required | Description |
---|---|---|
app |
true, if the |
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. |
backup |
false |
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. |
descriptor |
false |
Path to the Coherence*Web XML descriptor. This attribute defaults to |
failonerror |
false |
Stop the Ant build if the Coherence*Web installer exits with a status other than 0. The default is |
nowarn |
false |
Suppress warning messages. This attribute can be either |
operations |
true |
Comma- or space-separated list of operations to perform; each operation must be one of inspect, install, uninstall, or version. |
server |
false |
The alias of the target Java EE application server. |
touch |
false |
Touch JSPs and TLDs that are modified by the Coherence*Web installer. This attribute can be either |
verbose |
false |
Show verbose output. This attribute can be either |
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 (that is, /dev/myWebApp/build/coherence-web.xml
does not exists), inspect the web application before 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"/>