Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 7773700

Browse files
authoredJul 7, 2024··
Speed up docker re-builds using mvn dependency:go-offline (#19078)
* go offline * dup
1 parent 0b1b3f5 commit 7773700

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed
 

‎Dockerfile

+10-1
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,23 @@ COPY ./LICENSE ${GEN_DIR}
1010
# Required to compile openapi-generator
1111
COPY ./google_checkstyle.xml ${GEN_DIR}
1212

13+
# All poms are copied, then we go offline, to allow for better caching of code changes without fetching all dependencies each time
14+
COPY ./modules/openapi-generator-gradle-plugin/pom.xml ${GEN_DIR}/modules/openapi-generator-gradle-plugin/
15+
COPY ./modules/openapi-generator-maven-plugin/pom.xml ${GEN_DIR}/modules/openapi-generator-maven-plugin/
16+
COPY ./modules/openapi-generator-online/pom.xml ${GEN_DIR}/modules/openapi-generator-online/
17+
COPY ./modules/openapi-generator-cli/pom.xml ${GEN_DIR}/modules/openapi-generator-cli/
18+
COPY ./modules/openapi-generator-core/pom.xml ${GEN_DIR}/modules/openapi-generator-core/
19+
COPY ./modules/openapi-generator/pom.xml ${GEN_DIR}/modules/openapi-generator/
20+
COPY ./pom.xml ${GEN_DIR}
21+
RUN mvn dependency:go-offline
22+
1323
# Modules are copied individually here to allow for caching of docker layers between major.minor versions
1424
COPY ./modules/openapi-generator-gradle-plugin ${GEN_DIR}/modules/openapi-generator-gradle-plugin
1525
COPY ./modules/openapi-generator-maven-plugin ${GEN_DIR}/modules/openapi-generator-maven-plugin
1626
COPY ./modules/openapi-generator-online ${GEN_DIR}/modules/openapi-generator-online
1727
COPY ./modules/openapi-generator-cli ${GEN_DIR}/modules/openapi-generator-cli
1828
COPY ./modules/openapi-generator-core ${GEN_DIR}/modules/openapi-generator-core
1929
COPY ./modules/openapi-generator ${GEN_DIR}/modules/openapi-generator
20-
COPY ./pom.xml ${GEN_DIR}
2130

2231
# Pre-compile openapi-generator-cli
2332
RUN mvn -B -am -pl "modules/openapi-generator-cli" package

0 commit comments

Comments
 (0)
Please sign in to comment.