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.