Information
This is basically a SAF2's maven archetype plugin. It is used to create a working web application template for SAF2 where the user work build on top of. It is to serve as a little tool for rapid prototyping.
Features
The created template contains :-
- Sitemesh integration build in
- A simple SAF2 action example (both instantiated through Spring and SAF2 itself)
- A simple SAF2 validation example (action and action-alias level)
- A Simple SAF2 conversion example (global and action level)
- A simple SAF2 resource bundle (both global, action and package level)
Installing SAF2 maven archetype
- Change directory to SAF2's maven archetype directory eg. from SAF2's root directory (You will need the SAF2 source from SVN)
cd ./archetype <press enter>
- Run the following command to install SAF2 maven archetype into one's local maven repository (typically at ~/.m2/repository where ~ is the user directory)
mvn install
- If "build succesfull" is shown at the console after execution of the above command, the SAF2 maven archetype plugin is successfully installed.
Create SAF2 Web app template
To create a workable template of SAF2 :-
- Change directory to where the web app template is to be created eg. assuming the directory to be myWebApp.
mkdir /home/tmjee/myWebApp cd /home/tmjee/myWebApp
- Run the following command to generate the sample web app template, assuming:-
Root java package
com.myCompany.mySystem
The webapp war name
myWebApp
mvn archetype:create -DgroupId=com.myComp.mySystem -DartifactId=myWebApp -DarchetypeGroupId=org.apache.struts2 -DarchetypeArtifactId=struts2-archetype-quickstart
Using the created SAF2 Web app template
Following are some maven command that might be handy when using the generated SAF2 web app template :-
- To compile
mvn compile
- 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