vmassol 2002/11/12 05:45:31
Modified: src/plugins-build/cactus/conf web.xml
src/plugins-build/cactus plugin.jelly plugin.properties
src/plugins-build/cactus/xdocs changes.xml features.xml
Added: src/plugins-build/cactus/conf web.xml.dvsl
Log:
Automatically merge the web.xml elements needed by Cactus to the user project
web.xml file. The property maven.cactus.webxml has thus been removed as it is no
longer needed.
Revision Changes Path
1.2 +4 -70 jakarta-turbine-maven/src/plugins-build/cactus/conf/web.xml
Index: web.xml
===================================================================
RCS file: /home/cvs/jakarta-turbine-maven/src/plugins-build/cactus/conf/web.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- web.xml 7 Nov 2002 10:05:37 -0000 1.1
+++ web.xml 12 Nov 2002 13:45:31 -0000 1.2
@@ -2,78 +2,12 @@
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
- "http://java.sun.com/j2ee/dtds/web-app_2_3.dtd">
+ "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
- <filter>
- <filter-name>FilterRedirector</filter-name>
- <filter-class>org.apache.cactus.server.FilterTestRedirector</filter-class>
- </filter>
-
- <filter-mapping>
- <filter-name>FilterRedirector</filter-name>
- <url-pattern>/FilterRedirector</url-pattern>
- </filter-mapping>
-
- <servlet>
- <servlet-name>ServletRedirector</servlet-name>
-
<servlet-class>org.apache.cactus.server.ServletTestRedirector</servlet-class>
- </servlet>
-
- <servlet>
- <servlet-name>ServletRedirectorSecure</servlet-name>
-
<servlet-class>org.apache.cactus.server.ServletTestRedirector</servlet-class>
- </servlet>
-
- <servlet>
- <servlet-name>JspRedirector</servlet-name>
- <jsp-file>/jspRedirector.jsp</jsp-file>
- </servlet>
-
- <servlet-mapping>
- <servlet-name>ServletRedirector</servlet-name>
- <url-pattern>/ServletRedirector</url-pattern>
- </servlet-mapping>
-
- <servlet-mapping>
- <servlet-name>ServletRedirectorSecure</servlet-name>
- <url-pattern>/ServletRedirectorSecure</url-pattern>
- </servlet-mapping>
-
- <servlet-mapping>
- <servlet-name>JspRedirector</servlet-name>
- <url-pattern>/JspRedirector</url-pattern>
- </servlet-mapping>
-
- <!-- Authentication -->
-
- <security-constraint>
- <web-resource-collection>
- <web-resource-name>SecurityRestriction</web-resource-name>
- <description>Protect the Cactus redirector servlet.</description>
- <url-pattern>/ServletRedirectorSecure</url-pattern>
- <http-method>GET</http-method>
- <http-method>POST</http-method>
- </web-resource-collection>
- <auth-constraint>
- <description>Authorized Users Group</description>
- <role-name>test</role-name>
- </auth-constraint>
- <user-data-constraint>
- <transport-guarantee>NONE</transport-guarantee>
- </user-data-constraint>
- </security-constraint>
-
- <login-config>
- <auth-method>BASIC</auth-method>
- </login-config>
-
- <security-role>
- <description>Test role</description>
- <role-name>test</role-name>
- </security-role>
-
- <!-- End Authentication -->
+ <!-- Empty web.xml to use when the user project does not provide a web.xml.
+ We need a web.xml in order to perform the merge with our web.xml
+ DVSL template. See plugin.jelly. -->
</web-app>
1.1 jakarta-turbine-maven/src/plugins-build/cactus/conf/web.xml.dvsl
Index: web.xml.dvsl
===================================================================
#match ("web-app")
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
$context.applyTemplates("icon")
$context.applyTemplates("display-name")
$context.applyTemplates("description")
$context.applyTemplates("distributable")
$context.applyTemplates("context-param")
<filter>
<filter-name>FilterRedirector</filter-name>
<filter-class>org.apache.cactus.server.FilterTestRedirector</filter-class>
</filter>
$context.applyTemplates("filter")
<filter-mapping>
<filter-name>FilterRedirector</filter-name>
<url-pattern>/FilterRedirector</url-pattern>
</filter-mapping>
$context.applyTemplates("filter-mapping")
$context.applyTemplates("listener")
<servlet>
<servlet-name>ServletRedirector</servlet-name>
<servlet-class>org.apache.cactus.server.ServletTestRedirector</servlet-class>
</servlet>
<servlet>
<servlet-name>ServletRedirectorSecure</servlet-name>
<servlet-class>org.apache.cactus.server.ServletTestRedirector</servlet-class>
</servlet>
<servlet>
<servlet-name>JspRedirector</servlet-name>
<jsp-file>/jspRedirector.jsp</jsp-file>
</servlet>
$context.applyTemplates("servlet")
<servlet-mapping>
<servlet-name>ServletRedirector</servlet-name>
<url-pattern>/ServletRedirector</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>ServletRedirectorSecure</servlet-name>
<url-pattern>/ServletRedirectorSecure</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>JspRedirector</servlet-name>
<url-pattern>/JspRedirector</url-pattern>
</servlet-mapping>
$context.applyTemplates("servlet-mapping")
$context.applyTemplates("session-config")
$context.applyTemplates("mime-mapping")
$context.applyTemplates("welcome-file-list")
$context.applyTemplates("error-page")
$context.applyTemplates("taglib")
$context.applyTemplates("resource-env-ref")
$context.applyTemplates("resource-ref")
<security-constraint>
<web-resource-collection>
<web-resource-name>SecurityRestriction</web-resource-name>
<description>Protect the Cactus redirector servlet.</description>
<url-pattern>/ServletRedirectorSecure</url-pattern>
<http-method>GET</http-method>
<http-method>POST</http-method>
</web-resource-collection>
<auth-constraint>
<description>Authorized Users Group</description>
<role-name>test</role-name>
</auth-constraint>
<user-data-constraint>
<transport-guarantee>NONE</transport-guarantee>
</user-data-constraint>
</security-constraint>
$context.applyTemplates("security-constraint")
<login-config>
<auth-method>BASIC</auth-method>
</login-config>
<security-role>
<description>Test role</description>
<role-name>test</role-name>
</security-role>
$context.applyTemplates("security-role")
$context.applyTemplates("env-entry")
$context.applyTemplates("ejb-ref")
$context.applyTemplates("ejb-local-ref")
</web-app>
#end
## -----------------------------------------------------
## D E F A U L T C O P Y
## -----------------------------------------------------
#match( "text()" )$node.value()#end
#match( "@*" ) $node.name()="$node.value()"#end
#match("*")
#if ($node.name() == "source")
$context.applyTemplates("source");
#else<$node.name()$context.applyTemplates("@*")>#foreach($n in
$node.children())$context.applyTemplates($n)#end</$node.name()>
#end
#end
1.17 +33 -5 jakarta-turbine-maven/src/plugins-build/cactus/plugin.jelly
Index: plugin.jelly
===================================================================
RCS file: /home/cvs/jakarta-turbine-maven/src/plugins-build/cactus/plugin.jelly,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- plugin.jelly 12 Nov 2002 11:52:11 -0000 1.16
+++ plugin.jelly 12 Nov 2002 13:45:31 -0000 1.17
@@ -97,10 +97,37 @@
<!--
========================================================================
- Generate an expanded Cactus webapp from a project expanded webapp.
+ Generate a web.xml which is the merge betweem the user project web.xml
+ and the webapp elements needed by Cactus.
+ ========================================================================
+ -->
+ <goal name="cactus:merge-webxml" prereqs="init-dvsl-tag">
+
+ <available file="${maven.war.webxml}"
+ property="maven.cactus.webxml.exists"/>
+
+ <j:choose>
+ <j:when test="${maven.cactus.webxml.exists}">
+ <j:set var="webxml" value="${maven.war.webxml}"/>
+ </j:when>
+ <j:otherwise>
+ <j:set var="webxml" value="${maven.cactus.emptywebxml}"/>
+ </j:otherwise>
+ </j:choose>
- Note: ${maven.cactus.webxml} need to be set and point to a valid
- web.xml prior to calling this goal.
+ <dvsl:dvsl
+ basedir="${basedir}"
+ style="${maven.cactus.webxml.dvsl}"
+ toolboxFile="${plugin.dir}/toolbox.props"
+ in="${webxml}"
+ out="${maven.cactus.build.dir}/${pom.id}/WEB-INF/web.xml">
+ </dvsl:dvsl>
+
+ </goal>
+
+ <!--
+ ========================================================================
+ Generate an expanded Cactus webapp from a project expanded webapp.
========================================================================
-->
<goal name="cactus:webapp-update" prereqs="cactus:compile">
@@ -109,8 +136,9 @@
<copy todir="${maven.cactus.build.dir}/${pom.id}"
file="${maven.cactus.jspRedirector}"/>
- <copy todir="${maven.cactus.build.dir}/${pom.id}/WEB-INF"
- file="${maven.cactus.webxml}"/>
+ <!-- Create the web.xml which is result of merging the project web.xml
+ and the elements needed by Cactus -->
+ <attainGoal name="cactus:merge-webxml"/>
<!-- Copy Cactus jars -->
<copy todir="${maven.cactus.build.dir}/${pom.id}/WEB-INF/lib"
1.7 +5 -4 jakarta-turbine-maven/src/plugins-build/cactus/plugin.properties
Index: plugin.properties
===================================================================
RCS file:
/home/cvs/jakarta-turbine-maven/src/plugins-build/cactus/plugin.properties,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- plugin.properties 11 Nov 2002 20:41:24 -0000 1.6
+++ plugin.properties 12 Nov 2002 13:45:31 -0000 1.7
@@ -12,10 +12,11 @@
# maven.cactus.resin2x.home = C:/Apps/resin-2.1.4
# maven.cactus.weblogic7x.home = C:/bea
-# If you need to put project specific information in the deployed
-# web.xml, you need to override the following property and provide
-# your own web.xml
-maven.cactus.webxml = ${plugin.dir}/conf/web.xml
+# DVSL Template to merge user web.xml to entries needed by Cactus
+maven.cactus.webxml.dvsl = ${plugin.dir}/conf/web.xml.dvsl
+
+# Empty web.xml to use if the user project does not provide a web.xml file
+maven.cactus.emptywebxml = ${plugin.dir}/conf/web.xml
# Location of Cactus JSP Redirector
maven.cactus.jspRedirector = ${plugin.dir}/conf/web/jspRedirector.jsp
1.13 +4 -3 jakarta-turbine-maven/src/plugins-build/cactus/xdocs/changes.xml
Index: changes.xml
===================================================================
RCS file:
/home/cvs/jakarta-turbine-maven/src/plugins-build/cactus/xdocs/changes.xml,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- changes.xml 11 Nov 2002 20:41:24 -0000 1.12
+++ changes.xml 12 Nov 2002 13:45:31 -0000 1.13
@@ -8,6 +8,10 @@
<body>
<release version="1.1" date="in CVS">
+ <action dev="vmassol" type="update">
+ The <code>web.xml</code> elements required for Cactus are now
+ automatically added to the user project <code>web.xml</code>.
+ </action>
<action dev="vmassol" type="add">
Added support for running the tests using the JUnit Swing Test Runner.
Simply create the following Maven property
@@ -30,9 +34,6 @@
</action>
<action dev="vmassol" type="add">
Support for WebLogic 7.x.
- </action>
- <action dev="vmassol" type="fix">
- Fix bug which prevented overriding the default web.xml.
</action>
</release>
1.6 +4 -0
jakarta-turbine-maven/src/plugins-build/cactus/xdocs/features.xml
Index: features.xml
===================================================================
RCS file:
/home/cvs/jakarta-turbine-maven/src/plugins-build/cactus/xdocs/features.xml,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- features.xml 11 Nov 2002 20:44:30 -0000 1.5
+++ features.xml 12 Nov 2002 13:45:31 -0000 1.6
@@ -37,6 +37,10 @@
Ability to use either the Text or Swing Test Runner for running the
Cactus tests.
</li>
+ <li>
+ Automatically merge the <code>web.xml</code> elements needed by
+ Cactus to the user project <code>web.xml</code> file.
+ </li>
</ul>
</section>
</body>
--
To unsubscribe, e-mail: <mailto:turbine-maven-dev-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:turbine-maven-dev-help@;jakarta.apache.org>