Adam Bien's Weblog
Creating Maven 3 Multi Module Projects From Command Line
- Execute:
mvn archetype:generate - Search for:
A_CHANGING_NUMBER: remote -> pom-root (Root project archetype for creating multi module projects) - Use number from #2 as input for the wizzard when maven asks you: "Choose a number: […]:")
If you are working a lot in command line with Maven, take a look at JBoss Forge
But: if you are starting a Java EE 6 project with a multi-module maven module, you should rethink your decision. Start with a single WAR :-)
Posted at 08:06AM Mar 05, 2012 by Adam Bien in Real World Java EE Patterns - Rethinking Best Practices | Comments[3] | Views/Hits: 7597
NEW Workshop: "JPA, NoSQL, Caching, Grids and Distributed Caches with Java EE 7", May 7th, 2013, Airport Munich
A book about rethinking Java EE Patterns
Tweet Follow @AdamBien

If you're using a recent version of the Archetype plugin, then you can more easily search for "pom-root" at the prompt rather than scanning the output. For example:
Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): 177: pom-root
Choose archetype:
1: remote -> org.codehaus.mojo.archetypes:pom-root (Root project archetype for creating multi module projects)
Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): : 1
Posted by Brett Porter on March 05, 2012 at 09:21 AM CET #
Isn't that a bit overkill to use an archetype to gerenate 7 lines of pom where the only key is to use the right packaging type? ;-)
Posted by P. Cornelißen on March 05, 2012 at 09:30 AM CET #
Even easier :
mvn archetype:generate -Dfilter=pom-root
Or take a look at
mvn archetype:generate -Dfilter=javaee6
Posted by Fred Bricon on March 05, 2012 at 03:47 PM CET #