Although I am using Maven for quite some time now over the last years I have never had the need to create my own archetype. Untill my current project. And luckily this is greatly simplified in Maven2.2.
The first thing to do is to create your ‘base’ module that you want to use as template for your other modules. When this is in place you simply go to the root of your base module and enter:
mvn archetype:create-from-project
After this has successfully completed you go to the directory ‘target/generated-sources/archetype’ and enter the command:
mvn install
And after that you can add the archetype to the catalog in your local repository with the command:
mvn deploy
Continue reading…