views:

3883

answers:

4

Maven Archetypes are the "templates" by which you can quickly generate a running example of a given framework or project type. I am trying to compile a list of all the Maven archetype catalogs currently active on the net.

From the Maven documentation about catalog files:

Knowledge about archetypes are stored in catalogs.

The catalogs are xml files.

The Archetype Plugin comes bundled with an internal catalog. This one is used by default.

The Archetype Plugin can use catalogs from local filesystem and from HTTP connections.

So far, I've gathered this list of repositories that do publish catalogs, but would love to see if anyone knows of more:

mvn archetype:generate
-DarchetypeCatalog=local
-DarchetypeCatalog=remote
-DarchetypeCatalog=http://repo.fusesource.com/maven2
-DarchetypeCatalog=http://cocoon.apache.org
-DarchetypeCatalog=http://download.java.net/maven/2
-DarchetypeCatalog=http://myfaces.apache.org
-DarchetypeCatalog=http://tapestry.formos.com/maven-repository
-DarchetypeCatalog=http://scala-tools.org
-DarchetypeCatalog=http://www.terracotta.org/download/reflector/maven2/

Links to same: 1) FuseSource 2) Cocoon 3) Java.net 4) MyFaces 5) Tapestry 6) Scala Catalog 7) Terracotta Catalog

You'll notice that if the repository actually publishes an archetype catalog (all of the above do), you'll get a UI prompt of all the choices found in that archetype-catalog.xml. For example:

mvn archetype:generate -DarchetypeCatalog=http://scala-tools.org

[INFO] No archetype defined. Using maven-archetype-quickstart (org.apache.maven.archetypes:maven-archetype-quickstart:1.0)
Choose archetype:
1: http://scala-tools.org -> scala-archetype-simple (A simple scala project)
2: http://scala-tools.org -> lift-archetype-blank (A blank/empty liftweb project)
3: http://scala-tools.org -> lift-archetype-basic (A basic liftweb project (with DB, css, ...))
Choose a number:  (1/2/3):

If you want to view the Scala catalog file directly for example, you can browse to http://scala-tools.org/archetype-catalog.xml

But if the repository doesn't provide an archetype-catalog.xml, then just as PascalT says, you'll need to know the name in advance (much less convenient) and pass it in command line arguments.

+1  A: 

Terracotta has one but I don't know the url off-hand...will post back. Also, I have used archetypes in the past from AppFuse (http://static.appfuse.org/releases/) and Webtide although I don't know where to find their archetype catalogs.

The Terracotta repository and catalog are here: http://www.terracotta.org/download/reflector/maven2/

Perhaps this is useful: http://docs.codehaus.org/display/MAVENUSER/Archetypes+List

Alex Miller
Thanks! It would be awesome if you could encourage Terracotta to publish not just the archetypes, but an archetype catalog. It really encourages use of the breadth of the archetypes. Info on publishing the catalog: http://www.sonatype.com/books/maven-book/reference/archetype-sect-publishing.html
Matthew McCullough
It looks like this (http://download.terracotta.org/maven2/index.html) is the Terracotta repo, but it doesn't seem to have a archetype-catalog.xml
Matthew McCullough
Ooops! Used to be there, must have gotten removed somehow. Fixing...
Alex Miller
The Terracotta one should be fixed now.
Alex Miller
Terracotta catalog FTW! Thanks Alex!
Matthew McCullough
By the way Matt, please use the url in the original comment ( http://www.terracotta.org/download/reflector/maven2/ ) and not the one you put in the comment. The original is the official link and will redirect to actual (which will likely change today in fact).
Alex Miller
Ok. I edited the original article earlier this morning and it links to: http://www.terracotta.org/download/reflector/maven2/ -- the correct one.
Matthew McCullough
+4  A: 
Pascal Thivent
Thanks for the additions. If you are using archetype:generate with a catalog name, you'll be presented with a list to choose from, so you don't have to know the name of the archetype you are after in advance. https://maven.atlassian.com/... doesn't appear to have an archetype-catalog.xml
Matthew McCullough
Thanks for the clarification about catalogs. I'll edit my answer to clarify. And btw, Atlassian archetypes are actually in the internal catalog.
Pascal Thivent
Cool update. Thanks for all the new data Pascal. Also note that there's shorthand for ~/.m2/archetype-catalog.xml -- just say -Dcatalog=localIt still doesn't solve the fact that Grails isn't providing one, but it does make it clean once you generate it.
Matthew McCullough
+1  A: 

The nexus index that is produced by Nexus and consumed by M2eclipse knows about all the archetypes and lets you choose them when you create a new maven project from the ide.

Brian Fox
A: 

There's yet another resource at Codehaus for a very robust list of archetypes out there on the 'net. http://docs.codehaus.org/display/MAVENUSER/Archetypes+List

Matthew McCullough
This is only a list of *internal* archetypes. Maven's remote catalog is much bigger - http://repo1.maven.org/maven2/archetype-catalog.xml .
Henryk Konsek