Make sure that you have maven binary added to your PATH variable and also you have JAVA_HOME environment variable declared. Once you have set all environment variables open command prompt and navigate to the directory where you want to setup maven project. Make sure that the directory is empty.
After navigating you can use below command to create sample maven project.
> mvn archetype:generate -DgroupId=in.mayurshah -DartifactId=test
-DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false
[INFO] Scanning for projects...
[INFO] -- omitted for readability
[INFO] ----------------------------------------------------------------------------
[INFO] Parameter: groupId, Value: in.mayurshah
[INFO] Parameter: packageName, Value: in.mayurshah
[INFO] Parameter: package, Value: in.mayurshah
[INFO] Parameter: artifactId, Value: test
[INFO] Parameter: basedir, Value: C:/Users/***/Documents/workspace
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] project created from Old (1.x) Archetype in dir: C:/Users/***/Documents/workspace
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------