How to manage maven settings.xml on a shared jenkins server?

We manage all our build nodes using Puppet. It gives you greater control than just settings.xml. Highly recommended

Puppet is IT automation software that helps system administrators manage infrastructure throughout its lifecycle, from provisioning and configuration to patch management and compliance. Using Puppet, you can easily automate repetitive tasks, quickly deploy critical applications, and proactively manage change, scaling from 10s of servers to 1000s, on-premise or in the cloud.


You can specify for each job in the Maven Advanced Options part a specific seetings.xml path


I would recommend using the configuration file plugin, provides a UI to edit one or more Maven settings files.

These settings files can be passed into your Maven build using the "-s" option.


If your company is using Nexus Pro (as you've already mentioned), then your unique Maven settings.xml can be stored there, and retrieved at build time using the nexus-maven-plugin as described here: http://books.sonatype.com/nexus-book/reference/maven-settings.html

Combined with token-based access (again, Nexus Pro does this), you do not need to store passwords insecurely in the settings.xml (see https://books.sonatype.com/nexus-book/reference/usertoken.html)