Maven settings.xml: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
No edit summary
No edit summary
Line 88: Line 88:
See [[Maven_Concepts#Mirror|mirror]].
See [[Maven_Concepts#Mirror|mirror]].


A usage example is configuring an [[OpenShift Nexus]] instance as a build mirror. See {{https://kb.novaordis.com/index.php/OpenShift_Nexus#Configure_Maven_from_Maven_Build_Pods_to_Use_Nexus_as_Mirror|Configure Maven to Use Nexus as Mirror}}
A usage example is configuring an [[OpenShift Nexus]] instance as a build mirror. See {{InternalOpenShift_Nexus#Configure_Maven_from_Maven_Build_Pods_to_Use_Nexus_as_Mirror|Configure Maven to Use Nexus as Mirror}}


==<proxies>==
==<proxies>==


See [[Maven_Concepts#Proxy|proxy]].
See [[Maven_Concepts#Proxy|proxy]].

Revision as of 06:55, 9 December 2017

External

Internal

Overview

settings.xml is the place to store configuration that should not be bundled with a specific project, but it concerns the build system as a whole. This includes various "personal" configuration values, the location of the local repository, alternate remote repository servers and authentication information. Usually, this information is bundled in specific profiles.

There are two types of settings.xml files:

  • global, placed in ${MAVEN_HOME}/conf/settings.xml.
  • user settings, placed in ${HOME}/.m2/settings.xml. An alternate user settings file location can be specified with -s|--settings.

If both exist, the contents are merged and the user-specific values take precedence.

System properties and environment variables can be both used in settings.xml.

Note that properties defined in profiles within settings.xml cannot be dereferenced.

Elements

<localRepository>

The location of the local repository.

<localRepository>${user.home}/.m2/repository</localRepository>

<interactiveMode>

<interactiveMode>true</interactiveMode>

See Maven interactive mode.

<offline>

<offline>false</offline>

<servers>

Declares a server.

<servers>
    <server>
        <id>server001</id>
        <username>my_login</username>
        <password>my_password</password>
        <privateKey>${user.home}/.ssh/id_dsa</privateKey> 
        <passphrase>some_passphrase</passphrase>
        <filePermissions>664</filePermissions>
        <directoryPermissions>775</directoryPermissions>
        <configuration>
           ...
        </configuration>
    </server>
</servers>

<profiles>

See:

Maven Profile

<activeProfiles>

See:

Maven Profile

<usePluginRegistry>

See plugin registry.

<pluginGroups>

<mirrors>

See mirror.

A usage example is configuring an OpenShift Nexus instance as a build mirror. See Template:InternalOpenShift Nexus

<proxies>

See proxy.