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

Confirming the expected models


The assembly of the actual project model used for the Maven build can be a reasonably complex process through inheritance and the application of profiles and management sections of the POM. For this reason, it can be useful to examine exactly what model Maven is attempting to use to see if there is an error in the content.

The Help plugin can be of assistance here. In addition to the goals outlined in Chapter 1, Maven in a Nutshell, three goals are particularly geared towards troubleshooting.

The first is the effective-pom goal:

$ mvn help:effective-pom

The output of this goal is very straightforward. It consists of a full listing of the POM file as Maven resolves it. This will have populated fields that have been inherited; including defaults, as well as adjusting paths to the location you are running the build from, and so on.

Its counterpart for your settings files is the effective-settings goal:

$ mvn help:effective-settings

Again, this will display the complete settings model being used by Maven, collapsing the one located in the Maven installation with the one stored in the home directory.

Tip

Settings caution

Occasionally, your Maven settings will contain sensitive information such as passwords in plain text. While these may be stored in a relatively secure location on your hard drive, executing the above goal will output them to the screen. In particular, do not blindly copy that output into a bug report or mailing list post while you are investigating a problem! Maven 2.1.0 and above have the capability to mask those passwords to avoid such issues.