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:

  1. download the mini-maven project for the archtype of your choice
  2. build the archetype with mvn install
  3. generate your project with mvn archetype:create …
  4. 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.


8 Comments

Andres Almiray · 22/11/2006 at 17:00

Great! I downloaded the Spring archetype and was a bit shocked by the Spring version (1.0.2), that’s really old. What about the dependencies in the other archetypes ?

Jan Bartel · 22/11/2006 at 18:49

Right you are re the spring version. I think the spring folks changed the groupId they were using to publish to maven and we accidentally picked up the old one. We’re doublechecking all the versions now are the most up-to-date ones available on ibiblio for all the archtypes. Thanks for the heads-up.

Andres Almiray · 22/11/2006 at 19:26

Jan, not to be too picky but what if the archetypes provide dependencies for testing like spring-mock for the Spring archetype ? maybe it could be enabled with cli options ?

    Mehmet · 04/03/2012 at 07:19

    “In fact, i would probably reuse ant spicrts that i already wrote or from others.”Most IDEs will create a directory structure for you and you should always have code smippets or templates at your diisposal anyway.Tools will be available to generate ant or mvn xml files so this is really a moot issue.In fact there’s more keystrokes in in that one maven create line then there would be to get an initial ant script up usign cut and paste.The debate on using central repositories (and/or how) should be separate from this initial round so it should really be:Maven 0 Ant 0

Gene De Lisa · 04/12/2008 at 14:09

Not quite ready. I get this:
HTTP ERROR: 404
NOT_FOUND
RequestURI=/resources.jsp
Powered by Jetty://

Jan Bartel · 04/12/2008 at 15:53

Gene,
This is a slightly old blog entry and the location of the resources for download has moved.

The new location is:

http://www.webtide.com/resources/maven.jsp

And all other downloadable resources:

http://www.webtide.com/resources/downloads.jsp

regards

Jan

Anonymous · 05/04/2010 at 12:57

I still can’t access the eclipse download site

Jan · 05/04/2010 at 13:37

You need to register and login to the http://www.webtide.com site before you can download some resources like the maven archetypes – have you created yourself an account and logged in? We’ve tested the archtypes and they seem to download fine – can you email info@webtide.com with a description of what is wrong and we’ll take a look.

cheers

Jan

Comments are closed.