'Access Remote Maven Artifactory from Bitbucket Pipelines

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?



Solution 1:[1]

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.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Shvalb