Maven settings.xml from a URL

46 views
Skip to first unread message

Justin

unread,
Oct 15, 2015, 5:47:42 PM10/15/15
to Jenkins Users
We run our Jenkins nodes with a service account that has a a network-mounted home directory. I don't want to rely on that account's ~/.m2/settings.xml (beacuse people can and do periodically mess it up), so we have deployed a templated copy into Artifactory. Downloading that file populates the encrypted password and some other site-specific settings. So I'm looking for a way to have all my Maven build nodes get the settings.xml from Artifactory so that our Maven jobs can have a standardized custom path to set.

As I understand it, I can't have a matrix job that runs on all nodes with a given label, it will just pick one node with that label instead. I can have a job that runs on the server to pull the file from Artifactory into $JENKINS_HOME/userContent, and then use the Copy to Slave plugin, and set the Maven build options to use ${WORKSPACE}/settings.xml. Anybody have any caveats from prior experience with that method? Is there a better alternative?

Vincent Latombe

unread,
Oct 15, 2015, 6:17:27 PM10/15/15
to Jenkins Users
Hi,

What you are looking for is

Vincent

2015-10-15 23:47 GMT+02:00 Justin <baron...@gmail.com>:
We run our Jenkins nodes with a service account that has a a network-mounted home directory. I don't want to rely on that account's ~/.m2/settings.xml (beacuse people can and do periodically mess it up), so we have deployed a templated copy into Artifactory. Downloading that file populates the encrypted password and some other site-specific settings. So I'm looking for a way to have all my Maven build nodes get the settings.xml from Artifactory so that our Maven jobs can have a standardized custom path to set.

As I understand it, I can't have a matrix job that runs on all nodes with a given label, it will just pick one node with that label instead. I can have a job that runs on the server to pull the file from Artifactory into $JENKINS_HOME/userContent, and then use the Copy to Slave plugin, and set the Maven build options to use ${WORKSPACE}/settings.xml. Anybody have any caveats from prior experience with that method? Is there a better alternative?

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/376e7905-86d2-4b19-b732-ad1d18ceb810%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Justin

unread,
Oct 16, 2015, 10:24:03 AM10/16/15
to Jenkins Users
Awesomesauce. Thanks.

Mark Waite

unread,
Oct 16, 2015, 10:51:43 AM10/16/15
to Jenkins Users
There is a matrix plugin that will allow you to run a job on all nodes with a specific label.  It is the ElasticAxis plugin.  I find it quite helpful.  It allows me to run git client plugin and git plugin tests on every slave currently available.

There is a plugin that will allow you to provide configuration files (like settings.xml) from the Jenkins server to each job using a Maven build step (selectively).  It is the config file provider plugin.

Neither of those exactly meet your request, but you might consider them as part of the toolbox of plugins to solve problems.

Mark Waite

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages