Thursday, June 14, 2012

Maven archetype creation:

There 2 ways to crate archetype.
1. Manually
2. From project
From project is the most preferable way, cause saves your time.
http://maven.apache.org/guides/mini/guide-creating-archetypes.html

There is few steps you should do:
mvn archetype:create -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-quickstart -DgroupId=your-group-id -DartifactId=your-artifact-id -DpackageName=your.package -Dversion=1.0 
mvn org.apache.maven.plugins:maven-archetype-plugin:2.2:create-from-project 
mvn install 
mvn archetype:generate -DarchetypeCatalog=local
1. Create project and fill it
2. Generate archetype from the project which would be generated to target target\generated-sources\archetype
3. Install to archetype to repository
4. Use it