【发布时间】:2016-01-27 15:31:46
【问题描述】:
我正在烘焙一个在运行时运行 Maven 任务的 Docker 映像。它看起来像这样:
ADD pom.xml /srv
ADD src /srv/src
WORKDIR /srv
RUN mvn dependencies:go-offline scala:testCompile
在运行时,我正在运行 mvn gatling:execute 来运行负载测试实用程序。
我的 POM 如下所示:
<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>
我想要发生的是,当我最终运行 mvn gatling:execute 时,我不想下载任何依赖项,我希望在构建时将它们全部烘焙到映像中。
但是,即使执行 mvn dependencies:go-offline scala:testCompile 也无法让我顺利完成任务。运行gatling:execute 仍然需要下载更多的依赖项。
我如何将 Maven 所需的所有内容下载到我的 Docker 映像中,这样就不需要在运行时进行下载?
【问题讨论】:
-
您是否尝试过将 Gatling 执行绑定到一个阶段,并查看 dependencies:go-offline 是否能够接受它?
-
你有什么建议?很抱歉,漫长的一天,不确定您的意思。
-
类似于
integration-test execute -
问题是我不能运行
gatling:execute没有大量pwning 端点;) -
这是可以理解的,但如果您不经过 mvn package 阶段,这不是问题。不管怎样,如果 Gatling 依赖项绑定到一个阶段,maven 依赖插件是否找到了它们?