Overview

Maven archetypes are project templates that offer a quick and easy way to start a new software project that is consistent with an organizations best practices. This blog entry demonstrates the technical steps one can take to convert a skeleton project to a Maven archetype, to store the archetype into a Nexus Repository and finally to test the archetype by generating a new Maven project from the archetype. In a previous blog entry I covered setting up a Nexus Repository click here if you have an interest in that material, it is somewhat relevant to the content in this blog entry.

Pre-requisites

A JVM and Maven should be installed on the developer machine, Java and Maven should both be available on the systems/users path variable.

1. Create a project skeleton

The best way to start any new project in Maven is to utilize an existing archetype. To see a list of available archetypes from a specific repository type the following command.

mvn archetype:generate -DarchetypeCatalog=http://localhost:8081/nexus/content/repositories/bcn-archetypes