Quick Java Project Setup Using Maven

Java projects, especially when it comes to web or EJB applications, tend to get pretty complex. Setting up such a project is a non-trivial task because of the many conventions you have to follow to make your application deployable. The maven project management tool provides a mechanism to setup a project quickly using its archetype concept.

An archetype is a template which creates a skeleton project for you that already knows which dependencies to download and how to build a deployable package. All you have to do is to adjust the maven configuration file (pom.xml) to your needs and fill in code.

When I wanted to play with Seam, all I had to do was to locate a proper archetype and run the following command (all on one line):

mvn archetype:create 
  -DarchetypeGroupId=org.apache.maven.archetypes
  -DarchetypeArtifactId=softeu-archetype-seam-simple
  -DgroupId=de.mafr.seam
  -DartifactId=Seam-Demo
  -DremoteRepositories=http://maven.softeu.cz

A directory Seam-Demo is created which contains a skeleton project. You can create a deployable WAR-File from it using mvn package.

Advertisements
This entry was posted in java and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s