We're using Google Cloud Build to build a Spring Boot application written in Java. However, we have a private Maven repository (hosted on Artifact Registry if that matters), and the application won't build unless it has access to this repository.
The cloudbuild.yaml file looks like this:
steps:
- name: maven:3.8.6-eclipse-temurin-17-alpine
entrypoint: mvn
args: [ 'clean', 'verify', '-Dmaven.test.skip=true' ]
Usually, I add the credentials to the private maven repository to the ~/.m2/settings.xml file.
What's the recommended approach to give Maven access to a private Maven repository when building the project with Google Cloud Build?