Access Remote Maven Artifactory from Bitbucket Pipelines

330 Views Asked by At

I'm trying to set Bitbucket pipelines to run Maven verify command. What I currently struggle with is how to access dependencies that are defined in my POM. I have those dependencies in a remote artifactory but how do I set settings.xml on the BB pipelines?

I know that one way would be to have a settings.xml file in the root of my BB repository and use it in the bitbucket-pipelines.yml file - this works but I'm looking for a cleaner solution...

perhaps having the settings.xml embedded in a custom Docker image that is used in the yml file??

Any idea?

1

There are 1 best solutions below

0
On

I believe the best practice would be to create a custom Docker image and copy the local settings.xml into the global settings directory (e.g: /usr/share/maven/conf), then publish the image and and use this image in the bitbucket-pipelines.yml script.