2011/08/05 - Jakarta Cactus has been retired.

For more information, please explore the Attic.

CactifyEar Task

The task cactifyear allows the enhancement of an existing enterprise-application archive (EAR) with the elements needed to run Cactus in-container tests. This includes adding a web application that contains the deployed Cactus redirectors.

The cactifyear task extends the built-in Ant task ear, so it also supports all attributes and nested elements that ear supports.


Name Description Required
srcfile The original ear that is going to be cactified. Yes
addEjbReferences Specifies if EJB references to all local EJBs in the ear should be added to the cactus war. No

Nested Elements


The cactuswar element configures everything that has to do with the cactus web application that will end up in the ear. This element has all the parameters of the cactifywar task except the destfile parameter. The web application will always be named cactus.war and be placed in the root of the ear.


Name Description Required
context The context to wich the cactified web application will be mapped to. No, the default is /cactus


The following example demonstrates the simplest-possible use of the task. It will add a web application named cactus.war under the context /cactus. The web application will contain the redirectors necessary for cactus to work.

<cactifyear srcfile="${build.dir}/my.ear" destfile="${build.dir}/cactified.ear"/>

The next example demonstrates how to set the context for the web application.

<cactifyear srcfile="${build.dir}/my.ear" destfile="${build.dir}/cactified.ear">
    <cactuswar context="/myTestFramework" version="2.3"/>

In the following example, we use an existing war by cactify it and add it to the ear.

<cactifyear srcfile="${build.dir}/my.ear" destfile="${build.dir}/cactified.ear">
    <cactuswar srcfile="mytest.war"/>

As mentioned previously all parameters of the tasks cactifywar and war can be used. The only exception to this is destfile since the resulting war always is placed inside the ear with the name cactus.war.

<cactifyear srcfile="${build.dir}/my.ear" destfile="${build.dir}/cactified.ear">
    <cactuswar srcfile="mytest.war" mergewebxml="my-web.xml">
        <classes dir="${classes}">
            <include name="**/*Test.class"/>