Docs for: v1.7.2 | v1.7 Last update: March 26 2006

# 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. ## Parameters
Name | Description | Required
--- | --- | ---
srcfile | The original ear that is going to be cactified. | Yes
addEjbReferences | Specifies if EJB references to all local EJB:s in the ear should be added to the cactus war. | No
## Nested Elements ### cactuswar 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. #### Parameters
Name | Description | Required
--- | --- | ---
context | The context to wich the cactified web application will be mapped to. | No, the default is /cactus
## Examples 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"/>
    </cactifyear>
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"/>
    </cactifyear>
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"/>
            </classes>
        </cactuswar>
    </cactifyear>