Title: [waffle-scm] [627] trunk: Moved webapp build profiles to examples/pom.xml.
Revision
627
Author
mauro
Date
2008-04-19 10:16:26 -0500 (Sat, 19 Apr 2008)

Log Message

Moved webapp build profiles to examples/pom.xml.
Attempts to delete expanded webapp directory (relevant eg for tomcat).
Cleanup of freemarker-example web.xml.

Modified Paths

Diff

Modified: trunk/BUILD.txt (626 => 627)

--- trunk/BUILD.txt	2008-04-19 13:46:15 UTC (rev 626)
+++ trunk/BUILD.txt	2008-04-19 15:16:26 UTC (rev 627)
@@ -10,9 +10,8 @@
 - reporting:  builds reports
 - distribution:  builds distribution
 - integration:  builds integration tests
-- examples:  builds examples
-- nt: no-test, builds skipping unit tests 
-- jetty|tomcat|geronimo:  set webapp.deploy.dir to the appropriate value
+- nt: no-test: builds skipping unit tests 
+- examples:  builds examples (using profile [jetty|tomcat|geronimo] copies example wars upon install to the appropriate deploy dir)
 
 Note:  profiles are additive and the default profile is always active.
 Eg, build with integration tests, reporting and distribution:
@@ -21,4 +20,4 @@
 
 Build and deploy examples to Jetty (skipping tests on releasable modules):
 
-mvn -Pexamples,nt,jetty install
+mvn -Pnt,examples,jetty install

Modified: trunk/examples/freemarker-example/src/main/java/org/codehaus/waffle/example/freemarker/controller/PersonController.java (626 => 627)

--- trunk/examples/freemarker-example/src/main/java/org/codehaus/waffle/example/freemarker/controller/PersonController.java	2008-04-19 13:46:15 UTC (rev 626)
+++ trunk/examples/freemarker-example/src/main/java/org/codehaus/waffle/example/freemarker/controller/PersonController.java	2008-04-19 15:16:26 UTC (rev 627)
@@ -1,5 +1,6 @@
 package org.codehaus.waffle.example.freemarker.controller;
 
+import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
@@ -9,7 +10,8 @@
 import org.codehaus.waffle.example.freemarker.persister.PersistablePerson;
 import org.codehaus.waffle.example.freemarker.persister.PersonPersister;
 
