Skip to content

Commit

Permalink
Improve the Maven caching in docker builds build (#118)
Browse files Browse the repository at this point in the history
  • Loading branch information
ciaranmcnulty authored Dec 17, 2022
1 parent 9957b89 commit c438614
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions java/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@
ARG MAVEN_VERSION=3.8
ARG JAVA_VERSION=16
FROM maven:${MAVEN_VERSION}-eclipse-temurin-${JAVA_VERSION} AS java

WORKDIR /cucumber

# Dummy stage for generated code, overriden in main build
FROM scratch AS schema-codegen


FROM java AS with-dependencies

COPY --link pom.xml maven-versions-rules.xml .
RUN mvn install
COPY --link pom.xml .
# verify loads additional dependencies without running the tests (they aren't copied in yet)
RUN mvn dependency:go-offline verify


FROM java AS tested
Expand All @@ -22,4 +23,4 @@ COPY --link . .
COPY --link --from=with-dependencies /root/.m2 /root/.m2
COPY --link --from=schema-codegen / src/generated/java/io/cucumber/messages/types

RUN mvn test
RUN mvn verify

0 comments on commit c438614

Please sign in to comment.