- Navigate to the directory where you have to create a the project folder. (Project folder is created by maven itself)
- Run the below maven command
Syntax :
mvn archetype:generate -DgroupId={project-packaging} -DartifactId={project-name} -DarchetypeArtifactId={maven-template} -DinteractiveMode=false
Example :
mvn archetype:generate \ -DgroupId=com.heapwizard \ -DartifactId=java-maven-demo \ -DarchetypeArtifactId=maven-archetype-quickstart \ -DinteractiveMode=false \
Note: You need to execute it as a single line in terminal
mvn archetype:generate -DgroupId=com.heapwizard -DartifactId=java-maven-demo -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false
- Now import the project in eclipse.
- File – Import – Existing Maven Project – Finish
Execute the default main class and test :