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

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Fri May 1 20:24:13 EDT 2009


Author: dan.j.allen
Date: 2009-05-01 20:24:13 -0400 (Fri, 01 May 2009)
New Revision: 10750

Modified:
   examples/trunk/booking/pom.xml
   examples/trunk/booking/readme.txt
Log:
add maven-cli-plugin
document maven-cli-plugin


Modified: examples/trunk/booking/pom.xml
===================================================================
--- examples/trunk/booking/pom.xml	2009-05-02 00:23:53 UTC (rev 10749)
+++ examples/trunk/booking/pom.xml	2009-05-02 00:24:13 UTC (rev 10750)
@@ -46,6 +46,33 @@
 
          </plugins>
       </pluginManagement>
+
+      <plugins>
+
+         <plugin>
+            <groupId>org.twdata.maven</groupId>
+            <artifactId>maven-cli-plugin</artifactId>
+            <version>0.6.3.CR1</version> <!-- TODO move to version-matrix -->
+            <configuration>
+               <!-- userAliases are for cli:execute-phase -->
+               <userAliases>
+                  <explode>package -o -Pexplode</explode>
+                  <deploy>seam-booking-ear package -o org.codehaus.mojo:jboss-maven-plugin:harddeploy</deploy>
+                  <undeploy>seam-booking-ear validate -o -Pundeploy</undeploy>
+                  <unexplode>seam-booking-ear validate -o -Pundeploy</unexplode>
+                  <restart>seam-booking-ear validate -o -Prestart</restart>
+                  <reexplode>package -o -Pundeploy,explode</reexplode>
+                  <!--<redeploy>this requires two distinct steps</redeploy>-->
+                  <profiles>org.apache.maven.plugins:maven-help-plugin:active-profiles -o</profiles>
+                  <pom>org.apache.maven.plugins:maven-help-plugin:effective-pom -o</pom>
+               </userAliases>
+               <!-- commands are for cli:execute -->
+               <commands>
+               </commands>
+            </configuration>
+         </plugin>
+
+      </plugins>
    </build>
 
    <properties>

Modified: examples/trunk/booking/readme.txt
===================================================================
--- examples/trunk/booking/readme.txt	2009-05-02 00:23:53 UTC (rev 10749)
+++ examples/trunk/booking/readme.txt	2009-05-02 00:24:13 UTC (rev 10750)
@@ -2,18 +2,18 @@
 ================================
 
 This example demonstrates the use of Seam 3 in a Java EE 6 environment (or a
-Java EE 5 environment enhanced with JSR-299 [Web Beans] and JSF 2.0).
-Contextual state management and dependency injection are handled by JSR-299.
-Transaction and persistence context management is handled by the EJB 3
-container. Validation of input fields is handled by Bean Validation.
+Java EE 5 environment enhanced with JSR-299 [Web Beans], JSF 2.0 and Bean
+Validation). Contextual state management and dependency injection are handled
+by JSR-299. Transaction and persistence context management is handled by the
+EJB 3 container. Validation of input fields is handled by Bean Validation.
 
 = Prerequisites
 
 Please consult the Web Beans reference documentation for instructions on how to
 deploy the Web Bean implementation to JBoss AS 5. To upgrade the JSF libraries
 to JSF 2.0, go to the Seam jsf-updater-tool module and follow the instructions
-there. You will also need to have Bean Validation installed in the container
-(or added to the classpath) in order for UI validation to work. Installing Bean
+there. You also need to have Bean Validation installed in the container (or
+added to the classpath) in order for UI validation to work. Installing Bean
 Validation is as simple as putting the JARs in the library directory of the
 application server.
 
@@ -26,14 +26,62 @@
 
 Now you're ready to deploy.
 
-= Deploying a packaged archive to JBoss AS
+= Pointing Maven at your JBoss AS installation
 
 First, set the JBOSS_HOME environment variable to the location of a JBoss AS 5
 installation and start the server. You can optionally set the jboss.home Maven
-property in a settings.xml file. Maven assumes JBoss AS is running on port
-8080. (This can be changed in the plugin configuration). Once that's setup, you
-can deploy the application to JBoss AS via JMX by executing this command:
+property in an active profile defined in the $HOME/.m2/settings.xml file.
 
+Maven assumes JBoss AS is running on port 8080. (This can be changed in the
+plugin configuration). Once that's setup, you can deploy the application to
+JBoss AS using Maven.
+
+= Deploying an packaged or exploded archive to JBoss AS (the wicked fast way)
+
+Since this build is based on Maven 2, you're probably thinking you'll need to
+take a stroll to the kitchen for coffee while you wait for the build to run.
+Well, you better have your coffee ready because this build is fast...and easy!
+
+The secret? The Maven 2 CLI plugin: http://github.com/mrdon/maven-cli-plugin.
+This plugin gives you a command console to execute maven goals and plugins.
+Even better, it supports aliases, so no more having to type long Maven commands
+with switches and properties. Here's how to get started.
+
+First, rev up the command console:
+
+ mvn cli:execute-phase
+
+You'll be presented with a prompt:
+
+maven2> 
+
+At the prompt, you can type any of the following commands (a description is
+provide for each command, but don't type that of course):
+
+explode   -> deploy as an exploded archive to JBoss AS)
+deploy    -> deploy as a packaged archive to JBoss AS
+undeploy  -> undeploy the exploded or packaged archive from JBoss AS
+restart   -> restart the exploded or packaged archive deployed to JBoss AS
+reexplode -> undeploy then explode
+
+You can prefix any command with "clean" if you want to do a clean build:
+
+maven2> clean explode
+
+Leave the console running and enjoy extremely fast deployments ;)
+
+But fast isn't for all of us.
+
+= Deploying a packaged archive to JBoss AS (the Slowskys' way)
+
+Why work fast when you can work slow? Perhaps your boss is annoying you and you
+want to irritate him with long builds. Or maybe you just fear speed. If that's
+the case, this section is for you (or if you just want to know what all those
+commands are doing above).
+
+Putting JBOSS_HOME aside for the moment, you can deploy the application to
+JBoss AS via JMX by executing this command:
+
  mvn -o -f seam-booking-ear/pom.xml jboss:deploy
 
 You can undeploy the application via JMX using this command:
@@ -49,9 +97,9 @@
 
  mvn -o -f seam-booking-ear/pom.xml jboss:harddeploy
 
-For ease of development, you probably want to use an exploded archive instead.
+But likely during development, you're only interested in exploded archives.
 
-= Deploying an exploded archive to JBoss AS
+= Deploying a packaged archive to JBoss AS (the Slowskys' way)
 
 It's much better to use the antrun plugin over the jboss plugin since it's
 smarter about what it copies to the server. The antrun plugin is bound to the
@@ -78,9 +126,10 @@
  mvn -o package -Pundeploy,explode
 
 Note that the -o puts Maven in offline mode so that it doesn't perform time
-consuming update checks.
+consuming update checks. The -o flag is included in the aliases configured for
+the Maven CLI plugin documented above.
 
-= Highlights
+= Example highlights
 
 - 3 module Maven 2 reactor project (ejb-jar, war, ear)
 - establishes a standard for Seam 3 examples




More information about the seam-commits mailing list