The maven mvn archetype:create command is a powerful one. It can create you a whole new ready-to-run application, complete with templated sources, config files etc. It takes a lot of the pain out of starting a new application.
Webtide has created a collection of maven webapp project archetypes which are freely downloadable from our site. We’ve made archtypes for most of the popular webapp technologies: DWR, ActiveMQ-Web, Dojo, SiteMesh, Tapestry, WebWorks, Struts, Spring and more.
It’s just 4 easy steps to starting a new project:
- download the mini-maven project for the archtype of your choice
- build the archetype with mvn install
- generate your project with mvn archetype:create …
- execute your new webapp immediately with mvn jetty:run
Now you have a freshly-made, running project with the webapp techology of your choice already baked in and ready for you to modify and extend. You have saved yourself hours or even days of work!
I knew archetypes were powerful, but it was brought home to me today answering a question on the jetty lists. A user was having problems with a sitemesh webapp. I simply downloaded our sitemesh archetype, generated a sitemesh app and modified it to match the user’s configuration.
It took me all of 5 minutes until I had a working webapp I could use to try to replicate the problem!
Without the archetype, it would have taken me hours researching sitemesh, downloading it, making a maven project and a webapp that worked.
Even sweeter, just changing a single line in the generated webapp’s pom.xml allowed me to immediately run the webapp under a different version of jetty with the mvn jetty:run command. I was able to try out the webapp’s behaviour with 3 different versions of jetty in under 5 minutes!
We want our maven archetype portfolio to be as comprehensive as possible, so if you spot a technology we don’t have covered, please contact us and suggest it.