Maven has a concept of archetypes. Archetypes are skeleton projects that a user can use to get a basic development setup for one purpose or another (desktop application, servlet, etc…)
The following command will invoke maven, fetch some initial dependencies, and list a set of archetypes that are available. If you press ‘enter’ at the first question, you will create a default Java desktop application. Maven will ask you to fill out some identifying information for your project (such as a project name, group name, etc…).
$ mvn archetype:generate
After this command finishes, you will have three interesting objects in your folder, a pom.xml, src/main, and src/test
pom.xml contains the build, unit test, and dependency configuration
src/main contains the production code for your project
src/test contains the unit tests for the project.
Generating an Eclipse Project from a Maven Project¶
After generating your Maven project, you won’t be able to immediately open it in Eclipse
Maven is able to generate the appropriate files to setup an eclipse project.
This command will generate the necessary Eclipse project files