Install maven on your system and run the following command:

mvn archetype:generate -DgroupId=com.jft.prashant -DartifactId=MavenSample -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false

This will generate the required directory structure with maven-archetype-quickstart (this is also default) template. Similarly, you can use maven-archetype-webapp for a web application. For more info please have a look at here.