2003-01-24 03:44:26 +00:00

69 lines
2.6 KiB
XML

<?xml version="1.0"?>
<document>
<properties>
<title>Using the Maven Cactus Plug-in</title>
<author email="vmassol@octo.com">Vincent Massol</author>
</properties>
<body>
<section name="Using the Maven Cactus Plug-in">
<ol>
<li>
Create a <code>src/test-cactus</code> directory in your project and
put your Cactus test classes in it (with the normal package directory
structure). Note that the location of the Cactus test sources can be
configured through the <code>maven.cactus.src.dir</code> property.
</li>
<li>
Create a <code>build.properties</code> file in your project root
directory (where <code>project.xml</code> is located) and define in
it the location of the container you wish to use for the tests. For
example, if you wish to run the Cactus tests on Tomcat 4.1.10 and on
Resin 2.4, you will write:
</li>
<source><![CDATA[
maven.cactus.tomcat4x.home = C:/Apps/jakarta-tomcat-4.1.10
maven.cactus.resin2x.home = C:/Apps/resin-2.1.4
]]></source>
<li>
Call the
<a href="http://jakarta.apache.org/turbine/maven/reference/plugins/war/index.html">War</a>
plugin's goals to generate a war for your webapp. For example:
<code>maven war</code>. Note that in the future you would also be
able to call the Ear plugin if your application is an EAR.
</li>
<li>
Then, simply run the Cactus goal for your container. For example,
type <code>maven cactus:test-tomcat-4x</code> to run the tests with
Tomcat 4.x. You can type <code>maven -g</code> for a full list of the
available goals.
</li>
<li>
If you wish to generate Cactus HTML test reports, type
<code>maven cactus:generate site</code>.
</li>
</ol>
<p>
The plugin will automatically add what is needed for the Cactus tests
to your application WAR/webapp by repackaging it. In detail, it will
add the Cactus test classes, Cactus configuration files and Cactus jars
to your WAR/webapp. It will then deploy it, configure the container you
have chosen, start it, run the Cactus tests and stop the container.
</p>
<p>
It is possible (and recommended for performance reasons) to run all the
goals in one Maven invocation. For example:
<code>maven war cactus:test-tomcat-4x cactus:generate site</code>. You
can also put that sequence in your project's <code>maven.xml</code>
file.
</p>
</section>
</body>
</document>