Maven Server-Side Settings
Maven Settings Resolution on the Server Side
The TeamCity server invokes Maven on the server side for functionality like Maven dependency triggers and Maven model display on the "Maven" build configuration tab.
During the process, TeamCity uses usual Maven logic for finding the settings.xml files with several differences (see below).
Maven global-level settings are used from the .xml file in the default Maven location for the TeamCity server process: ${env.M2_HOME}/conf/settings.xml
(or ${system.maven.home}/conf/settings.xml
) (global values of M2_HOME environment variable and maven.home JVM option are used - those set for the TeamCity server process),
For the Maven user-level settings, TeamCity uses settings defined in the User settings selection Maven of the Maven build step of the build configuration (if there are several, settings form the first Maven step are used).
Here is the explanation for the User settings selection options: If the <Default>
value is selected, TeamCity searches the following locations for the settings.xml
file (listed in order of priority):
<TeamCity Data Directory> /system/pluginData/maven/settings.xml
<User Home>/.m2/settings.xml
(Home directory of the user which TeamCity server process runs under is used)
If the <Custom>
value is selected, the file should be available both on the server and all the agents where the build will be run. If one of pre-uploaded settings is selected, TeamCity automatically uses the specified file content both on the server and agents.
For the logic of Maven settings, please refer to the related Maven documentation.