Book Image

Apache Maven 2 Effective Implementation

By : Brett Porter, Maria Odea Ching
Book Image

Apache Maven 2 Effective Implementation

By: Brett Porter, Maria Odea Ching

Overview of this book

<p>By building up a sample application, this book guides developers painlessly through building a project with Maven. This book shows you how to combine Maven with Continuum and Archiva, which will allow you to build an efficient, secure application and make developing in a team easy.<br /><br />You may already be aware of the pitfalls of 'integration hell' caused by changed code being submitted to repositories by a number of developers. When you implement Continuum in your build, you can easily perform continuous integration, avoiding timely rework and reducing cost and valuable time. You will be able to use Maven more efficiently in a team after you learn how to set up Archiva, Apache's repository manager.<br /><br />It's easy to quickly get to work with Maven and get the most out of its related tools when you follow the sequential coverage of the sample application in this book. A focus on team environments ensures that you will avoid the pitfalls that are all too common when working in a team. Soon, by learning the best practices of working with Maven, you will have built an effective, secure Java application.</p>
Table of Contents (21 chapters)
Apache Maven 2 Effective Implementation
Credits
About the Authors
About the Reviewers
Preface
Free Chapter
1
Maven in a Nutshell
Index

Generating projects


The Archetype plugin makes it possible for Maven to create Maven projects from a template. Let's start with the most popular goal of the plugin which is archetype:generate.

From archetype:create to archetype:generate

In the previous releases of the Maven Archetype plugin, Maven projects were created from archetypes using the archetype:create goal. When using the archetype:create goal, you needed to know and provide all of the information about the archetype plus the values you want to use on the command line. For example:

mvn archetype:create -DgroupId=com.effectivemaven.chapter11 \
    -DartifactId=sample-app -Dversion=1.0-SNAPSHOT \
    -DpackageName=com.effectivemaven.chapter11.sample \
    -DarchetypeArtifactId=maven-archetype-webapp

It's easy to know this if we're using an archetype we created, but what if we're not? We have to hunt through the documentation to find all the available Maven archetypes (unless we've memorized all of them).

Now with the archetype:generate...