Book Image

Apache Maven Cookbook

Book Image

Apache Maven Cookbook

Overview of this book

Table of Contents (18 chapters)
Apache Maven Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Understanding Maven settings


Now that we have got an idea of the essential elements of a pom file, let us also examine the various setting properties of Maven.

How to do it...

To understand the Maven settings, perform the following steps:

  1. Open the settings.xml file in the .m2 subfolder of your HOME folder, if it exists:

  2. Otherwise, open the settings.xml file in the conf folder of your Maven installation (as defined in M2_HOME).

How it works...

Maven has a global settings file called settings.xml in the conf folder of the Maven installation. The values in this file can be overridden in the user settings file— the settings.xml file—that is present in the .m2 subfolder of your HOME folder.

The settings file contains configurations that are not specific to a project, but are global in nature. It also contains information that is not meant to be distributed (for example, passwords).

Like the pom file, the settings file is also an XML file based on an XML schema. It starts as follows:

<settings xmlns...