Settings

This is a reference for the user-specific configuration for Maven.

Includes things that should not be distributed with the pom.xml file, such as developer identity, along with local settings, like proxy information.

The default location for the settings file is ~/.m2/settings.xml

An XSD is available at:

<settings>
  <localRepository/>
  <interactiveMode/>
  <usePluginRegistry/>
  <offline/>
  <proxies>
    <proxy>
      <active/>
      <protocol/>
      <username/>
      <password/>
      <port/>
      <host/>
      <nonProxyHosts/>
      <id/>
    </proxy>
  </proxies>
  <servers>
    <server>
      <username/>
      <password/>
      <privateKey/>
      <passphrase/>
      <filePermissions/>
      <directoryPermissions/>
      <configuration/>
      <id/>
    </server>
  </servers>
  <mirrors>
    <mirror>
      <mirrorOf/>
      <name/>
      <url/>
      <id/>
    </mirror>
  </mirrors>
  <profiles>
    <profile>
      <activation>
        <activeByDefault/>
        <jdk/>
        <os>
          <name/>
          <family/>
          <arch/>
          <version/>
        </os>
        <property>
          <name/>
          <value/>
        </property>
        <file>
          <missing/>
          <exists/>
        </file>
      </activation>
      <properties/>
      <repositories>
        <repository>
          <releases>
            <enabled/>
            <updatePolicy/>
            <checksumPolicy/>
          </releases>
          <snapshots>
            <enabled/>
            <updatePolicy/>
            <checksumPolicy/>
          </snapshots>
          <id/>
          <name/>
          <url/>
          <layout/>
        </repository>
      </repositories>
      <pluginRepositories>
        <pluginRepository>
          <releases>
            <enabled/>
            <updatePolicy/>
            <checksumPolicy/>
          </releases>
          <snapshots>
            <enabled/>
            <updatePolicy/>
            <checksumPolicy/>
          </snapshots>
          <id/>
          <name/>
          <url/>
          <layout/>
        </pluginRepository>
      </pluginRepositories>
      <id/>
    </profile>
  </profiles>
  <activeProfiles/>
  <pluginGroups/>
</settings>

settings

Root element of the user configuration file.

Element Description
localRepository The local repository.
interactiveMode Whether Maven should attempt to interact with the user for input. The default value is true.
usePluginRegistry Whether Maven should use the plugin-registry.xml file to manage plugin versions. The default value is false.
offline Indicate whether maven should operate in offline mode full-time. The default value is false.
proxies Configuration for different proxy profiles. Multiple proxy profiles might come in handy for anyone working from a notebook or other mobile platform, to enable easy switching of entire proxy configurations by simply specifying the profile id, again either from the command line or from the defaults section below.
servers Configuration of server-specific settings, mainly authentication method. This allows configuration of authentication on a per-server basis.
mirrors Configuration of download mirrors for repositories.
profiles Configuration of build profiles for adjusting the build according to environmental parameters.
activeProfiles List of manually-activated build profiles, specified in the order in which they should be applied.
pluginGroups List of groupIds to search for a plugin when that plugin groupId is not explicitly provided.

proxy

The <proxy> element contains informations required to a proxy settings.

Element Description
active Whether this proxy configuration is the active one. The default value is true.
protocol The proxy protocol. The default value is http.
username The proxy user.
password The proxy password.
port The proxy port. The default value is 8080.
host The proxy host.
nonProxyHosts The list of non-proxied hosts (delimited by |).
id No description. The default value is default.

server

The <server> element contains informations required to a server settings.

Element Description
username The username used to authenticate.
password The password used in conjunction with the username to authenticate.
privateKey The private key location used to authenticate.
passphrase The passphrase used in conjunction with the privateKey to authenticate.
filePermissions The permissions for files when they are created.
directoryPermissions The permissions for directories when they are created.
configuration Extra configuration for the transport layer.
id No description. The default value is default.

mirror

A download mirror for a given repository.

