Maven - Settings.xml - (User|Local) Configuration

1 - About

Settings.xml is a configuration file that should not be bundled to any specific project

whereas the pom.xml can be distributed

It contains:

  • configuration information such as the local repository location
  • authentication information such as username and password.

3 - Management

3.1 - Creation

Use the global settings from the Maven installation dir M2_HOME/conf

3.2 - Location

There are two locations where a settings.xml file may live:

  • The Maven install conf: $M2_HOME/conf/settings.xml (configuration for all Maven users on a machine (assuming they're all using the same Maven installation).
  • The user’s install conf: ${user.home}/.m2/settings.xml (configuration for a single user)

This location can be overridden with the CLI option:

  • User level: -s /path/to/user/settings.xml
  • Global Level. -gs /path/to/global/settings.xml

3.3 - Variable

The contents of the settings.xml may use the following expressions:

  • ${user.home} and all other properties system properties (since Maven 3.0)
  • ${env.myEnvVariable} etc. for the environment variables

3.4 - Specification

See Settings.xml Reference for a full description.

4 - Documentation / Reference

Data Science
Data Analysis
Data Science
Linear Algebra Mathematics

Powered by ComboStrap