Maven Archetype Plugin
The Archetype Plugin allows the user to create a Maven project from an existing template called an archetype.
It also allows the user to create an archetype from an existing project.
This plugin requires Java 6.
Maven Archetype Plugin Overview
Usage
Instructions on how to use the Archetype Plugin to create a project can be found on the usage page.
The Archetype Plugin is embedded in IDEs (Eclipse, NetBeans, IDEA).
Instructions on how to use the Archetype Plugin to create an archetype from an existing project can be found on the advanced usage page.
Goals Overview
The archetype plugin has four goals for direct use:
archetype:generate creates a Maven project from an archetype: asks the user to choose an archetype from the archetype catalog, and retrieves it from the remote repository. Once retrieved, it is processed to create a working Maven project.
archetype:create-from-project creates an archetype from an existing project.
archetype:crawl search a repository for archetypes and updates a catalog.
and three goals bound to default lifecycle by 'maven-archetype' packaging:
archetype:jar (bound to the package phase) is used to build the archetype jar artifact.
archetype:integration-test (bound to the integration-test phase) is used to execute archetype integration tests by generating sample projects from the just built archetype.
archetype:update-local-catalog (bound to the install phase) is used to update the local catalog.
Examples
The following examples show how to use the Archetype Plugin in more advanced usecases:
Generate projects in batch mode
Generate project using an alternative catalog
Create an archetype from a multi-module project
Create an archetype with a property file
Specification
The specification page contains the specification of the main parts of the Archetype Plugin.