- Introspecting my wandering mind - https://rajandesai.com/blog -

Create your own custom maven archetype

Creating custom maven archetype

Maven provides many archetypes to generate various types of project skeletons. This blog post explains how to create a custom archetype that is tailor-made for your own situation. We will create an archetype for the Struts2 application.
My current development environment includes:

Create your skeleton project

You need to have a starter project from which new archetype can be created. We can start with the Struts2 application created in the blog post Starting Struts2 web application development (using Maven2 and Eclipse) [1] to create a custom archetype for Struts2 based applications. You can download the zipped source code for this project here [2].

Generate your archetype

Install the archetype locally

The new archetype can easily be installed in your local maven repository by running mvn install in the target/generated-sources/archetype directory.

This step creates a metadata file called archetype-catalog.xml under your local maven repository directory.

Use this new archetype to create new Struts2 project