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

ams picture ams · May 22, 2013 · Viewed 49.5k times · Source

I have a Jenkins cluster that is shared by several teams, that I can configure build jobs on, However i can't easily make changes to the Jenkins configuration itself.

There is a central "nexus pro" maven repository manager but each team / group in this very large multinational has their own repo, publishing to the repos requires username / password combination.

This means that I have to configure the Jenkins server with a maven settings.xml that is unique to the team I am working with without messing up the maven configuration of the other users of the Jenkins cluster.

Git is the source control repository.

  1. On a shared Jenkins cluster how do I configure a maven settings.xml that is unique to a a group of build jobs or to a single job? What are the best practices for handling this type of situation?

Answer

Mark O'Connor picture Mark O'Connor · May 23, 2013

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.