settings.xml file contains configurations that are not specific to a project, but are global in nature. It also contains information that is not meant to be distributed (e.g. passwords).
Location of Maven Settings File
Maven can have two settings files working at a time:
- The Maven installation directory:
- The user’s home directory:
Both files are optional. If both files are present, the values in the user home settings file overrides the values from global settings file.
Maven Default setting.xml
A default maven
setting.xml look like this:
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> <localRepository/> <interactiveMode/> <usePluginRegistry/> <offline/> <pluginGroups/> <servers/> <mirrors/> <proxies/> <profiles/> <activeProfiles/> </settings>
A brief description of the elements is given in below table:
|Maven stores copies of plug-ins and dependencies locally in the |
|As the name suggests, when this value is set to |
|It decide that if Maven should use the |
|When set to |
|It contains a list of |
|Maven can interact with a variety of servers, such as Apache Subversion (SVN) servers, build servers, and remote repository servers. This element allows you to specify security credentials, such as the username and password, which you need to connect to those servers.|
|As the name suggests, mirrors allow you to specify alternate locations for your repositories.|
|proxies contains the HTTP proxy information needed to connect to the Internet.|
|profiles allow you to group certain configuration elements, such as repositories and |
Drop me your questions in comments section.
Happy Learning !!