The Struts Maven Archetype creates a working web application template.
Features
- Standard Maven environemtn
- Sitemesh integration
- Action example (both instantiated through Spring and Struts itself)
- Validation example (action and action-alias level)
- Conversion example (global and action level)
- Resource bundle (both global, action and package level)
Installing the Archetype
- Install Maven 2
- Install Subversion
- Checkout the Struts 2 source code (svn co http://svn.apache.org/repos/asf/struts/struts2/trunk)
Creating an Application
From a working directory for your project:
mvn archetype:create -DgroupId=tutorial \ -DartifactId=tutorial \ -DarchetypeGroupId=org.apache.struts \ -DarchetypeArtifactId=struts2-archetype-starter \ -DarchetypeVersion=1.0-SNAPSHOT \
Substitute the name of your project for "tutorial". Substitute your own package name for "org.apache.struts".
The Archetype will create a ready-run Struts project. Just run "mvn install" to build.
Command Quick Reference
- To build
mvn install
- To run test cases
mvn test
- To clean up
mvn clean
- To package
mvn package
- To grab necessary JAR files etc.
mvn initialize
- To run it with Jetty6
mvn jetty6:run