The first archetype I tried was Grails archetype. I am actively working on a business idea using Grails so was curious to try grails archetype:
#1. Generate the grails based project:
mvn archetype:generate \ -DarchetypeGroupId=org.grails \ -DarchetypeArtifactId=grails-maven-archetype \ -DarchetypeVersion=1.2.2 \ -DgroupId=com.mayabansi.mavenisedgrails \ -DartifactId=MavenisedGrails
You have to provide the archetypeGroupId and archetypeArtifactId as is. I chose Grails version 1.2.2. You can chose which Grails version you want to use in archetypeVersion. At the time of this post, the following versions were available: grails-maven-archetypes
The groupId I chose is com.mayabansi (my company name) and mavnisedgrails is my project name. artifactId is my project name.
But, above will create a new Maven project with a POM and a standard Maven directory structure. What you won't see is anything that looks like a Grails application. So, the next step is to create the Grails project structure that you're used to:
#2. mvn initialize:
mvn initialize
Above command creates a complete Grails directory structure.
New posts about:
#1: Maven, Spring, Hibernate and Mockito
#2. Maven and Hibernate hell.