Pipeline cache with custom maven config

Hello, in my Java project I need to define a custom settings.xml file, because in a specific branch I need to download from a private maven repository, but seems the cache is not correctly used with this configuration (in another branch, where I don't use the custom settings.xml file the cache is used).

This is the custom settings.xml (stored in the project tree as scripts/builder/maven-settings.xml):

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">

  <localRepository>${user.home}/.m2/repository/</localRepository>

  <servers>
    <server>
    <id>private-repository</id>
    <username>my-account</username>
<password>SECRET</password>
</server>
</servers>
</settings>

I also added the localRepository config but seems don't change nothing.

This is the xxx file:

image: maven:3.3.3-jdk-8

pipelines:
custom:
build-win:
- step:
caches:
- maven
script:
- mvn -B -s scripts/builder/maven-settings.xml -DargLine=-Xmx3072m package

any ideas? Thanks in advance!

0 answers

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jun 12, 2018 in Bitbucket

Do you use any Atlassian products for your personal projects?

After spinning my wheels trying to get organized enough to write a book for National Novel Writing Month (NaNoWriMo) I took my affinity for Atlassian products from my work life and decided to tr...

23,815 views 26 12
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you