O'Reilly logo

Maven: The Definitive Guide by Sonatype Company

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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>

Settings Details

Simple Values

Half of the top-level settings elements are simple values, representing a range of values that configure core behavior of Maven. These are shown in Example A-2.

Example A-2. Simple 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"> ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required