Maven: The Complete Reference
Edition 0.8
Maven 2.2
Maven 3.0
Tim O’Brien
Jason van Zyl
Brian Fox
John Casey
Juven Xu
Thomas Locher
Manfred Moser
Contributing Authors:
Dan Fabulich
Eric Redmond
Bruce Snyder
Larry Shatzer
The Complete Reference
A Sonatype Open Book
Mountain View, CA
Copyright © 2010 Sonatype, Inc.
This work is licensed under a Creative Commons Attribution-Noncommercial-No
Derivative Works 3.0 United States license. For more information about this license,
see http://creativecommons.org/licenses/by-nc-nd/3.0/us/. You are free to share,
copy, distribute, display, and perform the work under the following conditions:
• You must attribute the work to Sonatype, Inc. with a link to
http://www.sonatype.com.
• You may not use this work for commercial purposes.
• You may not alter, transform, or build upon this work.
Nexus™, Nexus Professional™, and all Nexus-related logos are trademarks or registered
trademarks of Sonatype, Inc., in the United States and other countries. Java™ and all
Java-based trademarks and logos are trademarks or registered trademarks of Sun
Microsystems, Inc., in the United States and other countries. IBM® and WebSphere® are
trademarks or registered trademarks of International Business Machines, Inc., in the
United States and other countries. Eclipse™ is a trademark of the Eclipse Foundation,
Inc., in the United States and other countries. Apache and the Apache feather logo are
trademarks of The Apache Software Foundation.
Many of the designations used by manufacturers and sellers to distinguish their prod-
ucts are claimed as trademarks. Where those designations appear in this book, and
Sonatype, Inc. was aware of a trademark claim, the designations have been printed in
caps or initial caps.
While every precaution has been taken in the preparation of this book, the publisher
and authors assume no responsibility for errors or omissions, or for damages resulting
from the use of the information contained herein.
Published by:
Sonatype, Inc.
800 W. El Camino Real
Suite 400
Mountain View, CA 94040.
ISBN 978-0-9842433-4-1
Editor: Tim O’Brien
For online information and ordering of this and other
Sonatype books, please visit www.sonatype.com. The
publisher oers discounts on this book when ordered in
quantity. For more information, please contact:
book@sonatype.com
Maven Training by Sonatype
http://www.sonatype.com/training
With Sonatype training, you will learn Maven fundamentals and best practices directly
from Maven and Nexus experts. If your team is using Nexus, this class is the easiest
way to make sure that everyone starts from the same foundation.
MVN-101 Maven Mechanics
An online instructor-led course of two half-day sessions, ideal for programmers who
work with Maven projects and need to understand how to work with an existing
Maven build. This class is also appropriate for experienced Maven users who are inter-
ested in becoming more familiar with Maven fundamentals.
MVN-201 Development Infrastructure Design
An online instructor-led course of two half-day sessions, ideal for Development Infra-
structure Engineers who are responsible for maintaining enterprise development infra-
structure. This class includes content on advanced repository management using
Nexus and continuous integration using Hudson.
Nexus Professional
http://www.sonatype.com/products/nexus
Nexus Professional 1.6 is now available with features to support enterprise software
development. Stage software releases and maintain strict control over proxy repositories.
Download your free trial today.
"At Intuit, we recognize that as builds grow and the teams who create them change
over time, swift, accurate repository management becomes critical. Nexus provides
a comprehensive, easy-to-use open source solution that lets teams and developers
track, search, organize and access build components."
- Kaizer Sogiawala, Software Conguration Management Engineer, Intuit.
"We have adopted Maven for all our software development projects and have
started using Nexus to better support our development processes. The support for
promotion and procurement workows in Nexus Professional now expands Nexus
with a robust set of additional features which make it easier for us to maintain
consistency between our development, testing and production environments."
- Chris Maki, Principal Software Engineer, Overstock.com