Consider a parent project bookmarks and 3 sub modules rest, security and model, referring to Spring docs.
It doesn't have the dependencies as in the Spring doc, just the basic setup from multi-module point of view.
To create a parent maven project in non-interactive mode/ batch mode
mvn archetype:generate \
-DarchetypeGroupId=org.codehaus.mojo.archetypes \
-DarchetypeArtifactId=pom-root \
-DarchetypeVersion=RELEASE \
-DgroupId=bookmarks \
-DartifactId=bookmarks \
-Dversion=0.0.1-SNAPSHOT \
-DinteractiveMode=false
To create sub modules in non interactive mode/ batch mode.
cd into your newly created root dir. Referring to answer by @Chris.H
-Dpackage is the package structure. Here it is bookmarks.
If not specified then it will consider the artifactId as default package
mvn archetype:generate \
-DarchetypeGroupId=org.apache.maven.archetypes \
-DarchetypeArtifactId=maven-archetype-quickstart \
-DarchetypeVersion=RELEASE \
-DgroupId=model \
-DartifactId=model \
-Dversion=0.0.1-SNAPSHOT \
-Dpackage=bookmarks \
-DinteractiveMode=false
To create a new module in eclipse goto File->new->other->maven->maven module, this shows up immediately in eclipse workspace package explorer.
Or from cli, cd inside parent folder, here bookmarks and run the following, it will
create the project and then you have to import into eclipse as a maven project, or can work from parent, here bookmarks project
mvn archetype:generate \
-DarchetypeGroupId=org.apache.maven.archetypes \
-DarchetypeArtifactId=maven-archetype-quickstart \
-DarchetypeVersion=RELEASE \
-DgroupId=security \
-DartifactId=security \
-Dversion=0.0.1-SNAPSHOT \
-Dpackage=bookmarks \
-DinteractiveMode=false