BitterSweetJaVa

January 31, 2009

Maven 2 Archetype

Filed under: S.C.M. — Tags: , , — .|2ic|K @ 5:43 PM

To create a directory structure for a java project, just use:

mvn archetype:create
-DgroupId=[project's group id]
-DartifactId=[project's artifact id]
-DarchetypeArtifactId=[maven's archetype]

where [maven's archetype] can be:

  • maven-archetype-quickstart

for:
.
|– src
|     |– main
|     |     `– java
|     |     `– [your project's package]
|     |     `– App.java
|     `– test
|            `– java
|            `– [your project's package]
|            `– AppTest.java
`– pom.xml

  • maven-archetype-webapp

for:
.
|– src
|     |– main
|     `– java
|            |– resources
|            |– webapp
|            |     `– WEB-INF
|            |           `– web.xml
|            `– index.jsp
`– pom.xml

there are other archetypes, but these are the most commons I use.

Theme: Shocking Blue Green. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.