-public class PersonController {
[EMAIL PROTECTED]("serial")
+public class PersonController implements Serializable {
     private final PersonPersister persister;
     private Person person;
     private List<String> selectedIds = new ArrayList<String>();

Modified: trunk/examples/freemarker-example/src/main/webapp/WEB-INF/web.xml (626 => 627)

--- trunk/examples/freemarker-example/src/main/webapp/WEB-INF/web.xml	2008-04-19 13:46:15 UTC (rev 626)
+++ trunk/examples/freemarker-example/src/main/webapp/WEB-INF/web.xml	2008-04-19 15:16:26 UTC (rev 627)
@@ -6,7 +6,7 @@
 
   <display-name>Waffle Freemarker/Sitemesh Example</display-name>
 
-  <!-- 1. This is how an application registers its custom Registrar -->
+  <!-- Waffle Registrar and custom components -->
   <context-param>
     <param-name>org.codehaus.waffle.registrar.Registrar</param-name>
     <param-value>org.codehaus.waffle.example.freemarker.FreemarkerRegistrar</param-value>
@@ -24,37 +24,33 @@
     <param-value>org.codehaus.waffle.bind.converters.ListValueConverter</param-value>
   </context-param>
 
-  <!-- 3. Waffle context listener (ServletContext and HttpSession) -->
+  <!-- Waffle context listener -->
   <listener>
     <listener-class>org.codehaus.waffle.context.pico.PicoWaffleContextListener</listener-class>
   </listener>
 
-  <!-- Sitemesh's filter -->
+  <!-- Filters -->
   <filter>
-    <filter-name>sitemesh</filter-name>
+    <filter-name>sitemesh-page</filter-name>
     <filter-class>com.opensymphony.module.sitemesh.filter.PageFilter</filter-class>
   </filter>
 
-  <!-- 4. Waffle request filter (responsible for request level context) -->
   <filter>
-    <filter-name>WaffleRequestFilter</filter-name>
+    <filter-name>waffle-request</filter-name>
     <filter-class>org.codehaus.waffle.context.WaffleRequestFilter</filter-class>
   </filter>
 
-  <!-- Sitemesh's filter mapping -->
   <filter-mapping>
-    <filter-name>sitemesh</filter-name>
+    <filter-name>sitemesh-page</filter-name>
     <url-pattern>/*</url-pattern>
   </filter-mapping>
 
-
-  <!-- 4. Waffle request filter mapping -->
   <filter-mapping>
-    <filter-name>WaffleRequestFilter</filter-name>
+    <filter-name>waffle-request</filter-name>
     <url-pattern>*.foo</url-pattern>
   </filter-mapping>
 
-  <!-- 5. Register Waffle's FrontController servlet -->
+  <!-- Servlets -->
   <servlet>
     <servlet-name>waffle</servlet-name>
     <servlet-class>org.codehaus.waffle.servlet.WaffleServlet</servlet-class>
@@ -65,7 +61,6 @@
     <load-on-startup>1</load-on-startup>
   </servlet>
 
-  <!-- Sitemesh's freemarker servlet -->
   <servlet>
     <servlet-name>sitemesh-freemarker</servlet-name>
     <servlet-class>com.opensymphony.module.sitemesh.freemarker.FreemarkerDecoratorServlet</servlet-class>
@@ -74,27 +69,28 @@
       <param-value>/</param-value>
     </init-param>
     <init-param>
-      <param-name>default_encoding</param-name>
-      <param-value>ISO-8859-1</param-value>
+      <param-name>object_wrapper</param-name>
+      <param-value>beans</param-value>
     </init-param>
-    <load-on-startup>1</load-on-startup>
+    <load-on-startup>2</load-on-startup>
   </servlet>
 
-  <!-- Sitemesh's freemarker servlet mapping -->
   <servlet-mapping>
-    <servlet-name>sitemesh-freemarker</servlet-name>
-    <url-pattern>*.htm</url-pattern>
+    <servlet-name>waffle</servlet-name>
+    <url-pattern>*.foo</url-pattern>
   </servlet-mapping>
 
   <servlet-mapping>
-    <servlet-name>waffle</servlet-name>
-    <url-pattern>*.foo</url-pattern>
+    <servlet-name>sitemesh-freemarker</servlet-name>
+    <url-pattern>*.htm</url-pattern>
   </servlet-mapping>
 
+  <!-- Welcome files -->
   <welcome-file-list>
     <welcome-file>index.html</welcome-file>
   </welcome-file-list>
 
+  <!-- Security -->
   <security-constraint>
     <web-resource-collection>
       <web-resource-name>no_access</web-resource-name>

Modified: trunk/examples/pom.xml (626 => 627)

--- trunk/examples/pom.xml	2008-04-19 13:46:15 UTC (rev 626)
+++ trunk/examples/pom.xml	2008-04-19 15:16:26 UTC (rev 627)
@@ -1,4 +1,5 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
   <modelVersion>4.0.0</modelVersion>
   <parent>
     <groupId>org.codehaus.waffle</groupId>
@@ -17,7 +18,7 @@
     <module>migration-example</module>
     <module>mydvds-example</module>
   </modules>
-  
+
   <dependencies>
     <dependency>
       <groupId>${pom.groupId}</groupId>
@@ -42,13 +43,13 @@
     <dependency>
       <groupId>javax.servlet</groupId>
       <artifactId>jstl</artifactId>
-      <scope>runtime</scope>      
+      <scope>runtime</scope>
     </dependency>
     <dependency>
       <groupId>taglibs</groupId>
       <artifactId>standard</artifactId>
       <scope>runtime</scope>
-    </dependency>    
+    </dependency>
     <dependency>
       <groupId>commons-logging</groupId>
       <artifactId>commons-logging</artifactId>
@@ -57,67 +58,90 @@
     <dependency>
       <groupId>log4j</groupId>
       <artifactId>log4j</artifactId>
-      <version>1.2.14</version>      
+      <version>1.2.14</version>
     </dependency>
   </dependencies>
 
   <build>
     <plugins>
-       <plugin>
-         <groupId>org.apache.maven.plugins</groupId>
-         <artifactId>maven-war-plugin</artifactId>
-       </plugin>
-       <plugin>
-         <groupId>org.apache.maven.plugins</groupId>
-         <artifactId>maven-dependency-plugin</artifactId>
-         <executions>
-           <execution>
-             <id>unpack-resources</id>
-             <phase>process-resources</phase>
-             <goals>
-               <goal>unpack</goal>
-             </goals>
-             <configuration>
-               <outputDirectory>
-                 ${project.build.directory}/${pom.artifactId}-${pom.version}
-               </outputDirectory>
-               <overWriteReleases>false</overWriteReleases>
-               <overWriteSnapshots>true</overWriteSnapshots>
-               <artifactItems>
-                 <artifactItem>
-                   <groupId>${pom.groupId}</groupId>
-                   <artifactId>waffle-resources</artifactId>
-                   <version>${pom.version}</version>
-                 </artifactItem>
-               </artifactItems>
-             </configuration>
-           </execution>
-         </executions>
-       </plugin>
-       <plugin>
-        <groupId>org.codehaus.mojo.groovy</groupId>
-        <artifactId>groovy-maven-plugin</artifactId>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-war-plugin</artifactId>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-dependency-plugin</artifactId>
         <executions>
           <execution>
-            <phase>install</phase>
+            <id>unpack-resources</id>
+            <phase>process-resources</phase>
             <goals>
-              <goal>execute</goal>
+              <goal>unpack</goal>
             </goals>
             <configuration>
-              <source>
-                  def ant = new AntBuilder()
-                  def webapp = "${project.build.directory}/${pom.artifactId}.war"
-                  if ( new File(webapp).exists() ){
-                    ant.echo(message: "Deploying ${webapp} to ${webapp.deploy.dir}")
-                    ant.copy(file: "${webapp}", 
-                            todir: "${webapp.deploy.dir}", verbose: true, overwrite: true)
-                  }
-              </source>
+              <outputDirectory>${project.build.directory}/${pom.artifactId}-${pom.version}</outputDirectory>
+              <overWriteReleases>false</overWriteReleases>
+              <overWriteSnapshots>true</overWriteSnapshots>
+              <artifactItems>
+                <artifactItem>
+                  <groupId>${pom.groupId}</groupId>
+                  <artifactId>waffle-resources</artifactId>
+                  <version>${pom.version}</version>
+                </artifactItem>
+              </artifactItems>
             </configuration>
           </execution>
         </executions>
       </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-antrun-plugin</artifactId>
+        <version>1.1</version>
+        <executions>
+          <execution>
+            <id>deploy-webapp</id>
+            <phase>install</phase>
+            <configuration>
+              <tasks>
+                <echo>Deploying webapp ${webapp.name} to ${webapp.deploy.dir}</echo>
+                <copy file="${project.build.directory}/${webapp.name}.war" todir="${webapp.deploy.dir}" verbose="true"
+                  overwrite="true" failonerror="false" />
+                <delete dir="${webapp.deploy.dir}/${webapp.name}" verbose="true" />
+              </tasks>
+            </configuration>
+            <goals>
+              <goal>run</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
     </plugins>
   </build>
-
+  <profiles>
+    <profile>
+      <!-- Tomcat profile:  equivalent to -Dwebapp.deploy.dir=${env.TOMCAT_HOME}/webapps -->
+      <id>tomcat</id>
+      <properties>
+        <webapp.deploy.dir>${env.TOMCAT_HOME}/webapps</webapp.deploy.dir>
+      </properties>
+    </profile>
+    <profile>
+      <!-- Jetty profile:  equivalent to -Dwebapp.deploy.dir=${env.JETTY_HOME}/webapps -->
+      <id>jetty</id>
+      <properties>
+        <webapp.deploy.dir>${env.JETTY_HOME}/webapps</webapp.deploy.dir>
+      </properties>
+    </profile>
+    <profile>
+      <!-- Geronimo profile:  equivalent to -Dwebapp.deploy.dir=${env.GERONIMO_HOME}/deploy -->
+      <id>geronimo</id>
+      <properties>
+        <webapp.deploy.dir>${env.GERONIMO_HOME}/deploy</webapp.deploy.dir>
+      </properties>
+    </profile>
+  </profiles>
+  <properties>
+    <webapp.name>${pom.artifactId}</webapp.name>
+    <webapp.deploy.dir>${java.io.tmpdir}/webapps</webapp.deploy.dir>
+  </properties>
 </project>

Modified: trunk/pom.xml (626 => 627)

--- trunk/pom.xml	2008-04-19 13:46:15 UTC (rev 626)
+++ trunk/pom.xml	2008-04-19 15:16:26 UTC (rev 627)
@@ -307,31 +307,6 @@
       </reporting>
     </profile>
     <profile>
-      <!-- Tomcat profile:  equivalent to -Dwebapp.deploy.dir=${env.TOMCAT_HOME}/webapps -->
-      <id>tomcat</id>
-      <properties>
-        <webapp.deploy.dir>
-          ${env.TOMCAT_HOME}/webapps
-        </webapp.deploy.dir>
-      </properties>
-    </profile>
-    <profile>
-      <!-- Jetty profile:  equivalent to -Dwebapp.deploy.dir=${env.JETTY_HOME}/webapps -->
-      <id>jetty</id>
-      <properties>
-        <webapp.deploy.dir>${env.JETTY_HOME}/webapps</webapp.deploy.dir>
-      </properties>
-    </profile>
-    <profile>
-      <!-- Geronimo profile:  equivalent to -Dwebapp.deploy.dir=${env.GERONIMO_HOME}/deploy -->
-      <id>geronimo</id>
-      <properties>
-        <webapp.deploy.dir>
-          ${env.GERONIMO_HOME}/deploy
-        </webapp.deploy.dir>
-      </properties>
-    </profile>
-    <profile>
       <!-- integration profile -->
       <id>integration</id>
       <modules>
@@ -354,10 +329,6 @@
     </profile>
   </profiles>
 
-  <properties>
-    <webapp.deploy.dir>${java.io.tmpdir}/webapps</webapp.deploy.dir>
-  </properties>
-
   <licenses>
     <license>
       <name>BSD license</name>


To unsubscribe from this list please visit:

http://xircles.codehaus.org/manage_email

Reply via email to