Thursday, September 15, 2011

How to create a simple java project using Maven archetype - maven-archetype-quickstart

In command prompt, type below command:

mvn archetype:generate -DarchetypeGroupId=org.apache.maven.archetypes -DgroupId=com.mycompany.app -DartifactId=my-app

This starts running in interactive mode.
  • It first asks archetype number. Type 16 (which corresponds to maven-archetype-quickstart) and Enter
  • Then it asks version. By default it shows 1.0-SNAPSHOT. If you want some other version, enter what version you want
  • Similarly it asks for package.
Now, it would have created the folder 'my-app' and the project structure.


No comments:

Post a Comment