Create simple project using Maven

Maven supports a simple mechanism to generate a project with the required structure and files already in place. Simply execute the command below:

mvn archetype:generate -DgroupId=com.test -DartifactId=mytest

Replace com.test and mytest with your preferred name and package for your project.

The maven documentation page contains a short list of the most common archtetypes. When you enter the command an interactive console will start from which you can select the preferred archetype to start with. You must enter the number of the archetype or you can specify a filter by packagename to shorten the list of options.