Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to configure a local Maven mirror for Specs Runner?

Edited

I have a local Maven mirror on my network (as is customary), but when I try to create plans with bamboo-specs (by committing a Java project containing a Java bamboo-specs module), the bamboo-specs-runner or bamboo-specs-generator (not clear which) insists on attempting to download directly from Maven Central.

I am running the specs in a custom container, with my mirror settings saved in /root/.m2/settings.xml. I have also (for good measure) saved the settings on the Bamboo server, in ~/.m2/settings.xml.

Please can you advise the correct way to configure the Maven process which processes specs.

I am using Bamboo 6.5.0. The custom container is based from atlassian/bamboo-specs-runner:6.5.0

3 answers

1 accepted

0 votes
Answer accepted

I did finally get this working by copying our maven settings.xml into /root/.m2/settings.xml (in a custom docker container, based from atlassian/bamboo-spec-runner:6.5.0); copying into

/usr/share/maven/ref/ (as recommended by the maven base image) did not work.

@rsperafico

As I stated in my question, I have configured a Maven mirror in my settings.xml, but bamboo is ignoring this.

Please can you read the question more carefully.

Should the runner be reading it settings from /root/.m2/settings.xml when running specs in a container, or is it running as a different user, or actually on the host machine?

Deleted user Jul 25, 2018

Tried modifying the agent's settings.xml and it didn't work. Apparently, bamboo-specs are executed on Bamboo master (which our team has no access to).

0 votes

Hi @Alan Raison,

insists on attempting to download directly from Maven Central.

Correct, access to the Maven central repository is required (as mentioned in the document), unless you already have those dependencies available in the machine where Bamboo is running. Maven needs to download dependencies that are necessary to execute Specs code from its repo at https://repo.maven.apache.org.

One thing you might be able to do is download those resources somewhere else and move them over to the machine where Bamboo is installed. For example, the user that created the Specs code should already have the necessary dependencies in its local Maven repository (Where is Maven local repository?: The default value is ${user.home}/.m2/repository) – so you could copy that over to the Maven local repository inside the machine where Bamboo is installed – under the user running Bamboo.

Alternatively, you could set up a different repository and/or make use of a mirror. For that reason, please review the following for further information:

* Maven - Settings Reference

* How to Override the Maven Local Repository setting

* Manually Overriding the Built-in Repositories

If you want to use a local repository instead of Maven's central repository to pull dependencies you'll need to add a <repository> tag inside the settings.xml file – you need to place this file inside the .m2 directory for the user running bamboo.

Kind regards,

Rafael

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bamboo

Bamboo Data Center 8.1 is now available

G’day Bamboo customers, Bamboo DC 8.1 is now available with it the following features and programs: SAML 2.0, OpenID Connect, and Crowd SSO In order to help admins with a simplified user manage...

167 views 0 4
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you