I\'m trying to build/deploy a spring boot in a docker container.
FROM maven:3.5.3-jdk-8-slim AS build
COPY ./pom.xml /app/pom.xml
RUN cd /app
RUN mvn -f /app
I finally find the solution by using go-offline-maven-plugin.
<plugin>
<groupId>de.qaware.maven</groupId>
<artifactId>go-offline-maven-plugin</artifactId>
<version>1.0.0</version>
<configuration>
<dynamicDependencies>
<DynamicDependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-junit4</artifactId>
<version>2.20.1</version>
<repositoryType>PLUGIN</repositoryType>
</DynamicDependency>
</dynamicDependencies>
</configuration>
</plugin>
And trying to get all dependencies using:
mvn de.qaware.maven:go-offline-maven-plugin:resolve-dependencies