Just some Maven Archetypes created by and for Michael Righi, but you know, you can use them too.*
Probably not.
These archetypes were initially written for personal use, and as a result there's some me-specific stuff in them.
One day I hope to get around to making these more suitable for general use, but in the meantime I decided to make this public to share with a couple of friends, and I figured maybe a few strangers could benefit from this too.
Until I make these more suitable for general uses, I think you should probably be using one of the archetypes at http://docs.codehaus.org/display/MAVENUSER/Archetypes+List
You've got a Mac or Linux machine, right? Cool. Maven is already installed, right? ( http://maven.apache.org/download.html ) Cool.
Open a terminal window and run the following:
git clone [email protected]:righi/maven-archetypes.git
cd maven-archetypes
./install-archetypes.sh
Note: You can delete the maven-archetypes folder at this point if you'd like, because Maven will have installed the archetypes under your ~/.m2, or something like that. (Unless you're using Eclipse. See below.)
Again, in a terminal window:
mkdir MyKickAssProject
cd MyKickcAssProject
mvn archetype:generate \
-DarchetypeGroupId=com.michaelrighi.archetypes \
-DarchetypeArtifactId=[the archetype id, such as java-1_6] \
-DarchetypeVersion=0.1 \
-DgroupId=[your project's group id] \
-DartifactId=[your project's artifact id]
For example:
mvn archetype:generate -DarchetypeGroupId=com.michaelrighi.archetypes -DarchetypeArtifactId=java-1_6 -DarchetypeVersion=0.1 -DgroupId=com.example -DartifactId=MyKickAssProject
The archetypes included in this project are:
- java-1_6
- java-1_6-spring3
- jee-5
- jee-5-spring3-mvc
See http://maven.apache.org/guides/getting-started/index.html for more detail.
First, you need to tell Eclipse that these archetypes exist by creating a new local archetype catalog. This is a one-time process:
-
Install m2eclipse ( http://eclipse.org/m2e/ ) if you don't already have it, but I bet you already have it.
-
Go into your Eclipse Preferences.
-
Choose Maven > Archetypes
-
Click on the "Add Local Catalog" button.
-
Navigate to the folder you downloaded the archetypes to, and choose "archetype-catalog.xml".
-
For the description, enter "Michael's Maven Archetypes".
Going forward, when you want to create a new project that uses one of the archetypes just do this (in Eclipse):
-
File > New > Other...
-
Maven > Maven Project
-
Ensure that "Create a simple project" is not selected. Click Next.
-
In the Catalog dropdown, select "Michael's Maven Archetypes".
-
Select the archetype you want to use, such as "jee-5-spring3-mvc". Click Next.
-
Enter the Group Id, Artifact Id, Version, and Package for the project you are creating. Click Finish.