[seam-commits] Seam SVN: r10616 - in examples/trunk: booking/seam-booking-ear and 5 other directories.
seam-commits at lists.jboss.org
seam-commits at lists.jboss.org
Thu Apr 23 17:32:32 EDT 2009
Author: dan.j.allen
Date: 2009-04-23 17:32:32 -0400 (Thu, 23 Apr 2009)
New Revision: 10616
Removed:
examples/trunk/servlet-booking/src/main/java/org/jboss/webbeans/
Modified:
examples/trunk/booking/pom.xml
examples/trunk/booking/readme.txt
examples/trunk/booking/seam-booking-ear/pom.xml
examples/trunk/servlet-booking/pom.xml
examples/trunk/servlet-booking/readme.txt
examples/trunk/servlet-booking/src/main/java/org/jboss/seam/examples/booking/BeanLookup.java
examples/trunk/servlet-booking/src/main/webapp/META-INF/context.xml
examples/trunk/servlet-booking/src/main/webapp/WEB-INF/faces-config.xml
examples/trunk/servlet-booking/src/main/webapp/WEB-INF/jetty-env.xml
examples/trunk/servlet-booking/src/main/webapp/WEB-INF/web.xml
Log:
add remaining tomcat and jetty support to servlet-booking
add exploded EAR deployment and undeployment to booking
clean up poms, move versions to version-matrix
upgrade servlet-booking to JSF 2
update instructions
Modified: examples/trunk/booking/pom.xml
===================================================================
--- examples/trunk/booking/pom.xml 2009-04-23 20:33:10 UTC (rev 10615)
+++ examples/trunk/booking/pom.xml 2009-04-23 21:32:32 UTC (rev 10616)
@@ -12,8 +12,8 @@
<artifactId>seam-booking</artifactId>
<packaging>pom</packaging>
- <name>Seam Booking Example</name>
- <description>Seam Booking Example</description>
+ <name>Seam Booking Example (Java EE 5)</name>
+ <description>The Seam booking example for deployment to a Java EE 5 application server</description>
<modules>
<module>${project.artifactId}-ejb</module>
@@ -27,7 +27,6 @@
<plugins>
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
@@ -36,7 +35,6 @@
</plugin>
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ejb-plugin</artifactId>
<configuration>
<ejbVersion>3.0</ejbVersion>
@@ -47,6 +45,17 @@
</pluginManagement>
</build>
+ <profiles>
+
+ <profile>
+ <id>explode</id>
+ <properties>
+ <maven.test.skip>true</maven.test.skip>
+ </properties>
+ </profile>
+
+ </profiles>
+
<dependencyManagement>
<dependencies>
Modified: examples/trunk/booking/readme.txt
===================================================================
--- examples/trunk/booking/readme.txt 2009-04-23 20:33:10 UTC (rev 10615)
+++ examples/trunk/booking/readme.txt 2009-04-23 21:32:32 UTC (rev 10616)
@@ -18,21 +18,39 @@
mvn
Then, set the JBOSS_HOME environment variable to the location of a JBoss AS 5
-installation. Once that's done, execute the following command to deploy the
-application to JBoss AS via JMX:
+installation and start the server. Maven will assume that JBoss AS is running
+on port 8080. Once that's done, you can deploy the application to JBoss AS via
+JMX by executing this command:
- mvn -f seam-booking-ear/pom.xml jboss:deploy
+ mvn -o -f seam-booking-ear/pom.xml jboss:deploy
You can undeploy the application via JMX using this command:
- mvn -f seam-booking-ear/pom.xml jboss:undeploy
+ mvn -o -f seam-booking-ear/pom.xml jboss:undeploy
-Here's the chained restart command:
+Here's the chained restart command via JMX:
- mvn -f seam-booking-ear/pom.xml jboss:undeploy && mvn package && mvn -f seam-booking-ear/pom.xml jboss:deploy
+ mvn -o -f seam-booking-ear/pom.xml jboss:undeploy && mvn -o package && mvn -o -f seam-booking-ear/pom.xml jboss:deploy
If you would rather deploy more traditional way by copying the archive directly
to the deploy directory of the JBoss AS domain, use this command instead:
- mvn -f seam-booking-ear/pom.xml jboss:harddeploy
+ mvn -o -f seam-booking-ear/pom.xml jboss:harddeploy
+But it's better to use the antrun plugin since it is smarter about what it
+copies, which is bound to the end of the package goal when the jboss-explode
+profile is active:
+
+ mvn -o package -Pexplode
+
+You can remove the archive by activating the jboss-unexplode profile:
+
+ mvn -o validate -Punexplode
+
+Note that the -o puts Maven in offline mode so that it doesn't perform time
+consuming update checks.
+
+---
+When this profile is activated, the maven-antrun-plugin will copy the exploded
+packages for the WAR, EJB-JAR, and EAR to the JBoss AS deploy directory. This
+all happens in the maven package phase.
Modified: examples/trunk/booking/seam-booking-ear/pom.xml
===================================================================
--- examples/trunk/booking/seam-booking-ear/pom.xml 2009-04-23 20:33:10 UTC (rev 10615)
+++ examples/trunk/booking/seam-booking-ear/pom.xml 2009-04-23 21:32:32 UTC (rev 10616)
@@ -19,8 +19,17 @@
<finalName>${project.parent.artifactId}</finalName>
<plugins>
+ <!--
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>jboss-maven-plugin</artifactId>
+ <configuration>
+ <fileName>${project.build.directory}/${project.build.finalName}</fileName>
+ </configuration>
+ </plugin>
+ -->
+
+ <plugin>
<artifactId>maven-ear-plugin</artifactId>
<configuration>
<defaultJavaBundleDir>lib</defaultJavaBundleDir>
@@ -39,12 +48,119 @@
<contextRoot>/seam-booking</contextRoot>
</webModule>
</modules>
+ <version>5</version>
</configuration>
</plugin>
</plugins>
</build>
+ <properties>
+ <jboss.home>${env.JBOSS_HOME}</jboss.home>
+ </properties>
+
+ <profiles>
+
+ <profile>
+ <id>explode</id>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <configuration>
+ <tasks>
+ <property name="archive.name" value="${project.build.finalName}"/>
+ <property name="ear.staging.dir" value="${project.build.directory}/${archive.name}"/>
+ <property name="ejb-jar.staging.dir" value="../${archive.name}-ejb/target/classes"/>
+ <property name="war.staging.dir" value="../${archive.name}-war/target/${archive.name}"/>
+
+ <property name="ear.deploy.dir" value="${jboss.home}/server/default/deploy/${archive.name}.ear"/>
+ <property name="ejb-jar.deploy.dir" value="${ear.deploy.dir}/${archive.name}-ejb.jar"/>
+ <property name="war.deploy.dir" value="${ear.deploy.dir}/${archive.name}.war"/>
+
+ <condition property="deployed">
+ <available file="${ear.deploy.dir}"/>
+ </condition>
+
+ <mkdir dir="${ear.deploy.dir}"/>
+ <mkdir dir="${ejb-jar.deploy.dir}"/>
+ <mkdir dir="${war.deploy.dir}"/>
+
+ <copy todir="${ejb-jar.deploy.dir}" verbose="false" preservelastmodified="true" includeEmptyDirs="false">
+ <fileset dir="${ejb-jar.staging.dir}"/>
+ </copy>
+
+ <!-- This reads "if none of the files in EJB-JAR are newer than application.xml, set the property ejb-jar.unchanged" -->
+ <uptodate property="ejb-jar.unchanged" targetfile="${ear.deploy.dir}/META-INF/application.xml">
+ <srcfiles dir="${ejb-jar.deploy.dir}" includes="**/*"/>
+ </uptodate>
+
+ <!-- Only touch application.xml if the application is not yet deployed or a file in EJB-JAR has changed -->
+ <condition property="restart">
+ <or>
+ <not><isset property="deployed"/></not>
+ <not><isset property="ejb-jar.unchanged"/></not>
+ </or>
+ </condition>
+
+ <copy todir="${war.deploy.dir}" verbose="false" preservelastmodified="true" includeEmptyDirs="false">
+ <fileset dir="${war.staging.dir}"/>
+ </copy>
+
+ <!-- do a checksum to see if application.xml, jboss-app.xml, or -ds.xml need to be updated -->
+ <!-- this copy implicitly touches application.xml if the restart property is set since it is generated each time -->
+ <copy todir="${ear.deploy.dir}" verbose="false" preservelastmodified="true" includeEmptyDirs="false">
+ <fileset dir="${ear.staging.dir}">
+ <include name="**/*" if="restart"/>
+ <exclude name="**/*" unless="restart"/>
+ <exclude name="*.war"/>
+ <exclude name="*.jar"/>
+ </fileset>
+ </copy>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ </plugins>
+ </build>
+ </profile>
+
+ <profile>
+ <id>unexplode</id>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>validate</phase>
+ <configuration>
+ <tasks>
+ <property name="ear.deploy.dir" value="${env.JBOSS_HOME}/server/default/deploy/${project.build.finalName}.ear"/>
+ <delete dir="${ear.deploy.dir}" quiet="true" failonerror="true"/>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ </plugins>
+ </build>
+ </profile>
+
+ </profiles>
+
<dependencies>
<dependency>
Modified: examples/trunk/servlet-booking/pom.xml
===================================================================
--- examples/trunk/servlet-booking/pom.xml 2009-04-23 20:33:10 UTC (rev 10615)
+++ examples/trunk/servlet-booking/pom.xml 2009-04-23 21:32:32 UTC (rev 10616)
@@ -12,7 +12,8 @@
<artifactId>seam-servlet-booking</artifactId>
<packaging>war</packaging>
- <name>Seam Booking Example (Servlet Container)</name>
+ <name>Seam Booking Example (Servlet)</name>
+ <description>The Seam booking example for deployment to a servlet container</description>
<build>
<defaultGoal>package</defaultGoal>
@@ -22,14 +23,16 @@
<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) -->
+ <url>http://localhost:${tomcat.http.port}/manager</url>
+ <port>${embedded-tomcat.http.port}</port> <!-- port for embedded Tomcat only (putting this configuration in the execution for the run goal doesn't work) -->
+ <!--
+ <warSourceDirectory>${project.build.directory}/${project.build.finalName}</warSourceDirectory>
+ -->
</configuration>
<dependencies>
</dependencies>
@@ -38,11 +41,10 @@
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
- <version>6.1.16</version>
<configuration>
<connectors>
<connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
- <port>${jetty.run.port}</port>
+ <port>${jetty.http.port}</port>
<maxIdleTime>3600000</maxIdleTime>
</connector>
</connectors>
@@ -50,6 +52,9 @@
<webAppConfig>
<contextPath>/${project.build.finalName}</contextPath>
</webAppConfig>
+ <!--
+ <webAppSourceDirectory>${project.build.directory}/${project.build.finalName}</webAppSourceDirectory>
+ -->
</configuration>
<dependencies>
</dependencies>
@@ -59,11 +64,11 @@
</build>
<properties>
- <jetty.run.port>9090</jetty.run.port>
+ <jetty.http.port>9090</jetty.http.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>
+ <tomcat.http.port>8080</tomcat.http.port>
+ <embedded-tomcat.http.port>9090</embedded-tomcat.http.port>
+ <embedded-tomcat.debug.port>9190</embedded-tomcat.debug.port>
</properties>
<dependencies>
@@ -76,11 +81,13 @@
</dependency>
<!-- disable after upgrading to JSF 2 -->
+ <!--
<dependency>
<groupId>com.sun.facelets</groupId>
<artifactId>jsf-facelets</artifactId>
<scope>runtime</scope>
</dependency>
+ -->
<dependency>
<groupId>javax.annotation</groupId>
@@ -90,14 +97,20 @@
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-api</artifactId>
+ <!--
<version>1.2_12</version>
+ -->
+ <version>2.0.0-PR2_1</version>
</dependency>
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-impl</artifactId>
<scope>runtime</scope>
+ <!--
<version>1.2_12</version>
+ -->
+ <version>2.0.0-PR2_1</version>
</dependency>
<dependency>
@@ -109,7 +122,7 @@
<dependency>
<groupId>org.jboss.webbeans.servlet</groupId>
<artifactId>webbeans-servlet</artifactId>
- <scope>compile</scope> <!-- change to runtime after removing ManagerReference -->
+ <scope>runtime</scope>
</dependency>
</dependencies>
Modified: examples/trunk/servlet-booking/readme.txt
===================================================================
--- examples/trunk/servlet-booking/readme.txt 2009-04-23 20:33:10 UTC (rev 10615)
+++ examples/trunk/servlet-booking/readme.txt 2009-04-23 21:32:32 UTC (rev 10616)
@@ -26,11 +26,16 @@
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:
+If you want to run the application on a standalone Tomcat 6, first download and
+extract Tomcat 6. This build assumes you will be running Tomcat in its default
+configuration, with a hostname of localhost and port 8080. Before starting
+Tomcat, add the following line to conf/tomcat-users.xml to allow the Maven
+Tomcat plugin to access the manager application, then start Tomcat:
+ <user username="admin" password="" roles="manager"/>
+
+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:
@@ -55,3 +60,8 @@
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.
+
+---
+Have to decide if you want war:inplace which mixes compiled files w/ source
+files but gives you instant change or change the warSourceDirectory and require
+war:exploded to be run to see changes take affect.
Modified: examples/trunk/servlet-booking/src/main/java/org/jboss/seam/examples/booking/BeanLookup.java
===================================================================
--- examples/trunk/servlet-booking/src/main/java/org/jboss/seam/examples/booking/BeanLookup.java 2009-04-23 20:33:10 UTC (rev 10615)
+++ examples/trunk/servlet-booking/src/main/java/org/jboss/seam/examples/booking/BeanLookup.java 2009-04-23 21:32:32 UTC (rev 10616)
@@ -2,14 +2,14 @@
import java.util.logging.Level;
import java.util.logging.Logger;
-//import javax.faces.ManagedBean;
-//import javax.faces.RequestScoped;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.RequestScoped;
import javax.inject.manager.Manager;
import javax.naming.InitialContext;
import javax.naming.NamingException;
-//@ManagedBean
-//@RequestScoped
+ at ManagedBean(name = "beanLookup")
+ at RequestScoped
public class BeanLookup {
public void lookupManager() {
try {
Modified: examples/trunk/servlet-booking/src/main/webapp/META-INF/context.xml
===================================================================
--- examples/trunk/servlet-booking/src/main/webapp/META-INF/context.xml 2009-04-23 20:33:10 UTC (rev 10615)
+++ examples/trunk/servlet-booking/src/main/webapp/META-INF/context.xml 2009-04-23 21:32:32 UTC (rev 10616)
@@ -4,5 +4,5 @@
<Resource name="jcdi/Manager"
auth="Container"
type="javax.inject.manager.Manager"
- factory="org.jboss.webbeans.resources.ManagerReferenceFactory"/>
+ factory="org.jboss.webbeans.resources.ManagerObjectFactory"/>
</Context>
Modified: examples/trunk/servlet-booking/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- examples/trunk/servlet-booking/src/main/webapp/WEB-INF/faces-config.xml 2009-04-23 20:33:10 UTC (rev 10615)
+++ examples/trunk/servlet-booking/src/main/webapp/WEB-INF/faces-config.xml 2009-04-23 21:32:32 UTC (rev 10616)
@@ -6,13 +6,17 @@
<application>
<!-- disable after upgrading to JSF 2 -->
+ <!--
<view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
+ -->
</application>
+ <!--
<managed-bean>
<managed-bean-name>beanLookup</managed-bean-name>
- <managed-bean-class>org.jboss.seam.examples.booking.BeanLookup</managed-bean-class>
- <managed-bean-scope>request</managed-bean-scope>
+ <managed-bean-class>org.jboss.seam.examples.booking.BeanLookup</managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
</managed-bean>
+ -->
</faces-config>
Modified: examples/trunk/servlet-booking/src/main/webapp/WEB-INF/jetty-env.xml
===================================================================
--- examples/trunk/servlet-booking/src/main/webapp/WEB-INF/jetty-env.xml 2009-04-23 20:33:10 UTC (rev 10615)
+++ examples/trunk/servlet-booking/src/main/webapp/WEB-INF/jetty-env.xml 2009-04-23 21:32:32 UTC (rev 10616)
@@ -2,11 +2,24 @@
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN"
"http://jetty.mortbay.org/configure.dtd">
<Configure id="webAppCtx" class="org.mortbay.jetty.webapp.WebAppContext">
+ <!--
<New id="jdci" class="org.mortbay.jetty.plus.naming.Resource">
<Arg><Ref id="webAppCtx"/></Arg>
<Arg>jcdi/Manager</Arg>
<Arg>
- <New class="org.jboss.webbeans.resources.ManagerReferenceFactory"/>
+ <New class="org.jboss.webbeans.resources.ManagerObjectFactoryReference"/>
</Arg>
</New>
+ -->
+ <New id="jdciManager" class="org.mortbay.jetty.plus.naming.Resource">
+ <Arg><Ref id="webAppCtx"/></Arg>
+ <Arg>jcdi/Manager</Arg>
+ <Arg>
+ <New class="javax.naming.Reference">
+ <Arg>javax.inject.manager.Manager</Arg>
+ <Arg>org.jboss.webbeans.resources.ManagerObjectFactory</Arg>
+ <Arg/>
+ </New>
+ </Arg>
+ </New>
</Configure>
Modified: examples/trunk/servlet-booking/src/main/webapp/WEB-INF/web.xml
===================================================================
--- examples/trunk/servlet-booking/src/main/webapp/WEB-INF/web.xml 2009-04-23 20:33:10 UTC (rev 10615)
+++ examples/trunk/servlet-booking/src/main/webapp/WEB-INF/web.xml 2009-04-23 21:32:32 UTC (rev 10616)
@@ -7,10 +7,12 @@
<display-name>Seam Booking Example (Servlet Container)</display-name>
<!-- disable after upgrading to JSF 2 -->
+ <!--
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.xhtml</param-value>
</context-param>
+ -->
<context-param>
<param-name>facelets.DEVELOPMENT</param-name>
More information about the seam-commits
mailing list