Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to configure a local Maven mirror for Specs Runner?

Alan Raison June 27, 2018

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
Alan Raison July 25, 2018

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.

0 votes
Alan Raison June 27, 2018

@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 July 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
rsperafico
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 27, 2018

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
AUG Leaders

Atlassian Community Events