What is Archetype in Maven? List of Maven Archetypes - Maven Tutorial



First, understand what is the meaning of  Archetype in English.

“very typical example of a certain person or thing.”

 

Maven archetypes are project templates which can be generated for you by Maven.

In other words, when you are starting a new project you can generate a template for your project with Maven.

In Maven a template is called an archetype. Each Maven archetype thus corresponds to a project template that Maven can generate.


If you want a web application, use maven-archetype-webapp, or if you want a sample application use maven-archetype-quickstart.

Maven Archetypes

Maven provides several archetype artifacts:

Archetype ArtifactIdsDescription
maven-archetype-archetypeAn archetype to generate a sample archetype.
maven-archetype-j2ee-simpleAn archetype to generate a simplified sample J2EE application.
maven-archetype-pluginAn archetype to generate a sample Maven plugin.
maven-archetype-plugin-siteAn archetype to generate a sample Maven plugin site.
maven-archetype-portletAn archetype to generate a sample JSR-268 Portlet.
maven-archetype-quickstartAn archetype to generate a sample Maven project.
maven-archetype-simpleAn archetype to generate a simple Maven project.
maven-archetype-siteAn archetype to generate a sample Maven site which demonstrates some of the supported document types like APT, XDoc, and FML and demonstrates how to i18n your site.
maven-archetype-site-simpleAn archetype to generate a sample Maven site.
maven-archetype-webappAn archetype to generate a sample Maven web app project.

 


Using an Archetype

To create a new project based on an Archetype, you need to call  mvn archetype: generate  goal, like the following:

mvn archetype:generate