Creating an archetype is a pretty straight forward process. An archetype is a very simple artifact, that contains the project prototype you wish to create. An archetype is made up of:

an archetype descriptor (archetype.xml in directory: src/main/resources/META-INF/maven/). It lists all the files that will be contained in the archetype and categorizes them so they can be processed correctly by the archetype generation mechanism.

the prototype files that are copied by the archetype plugin (directory: src/main/resources/archetype-resources/)

All you need to specify is a groupId, artifactId and version. These three parameters will be needed later for invoking the archetype via archetype:generate from the commandline.

2. Create the archetype descriptor

The archetype descriptor is a file called archetype.xml which must be located in the src/main/resources/META-INF/maven/ directory. An example of an archetype descriptor can be found in the quickstart archetype:

3. Create the prototype files and the prototype pom.xml

The next component of the archetype to be created is the prototype pom.xml. Any pom.xml will do, just don't forget to the set artifactId and groupId as variables ( ${artifactId} / ${groupId} ). Both variables will be initialized from the commandline when calling archetype:generate.

4. Install the archetype and run the archetype plugin

Now you are ready to install the archetype:

mvn install

Now that you have created an archetype, you can try it on your local system by using the following command. In this command, you need to specify the full information about the archetype you want to use (its groupId, its artifactId, its version) and the information about the new project you want to create (artifactId and groupId). Don't forget to include the version of your archetype (if you don't include the version, you archetype creation may fail with a message that version:RELEASE was not found)