Creating an Apache Maven Project
Well, I am finally taking the plunge into Apache Maven. I have found that managing dependencies is becoming unbearable and Maven is being used by several open source project that I use so… Here I go, one step at a time.
My first question was obvious: How do I create a new Maven project?
After a few minutes of searching I ended up on the Maven website reading the ‘Getting Started‘ faq and found the very cryptic command on starting a project.
mvn archetype:create -DgroupId=com.mattconroy.project -DartificatId=TestProject
After running the above command I ended up with a directory structure that is suppose to magically work to build and maintain a project. Well, we’ll see.
The structure of the project:
TestProject
- pom.xml
- src
- main
- java
- com/mattconroy/project
- App.java
- test
- java
- com/mattconroy/project
- AppTest.java
So this makes sense… One directory for program code and another for program unit tests. I can live with this.

Filed under: Java on April 4th, 2009
Leave a Reply