The latest version of the Knappsack Maven Archetypes now supports creating Java EE 6 applications for servlet containers. These projects includes configuration for core Java EE 6 technologies such as JSF, CDI, JPA and Bean Validation and can be run from the command line using the embedded Jetty and Tomcat servlet containers.
Also with this latest release, all the archetypes are available in the Central Maven Repository which means you can dive straight in and create a new Maven project using these archetypes :
- In the command line, or in a script file, issue the following :
mvn archetype:generate -DarchetypeGroupId=org.fluttercode.knappsack -DarchetypeArtifactId=jee6-servlet-minimal-archetype -DinteractiveMode=false -DarchetypeVersion=1.0.4 -DgroupId=org.application -DartifactId=servletminimal -Dpackage=org.application
This will create the new project based on the java ee 6 minimal servlet archetype.
- Go into the directory using
- In the project directory, issue the command
mvn clean jetty:run
- Navigate to http://localhost:8080/servletminimal/
- Tinker away with it