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">
  <localRepository>${user.dir}/.m2/repository</localRepository>
  <interactiveMode>true</interactiveMode>
  <usePluginRegistry>false</usePluginRegistry>
  <offline>false</offline>
  <pluginGroups>
    <pluginGroup>org.codehaus.mojo</pluginGroup>
  </pluginGroups>
  ...
</settings>

The simple top-level elements are:

localRepository

This value is the path of this build system’s local repository. The default value is ${user.dir}/.m2/repository.

interactiveMode

true if Maven should attempt to interact with the user for input; false if not. Defaults to true.

usePluginRegistry

true if Maven should use the ${user.dir}/.m2/plugin-registry.xml file to manage plugin versions. Defaults to false.

offline

true if this build system should operate in offline mode. Defaults to false. This element is useful for build servers that cannot connect to a remote repository, either because of network setup or for security reasons.

pluginGroups

This element contains a list of pluginGroup elements. Each contains a groupId. The list is searched when a plugin is used and the groupId

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.