When you are starting a new project it is very easy to get started if the project structure can be built for you. Maven provides a plugin called maven-archetype-plugin which can help you generate the desired project structure depending on the application that you are trying to build.
The Archetype Plugin allows the user to build archetype containers. These archetype containers contains the pom, default source, test, resources, test-resources, and site-resources files in a specific directory structure. The content of the pom, the default files, and the directory structure depends on the what archetype container was built.
To create a simple java application you can use
mvn archetype:create -DgroupId=[your project's group id] -DartifactId=[your project's artifact id] -DarchetypeArtifactId=maven-archetype-quickstart
Likewise to create a webapp use something like this
mvn archetype:create -DgroupId=org.vh.hibjpa -DartifactId=hibernatejpa_webapp -DarchetypeArtifactId=maven-archetype-webapp
we would end up with a structure like this
. |-- src | `-- main | `-- java | |-- resources | |-- webapp | | `-- WEB-INF | | `-- web.xml | `-- index.jsp `-- pom.xml
There are several archetype containers available. A full list of containers shows 10 of them. List of some more useful archetypes which are not present on the apache site.
Once the project is generated go into the project and type mvn eclipse:eclipse, this would make it work with the eclipse ide. You would have to add the M2_REPO variable to the eclipse environment. If the archetype container is not present in your repository then it is downloaded once the archetype:create is executed.

Alexwebmaster
Tuesday, March 3, 2009
Hello webmaster
I would like to share with you a link to your site
write me here preonrelt@mail.ru
Vikas Hazrati
Tuesday, April 7, 2009
For creating a mojo plugin project use
mvn archetype:create \
-DgroupId=sample.plugin \
-DartifactId=maven-hello-plugin \
-DarchetypeGroupId=org.apache.maven.archetypes \
-DarchetypeArtifactId=maven-archetype-mojo
Vikas Hazrati
Tuesday, April 7, 2009
mvn archetype:generate -DgroupId=sample.plugin -DartifactId=maven-hello-plugin -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-mojo
Vikas Hazrati
Thursday, May 27, 2010
mvn archetype:generate