1

I need to configure our Nexus repo to have multiple procured groups and have different Jenkins jobs reference different groups depending on the type of job.

For example, for CI jobs I need to be able to proxy a bunch of repositories. For deploy or release jobs I need to use a proxy group that is procured and controlled. The CI may allow the users to get to artifacts that aren't yet approved but for releases the artifacts are vetted and approved first.

It seems simple to create the groups and do procurement in Nexus. However, I can't figure out how to get the Jenkins jobs to use the different groups. I can only have a single mirrorOf tag in the maven .settings.xml and mirrors can't be set in profiles.

Has anyone tried this?

Jerry Hoerig
  • 146
  • 9
  • See http://stackoverflow.com/questions/14023836/now-getting-401-unauthorized-in-jenkins-when-deploying-artifact-to-archiva-maven/14024843#14024843 – Mark O'Connor Mar 19 '13 at 01:13

2 Answers2

2

You have to have a different settings.xml file for the different jobs that access different groups. The Maven 3 integration of Hudson can do that within the server and automatically use the right one. For Jenkins you have to manually manage it a different way. E.g. by having different settings.xml file with different names on the CI server and then using the -s options of the mvn invocation.

Manfred Moser
  • 29,539
  • 13
  • 92
  • 123
0

"The CI may allow the users to get to artifacts that aren't yet approved but for releases the artifacts are vetted and approved first."

I wonder what are you using the CI for. Normally The CI is simply used to build continuously your projects but not used to be arbitrary between your developers and your repos manager server.

Maybe you could configure your proxies in multiple profile in your setting.xml and activate them as needed using properties/environment variables.

Tekdev
  • 448
  • 3
  • 9
  • We have three categories of approved artifacts - approved for production, restricted for existing apps but will be phased out, and can be explored but not for production yet. So when jobs are configured the CI jobs can use the explored, but release jobs can only be restricted or approved. I need to configure the procured repositories accordingly and try to configure Jenkins' Maven to use the correct repository group by job type. – Jerry Hoerig Mar 19 '13 at 12:49