Shaun Abram
Technology and Leadership Blog
Creating a Maven multi module project
There is no easy way, or simple archetype, to create a maven multi module project. The approach below is the best way I’ve found so far.
Maven Quickweb Archetype
The maven Quickweb archetype allow you to create a new project with a layout that is essentially a combination of what you get with the standard maven archetypes of quickstart and webapp. The readme on Github contains more details: https://github.com/sabram/maven-archetype-quickweb
If you are interested in the underlying workings, the ‘recipe’ for the archetype is the archetype descriptor, archetype.xml, which is located in the src/main/resources/META-INF/maven/ directory. It specifies what files the generated project will be made up of, in addition to the prototype pom, all of which are located in the archetype-resources folder.
Links:
- Apache source code for maven-archetype-quickstart and maven-archetype-webapp
- Apache guide to creating archetypes; Wiki on creating an archetype
- How is metadata about an archetype stored?
- Stackoverflow question on how to create the src/main/resources folder with the quickstart folder. I posted a link to my maven-archetype-quickweb archetype there.
- Stackoverflow question on how to use a custom maven archetype
Tags: archetype, Maven, mvn, quickweb
Maven archetypes to create your project folder structure
Maven archetypes are useful for many things, including creating a folder structure to start with, even if you aren’t planning to use maven as your build tool. See a list of available archetypes here.
(more…)