SAGARFIVE

Tutorials

2.3 What is archetype ?

  • Archetype is a Maven project templating toolkit.
  • An archetype is defined as an original pattern or model from which all other things of the same kind are made.
  • The name fits as we are trying to provide a system that provides a consistent means of generating Maven projects.
  • Archetype will help authors create Maven project templates for users, and provides users with the means to generate parameterized versions of those project templates.
  • Using archetypes provides a great way to enable developers quickly in a way consistent with best practices employed by your project or organisation.

Example:

If We want to create a sample maven application using maven?

  • Run the command in cmd(i have installed on c drive , so I opened cmd as run as administrator)

mvn archetype:generate
  • Once after running above command, if it your first maven download archetype(Predefined structured project for specific application with sample data,  first 1 is for Blank multi project for spring Boot + Elm)
  • Now Maven has 3282 archetypes
  • Above command, we did not mention the archetype, so maven chooses maven-archetype-quickstart archetype

Here we can see the 2049 is sample Maven Project