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.