The Archetype plugin makes it possible for Maven to create Maven projects from a template. Let's start with the most popular goal of the plugin which is archetype:generate
.
In the previous releases of the Maven Archetype plugin, Maven projects were created from archetypes using the archetype:create
goal. When using the archetype:create
goal, you needed to know and provide all of the information about the archetype plus the values you want to use on the command line. For example:
mvn archetype:create -DgroupId=com.effectivemaven.chapter11 \ -DartifactId=sample-app -Dversion=1.0-SNAPSHOT \ -DpackageName=com.effectivemaven.chapter11.sample \ -DarchetypeArtifactId=maven-archetype-webapp
It's easy to know this if we're using an archetype we created, but what if we're not? We have to hunt through the documentation to find all the available Maven archetypes (unless we've memorized all of them).
Now with the archetype:generate...