It's customary to create MAVEN projects through the IDE, such as Eclipse
To create a MAVEN project using the MAVEN command, you need to use the Maven archetype Plugin,
The archetype Plugin allows the user to create a Maven project from a existing template called a archetype.
It also allows the user to create a archetype from a existing project.
This plugin requires Java 5.
command Format
MVN archetype:generate-dgroupid=[your GroupId]-dartifactid=[your Artifactid]-dversion=[your version]- Darchetypeartifactid=[archetypeartifactid]
1. Create common Java Projects
Command:
MVN archetype:generate-dgroupid=com.ricky.codelab-dartifactid=demo-darchetypeartifactid= Maven-archetype-quickstart
2. Create General Javaweb Project
Command:
MVN archetype:generate-dgroupid=com.ricky.codelab-dartifactid=webdemo-darchetypeartifactid= Maven-archetype-webapp Note
MVN archetype:create is deprecated in Maven 3.0.5 and beyond. Please
Use the Generate Mojo instead.
Resources:
http://maven.apache.org/archetype/maven-archetype-plugin/
Http://maven.apache.org/archetype/maven-archetype-plugin/create-mojo.html