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
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

1,936 views 1 5
Read article

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