The command "mvn dependency:resolve" and "mvn dependency:resolve-plugins" fails on internal dependency on a multi-module project. It defeats the attempt to create a dependency layer and increase docker build speed when only application code is changed.
COPY pom.xml .
COPY powerjob-server-remote/pom.xml powerjob-server-remote/pom.xml
COPY powerjob-server-persistence/pom.xml powerjob-server-persistence/pom.xml
COPY powerjob-server-common/pom.xml powerjob-server-common/pom.xml
COPY powerjob-server-migrate/pom.xml powerjob-server-migrate/pom.xml
COPY powerjob-server-starter/pom.xml powerjob-server-starter/pom.xml
COPY powerjob-server-core/pom.xml powerjob-server-core/pom.xml
COPY powerjob-server-extension/pom.xml powerjob-server-extension/pom.xml
RUN --mount=type=cache,target=/root/.m2 mvn -DexcludeReactor=true -U dependency:resolve dependency:resolve-plugins
There are posts say that upgrade to maven-dependency-plugin 3.12+ and use "mvn dependency:go-offline" should solve this problem.