Appendix A. Settings Details

Quick Overview

The settings element in the settings.xml file contains elements used to define values that configure Maven execution. Settings in this file are settings that apply to many projects and should not be bundled to any specific project or distributed to an audience. These include values such as the local repository location, alternate remote repository servers, and authentication information. There are two locations where a settings.xml file may live:

Maven installation directory

$M2_HOME/conf/settings.xml

User-specific settings file

~/.m2/settings.xml

Example A-1 shows an overview of the top elements under settings.

Example A-1. Overview of top-level elements in settings.xml

<settings xmlns="http://maven.apache.org/POM/4.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
                      http://maven.apache.org/xsd/settings-1.0.0.xsd">
  <localRepository/>
  <interactiveMode/>
  <usePluginRegistry/>
  <offline/>
  <pluginGroups/>
  <servers/>
  <mirrors/>
  <proxies/>
  <profiles/>
  <activeProfiles/>
</settings>

Get Maven: The Definitive Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.