I bake a Docker image that launches a Maven task at runtime. It looks something like this:
ADD pom.xml /srv ADD src /srv/src WORKDIR /srv RUN mvn dependencies:go-offline scala:testCompile
At run time, I run mvn gatling:execute to run the load testing utility.
My POM looks like this:
<project> <dependencies> <dependency> <groupId>io.gatling</groupId> <artifactId>gatling-core</artifactId> <version>${gatling.version}</version> </dependency> <dependency> <groupId>io.gatling</groupId> <artifactId>gatling-http</artifactId> <version>${gatling.version}</version> </dependency> <dependency> <groupId>io.gatling</groupId> <artifactId>gatling-app</artifactId> <version>${gatling.version}</version> </dependency> <dependency> <groupId>io.gatling.highcharts</groupId> <artifactId>gatling-charts-highcharts</artifactId> <version>${gatling.version}</version> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>net.alchim31.maven</groupId> <artifactId>scala-maven-plugin</artifactId> <version>${scala-maven-plugin.version}</version> </plugin> <plugin> <groupId>io.gatling</groupId> <artifactId>gatling-maven-plugin</artifactId> <version>${gatling-plugin.version}</version> <executions> <execution> <goals> <goal>execute</goal> </goals> </execution> </executions> </plugin> </plugins> </build> </project>
What I would like is that when I eventually run mvn gatling:execute , I donβt want to load any dependencies, I would like all of them to be baked into the image during assembly.
However, even running mvn dependencies:go-offline scala:testCompile does not put me in order. Running gatling:execute still requires loading additional dependencies.
How can I download absolutely everything Maven needs for my Docker image so that it does not need to load files at runtime?
maven docker gatling
Naftuli Kay
source share