Search code examples
javamaven-2maven

What is the purpose of the archetypeArtifactId?


When create a new project, it requires to set the archetypeArtifactId. Anyone know the meaning of this element?


Solution

  • Did you mean creating a new POM or a new project? For a new project when you provide the archetypeArtifactId you are informing maven what archetype to use to create the initial structure of the project. Maven looks it up from the archetypeCatalog.

    For example, if you want to create a simple web-app project you specify -DarchetypeArtifactId=maven-archetype-webapp.

    UPDATE I found this list for a compilation of some of the commonly used archetypes.