Author: ptahchiev Date: Fri May 16 20:12:42 2008 New Revision: 657287 URL: http://svn.apache.org/viewvc?rev=657287&view=rev Log: added the cactifywar.xml for the cactifywar mojo.
Added: jakarta/cactus/trunk/cactus-site/src/site/xdoc/integration/maven2/cactifywar.xml (with props) Modified: jakarta/cactus/trunk/cactus-site/src/site/site.xml Modified: jakarta/cactus/trunk/cactus-site/src/site/site.xml URL: http://svn.apache.org/viewvc/jakarta/cactus/trunk/cactus-site/src/site/site.xml?rev=657287&r1=657286&r2=657287&view=diff ============================================================================== --- jakarta/cactus/trunk/cactus-site/src/site/site.xml (original) +++ jakarta/cactus/trunk/cactus-site/src/site/site.xml Fri May 16 20:12:42 2008 @@ -91,7 +91,9 @@ <item name="Goals" href="integration/maven/goals.html"/> <item name="Properties" href="integration/maven/properties.html"/> </item> - <item name="Maven2" href="integration/maven2/index.html"/> + <item name="Maven2" href="integration/maven2/index.html" collapse="true"> + <item name="CactifyWar MOJO" href="integration/maven2/cactifywar.html"/> + </item> <item name="Various IDEs" href="integration/howto_ide.html"/> <item name="JUnitEE" href="integration/howto_junitee.html"/> </item> Added: jakarta/cactus/trunk/cactus-site/src/site/xdoc/integration/maven2/cactifywar.xml URL: http://svn.apache.org/viewvc/jakarta/cactus/trunk/cactus-site/src/site/xdoc/integration/maven2/cactifywar.xml?rev=657287&view=auto ============================================================================== --- jakarta/cactus/trunk/cactus-site/src/site/xdoc/integration/maven2/cactifywar.xml (added) +++ jakarta/cactus/trunk/cactus-site/src/site/xdoc/integration/maven2/cactifywar.xml Fri May 16 20:12:42 2008 @@ -0,0 +1,245 @@ +<?xml version="1.0"?> + +<!-- + * ======================================================================== + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ======================================================================== +--> + +<document id="mojo_cactifywar"> + + <properties> + <title>CactifyWar Maven2 MOJO</title> + </properties> + + <body> + + <section name="CactifyWar MOJO"> + + <p> + The mojo <strong>cactifywar</strong> allows the enhancement of an existing + web-application archive (WAR) with the elements needed to run Cactus + in-container tests. This includes adding the definitions of the test + redirectors to the deployment descriptor, as well as adding the libraries + that Cactus requires on the server side (see the + <a href="../manual/howto_classpath.html">Classpath Guide</a> for details). + </p> + + <note> + If you want to use the + <a href="../../writing/howto_httpunit.html">HttpUnit integration</a> in your + tests, you'll need to explicitly add the <code>httpunit.jar</code> to + the cactified WAR. You can easily do this by specifying it as a + <code><libDependencies></code> element. + </note> + + <section name="Parameters"> + + <p> + Here is a list of all the parameters that can be specified to the + <strong>cactifywar</strong> plugin. + </p> + + <table> + <tr> + <th>Name</th> + <th>Description</th> + <th>Required</th> + </tr> + <tr> + <td><strong>destFile</strong></td> + <td> + The location and name of the cactified web-application archive to create. + </td> + <td>Yes</td> + </tr> + <tr> + <td><strong>srcFile</strong></td> + <td> + The original web-application archive that is going to be + cactified. + </td> + <td>Yes</td> + </tr> + <tr> + <td><strong>mergeWebXml</strong></td> + <td> + Allows the specification of a web deployment descriptor whose + content will get merged into the resulting descriptor. This is + only required for purposes like adding special security + constraints for testing, as the Cactus test redirectors will be + added to the cactified deployment descriptor anyway. The merging + of the descriptors is based on the same principles as used by the + <a href="task_webxmlmerge.html">webxmlmerge</a> task. + </td> + <td>No</td> + </tr> + <tr> + <td><strong>version</strong></td> + <td> + The version of the web application archive to create if no source + archive has been specified with the <em>srcfile</em> attribute. + Can be either <code>2.2</code> or <code>2.3</code>. + </td> + <td>No, unless the <em>srcfile</em> attribute is omitted</td> + </tr> + </table> + + </section> + + <section name="Nested Elements"> + + <p> + Here is a list of all the nested elements that you can use + with the <strong>cactifywar</strong> plugin. + </p> + + <table> + <tr> + <th>Name</th> + <th>Description</th> + <th>Required</th> + </tr> + <tr> + <td><strong>libDependencies</strong></td> + <td> + The artifacts that you want to include in the <strong>WEB-INF/lib</strong> folder + of the archive that you create. The dependencies that you specify here with <strong><groupId></strong> + and <strong><artifactId></strong> must be specified as a project dependencies. + </td> + <td>No</td> + </tr> + <tr> + <td><strong>redirectors</strong></td> + <td> + This allows you to specify custom redirector definitions. Inside the this element you can specify any of + the following: <strong><servletRedirector></strong>, <strong><filterRedirector></strong>, + <strong><jspRedirector></strong>. Each one of these can get any of the following attributes: + <strong>name</strong>, <strong>mapping</strong>, <strong>roles</strong>. + </td> + <td>No</td> + </tr> + </table> + </section> + <section name="Examples"> + + <p> + The following example demonstrates the simplest-possible use of the + plugin. You have to add the following plugin definition inside your + <strong><build></strong> definition of your pom.xml. It will + add the redirectors with the default mappings to the + cactified WARs, as well as the Cactus libraries and the JSP page + needed for the JSP redirector. + </p> + <source><![CDATA[ +<plugin> + <groupId>org.apache.cactus</groupId> + <artifactId>cactus.integration.maven2</artifactId> + <version>1.8.1-SNAPSHOT</version> + <configuration> + <srcFile>target/cactus-maven2-test-1.0-SNAPSHOT.war</srcFile> + <destFile>cactifiedByMaven2.war</destFile> + </configuration> +</plugin> +]]></source> + <p> + The next example demonstrates how to modify the mappings of the + redirectors. + </p> + + <source><![CDATA[ +<plugin> + <groupId>org.apache.cactus</groupId> + <artifactId>cactus.integration.maven2</artifactId> + <version>1.8.1-SNAPSHOT</version> + <configuration> + <srcFile>target/cactus-maven2-test-1.0-SNAPSHOT.war</srcFile> + <destFile>cactifiedByMaven2.war</destFile> + <redirectors> + <servletRedirector> + <name>ServletRedirectorSecure</name> + <mapping>/ServletRedirectorSecure</mapping> + <roles>test</roles> + </servletRedirector> + <filterRedirector> + <name>FilterRedirector</name> + <mapping>/test/filterRedirector</mapping> + </filterRedirector> + </redirectors> + </configuration> +</plugin> +]]></source> + + <p> + In the following example, we add the + <a href="../../writing/howto_httpunit.html">HttpUnit</a> library to the + cactified WAR. (Note that you have to add it explicitly in the project + dependecies also) + </p> + + <source><![CDATA[ +<plugin> + <groupId>org.apache.cactus</groupId> + <artifactId>cactus.integration.maven2</artifactId> + <version>1.8.1-SNAPSHOT</version> + <configuration> + <srcFile>target/cactus-maven2-test-1.0-SNAPSHOT.war</srcFile> + <destFile>cactifiedByMaven2.war</destFile> + <libDependencies> + <dependency> + <groupId>httpunit</groupId> + <artifactId>httpunit</artifactId> + </dependency> + </libDependencies> + </configuration> +</plugin> +]]></source> + + <p> + In the next example, we add a security-constrained instance of the + servlet redirector to be able to run tests using authentication + (see <a href="../../writing/howto_security.html">Using Authentication</a> + for details). Note that you need to provide an empty servlet + redirector element, so that the default redirector is included + along side the secured redirector (it would just be overridden + otherwise). + </p> + + <source><![CDATA[ +<plugin> + <groupId>org.apache.cactus</groupId> + <artifactId>cactus.integration.maven2</artifactId> + <version>1.8.1-SNAPSHOT</version> + <configuration> + <srcFile>target/cactus-maven2-test-1.0-SNAPSHOT.war</srcFile> + <destFile>cactifiedByMaven2.war</destFile> + <redirectors> + <servletRedirector> + <name>ServletRedirectorSecure</name> + <mapping>/ServletRedirectorSecure</mapping> + <roles>test</roles> + </servletRedirector> + <servletRedirector/> + </redirectors> + </configuration> +</plugin> +]]></source> + </section> + </section> + </body> +</document> Propchange: jakarta/cactus/trunk/cactus-site/src/site/xdoc/integration/maven2/cactifywar.xml ------------------------------------------------------------------------------ svn:eol-style = native --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]