[seam-commits] Seam SVN: r10605 - examples/trunk/servlet-booking.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Thu Apr 23 02:43:49 EDT 2009


Author: dan.j.allen
Date: 2009-04-23 02:43:49 -0400 (Thu, 23 Apr 2009)
New Revision: 10605

Added:
   examples/trunk/servlet-booking/readme.txt
Modified:
   examples/trunk/servlet-booking/pom.xml
Log:
configured tomcat deployment plugin


Modified: examples/trunk/servlet-booking/pom.xml
===================================================================
--- examples/trunk/servlet-booking/pom.xml	2009-04-23 06:43:31 UTC (rev 10604)
+++ examples/trunk/servlet-booking/pom.xml	2009-04-23 06:43:49 UTC (rev 10605)
@@ -20,6 +20,22 @@
       <plugins>
 
          <plugin>
+            <groupId>org.codehaus.mojo</groupId>
+            <artifactId>tomcat-maven-plugin</artifactId>
+            <version>1.0-beta-1</version>
+            <configuration>
+               <path>/${project.build.finalName}</path>
+               <!-- expecting username to be "admin" and a blank password for manager app -->
+               <!-- configure a server in settings.xml containing <username> and <password> to override -->
+               <!--<server>tomcatserver</server>-->
+               <url>http://localhost:${tomcat.run.port}/manager</url>
+               <port>${embedded-tomcat.run.port}</port> <!-- port for embedded Tomcat only (I don't get how to isolate this config to run goal) -->
+            </configuration>
+            <dependencies>
+            </dependencies>
+         </plugin>
+
+         <plugin>
             <groupId>org.mortbay.jetty</groupId>
             <artifactId>maven-jetty-plugin</artifactId>
             <version>6.1.16</version>
@@ -35,7 +51,8 @@
                   <contextPath>/${project.build.finalName}</contextPath>
                </webAppConfig>
             </configuration>
-            <dependencies/>
+            <dependencies>
+            </dependencies>
          </plugin>
 
       </plugins>
@@ -44,6 +61,9 @@
    <properties>
       <jetty.run.port>9090</jetty.run.port>
       <jetty.debug.port>9190</jetty.debug.port>
+      <tomcat.run.port>8080</tomcat.run.port>
+      <embedded-tomcat.run.port>${jetty.run.port}</embedded-tomcat.run.port>
+      <embedded-tomcat.debug.port>${jetty.debug.port}</embedded-tomcat.debug.port>
    </properties>
 
    <dependencies>

Added: examples/trunk/servlet-booking/readme.txt
===================================================================
--- examples/trunk/servlet-booking/readme.txt	                        (rev 0)
+++ examples/trunk/servlet-booking/readme.txt	2009-04-23 06:43:49 UTC (rev 10605)
@@ -0,0 +1,57 @@
+Seam Booking Example
+====================
+
+This example demonstrates the use of Seam 3 in a Servlet container environment
+(Tomcat 6 or Jetty 6). Contextual state management and dependency injection are
+handled by JSR-299. Transaction and persistence context management is handled
+by the EJB 3 container. No alterations are expected to be made to the Servlet
+container. All services are self-contained within the deployment.
+
+This example uses a Maven 2 build. Execute the following command to build the
+WAR. The WAR will will be located in the target directory after completion of
+the build.
+
+ mvn
+
+Run this command to execute the application in an embedded Jetty 6 container:
+
+ mvn jetty:run
+
+You can also execute the application in an embedded Tomcat 6 container:
+
+ mvn tomcat:run
+
+In both cases, any changes to assets in src/main/webapp will take affect
+immediately. If a change to a configuration file is made, the application will
+automatically redeploy. The redeploy behavior can be fined tuned in the plugin
+configuration (at least for Jetty).
+
+If you want to run the application on a standalone Tomcat 6, first download,
+extract and start Tomcat 6. This build assumes that Tomcat is available at
+localhost on port 8080. You can deploy the packaged archive to Tomcat via HTTP
+PUT using this command:
+
+ mvn package tomcat:deploy
+
+Then you use this command to undeploy the application:
+
+ mvn tomcat:undeploy
+
+Instead of packaging the WAR, you can deploy it as an exploded archive
+immediately after the war goal is finished assembling the exploded structure:
+
+ mvn compile war:exploded tomcat:exploded
+
+Once the application is deployed, you can redeploy it using the following command:
+
+ mvn tomcat:redeploy
+
+But likely you want to run one or more build goals first before you redeploy:
+
+ mvn compile tomcat:redeploy
+ mvn war:exploded tomcat:redeploy
+ mvn compile war:exploded tomcat:redeploy
+
+Use of the war:inplace + tomcat:inplace goals are not recommended as it causes
+files to be copied to your src/main/webapp directory. You may accidently check
+them into the source repository or include them in the deployable archive.




More information about the seam-commits mailing list