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.
A catalog is an xml file with such content:
<?xml version="1.0" encoding="UTF-8"?> <archetype-catalog> <archetypes> <archetype> [1] <groupId>org.appfuse.archetypes</groupId> [2] <artifactId>appfuse-basic-jsf</artifactId> [3] <version>2.0</version> [4] <repository>http://static.appfuse.org/releases</repository> [5] <description>AppFuse archetype for creating a web application with Hibernate, Spring and JSF</description> </archetype> ... </archetypes> </archetype-catalog>
During the creation of a project from an archetype, the Archetype Plugin ask the user to choose an archetype from a list containing the archetypes from each of the provided catalogs (Yes, there may be many).
For each archetype in the list the Archetype Plugin shows a line like:
1: internal -> appfuse-basic-jsf (AppFuse archetype for creating a web application with Hibernate, Spring and JSF)
At the end of the create-from-project behaviour, the Archetype Plugin install/deploy the archetype, and update the local/remote catalog.
The crawl-repository goal is used to create a catalog file by crawling a Maven 2 repository located in the filesystem.
The Archetype Plugin knows by default its internal catalog. It also knows about the local and remote catalogs.
local represents the catalog file ~/.m2/archetype-catalog.xml .
remote represents the catalog file http://repo1.maven.org/maven2/archetype-catalog.xml .
The Archetype Plugin can also read catalogs from filesystem/HTTP by providing the path/URL of a catalog file or of a directory containing the archetype-catalog.xml file.