[git-bridge] Cache maven artifacts in Dockerfile (#34390)

* [git-bridge] Cache maven artifacts in Dockerfile

GitOrigin-RevId: 1222ba62bc6242874d76e26c69b366fbde62f519
This commit is contained in:
Miguel Serrano
2026-06-09 08:06:18 +00:00
committed by Copybot
parent a16274409e
commit dedc521295
+11
View File
@@ -16,6 +16,17 @@ RUN chmod +x /opt/envsubst
RUN useradd --create-home node
ENV MAVEN_OPTS="-Dmaven.repo.local=/app/.m2/repository"
# pre-resolve Maven dependencies and plugins into the base image to limit
# downstream `mvn` invocations hitting Maven Central on every CI build.
COPY pom.xml /tmp/pom.xml
RUN mvn -B --no-transfer-progress -f /tmp/pom.xml \
dependency:go-offline \
dependency:resolve-plugins \
&& chown -R node:node /app/.m2 \
&& rm /tmp/pom.xml
FROM base AS builder
COPY . /app