Element Description
mirrorOf The server ID of the repository being mirrored, eg "central". This MUST NOT match the mirror id.
name The optional name that describes the mirror.
url The URL of the mirror repository.
id No description. The default value is default.

profile

Modifications to the build process which is keyed on some sort of environmental parameter.

Element Description
activation The conditional logic which will automatically trigger the inclusion of this profile.
properties Extended configuration specific to this profile goes here. Contents take the form of property.value
repositories The lists of the remote repositories.
pluginRepositories The lists of the remote repositories for discovering plugins.
id No description. The default value is default.

activation

The conditions within the build runtime environment which will trigger the automatic inclusion of the parent build profile.

Element Description
activeByDefault Flag specifying whether this profile is active as a default. The default value is false.
jdk Specifies that this profile will be activated when a matching JDK is detected.
os Specifies that this profile will be activated when matching OS attributes are detected.
property Specifies that this profile will be activated when this System property is specified.
file Specifies that this profile will be activated based on existence of a file.

os

This is an activator which will detect an operating system's attributes in order to activate its profile.

Element Description
name The name of the OS to be used to activate a profile.
family The general family of the OS to be used to activate a profile (e.g. 'windows')
arch The architecture of the OS to be used to activate a profile.
version The version of the OS to be used to activate a profile.

property

This is the property specification used to activate a profile. If the value field is empty, then the existence of the named property will activate the profile, otherwise it does a case-sensitive match against the property value as well.

Element Description
name The name of the property to be used to activate a profile.
value The value of the property to be used to activate a profile.

file

This is the file specification used to activate a profile. The missing value will be a the location of a file that needs to exist, and if it doesn't the profile must run. On the other hand exists will test for the existence of the file and if it is there will run the profile.

Element Description
missing The name of the file that should be missing to activate a profile.
exists The name of the file that should exist to activate a profile.

repository

Repository contains the information needed for establishing connections with remote repoistory

Element Description
releases How to handle downloading of releases from this repository
snapshots How to handle downloading of snapshots from this repository
id A unique identifier for a repository.
name Human readable name of the repository.
url The url of the repository.
layout The type of layout this repository uses for locating and storing artifacts - can be "legacy" or "default". The default value is default.

releases

Download policy

Element Description
enabled Whether to use this repository for downloading this type of artifact. The default value is true.
updatePolicy The frequency for downloading updates - can be "always", "daily" (default), "interval:XXX" (in minutes) or "never" (only if it doesn't exist locally).
checksumPolicy What to do when verification of an artifact checksum fails - warn, fail, etc. Valid values are "fail" or "warn".

snapshots

Download policy

Element Description
enabled Whether to use this repository for downloading this type of artifact. The default value is true.
updatePolicy The frequency for downloading updates - can be "always", "daily" (default), "interval:XXX" (in minutes) or "never" (only if it doesn't exist locally).
checksumPolicy What to do when verification of an artifact checksum fails - warn, fail, etc. Valid values are "fail" or "warn".

pluginRepository

Repository contains the information needed for establishing connections with remote repoistory

Element Description
releases How to handle downloading of releases from this repository
snapshots How to handle downloading of snapshots from this repository
id A unique identifier for a repository.
name Human readable name of the repository.
url The url of the repository.
layout The type of layout this repository uses for locating and storing artifacts - can be "legacy" or "default". The default value is default.

releases

Download policy

Element Description
enabled Whether to use this repository for downloading this type of artifact. The default value is true.
updatePolicy The frequency for downloading updates - can be "always", "daily" (default), "interval:XXX" (in minutes) or "never" (only if it doesn't exist locally).
checksumPolicy What to do when verification of an artifact checksum fails - warn, fail, etc. Valid values are "fail" or "warn".

snapshots

Download policy

Element Description
enabled Whether to use this repository for downloading this type of artifact. The default value is true.
updatePolicy The frequency for downloading updates - can be "always", "daily" (default), "interval:XXX" (in minutes) or "never" (only if it doesn't exist locally).
checksumPolicy What to do when verification of an artifact checksum fails - warn, fail, etc. Valid values are "fail" or "warn".