我正在使用maven-invoker-plugin运行大约20个集成测试。我想使用并行线程,这很简单--只需添加适当的配置元素即可。
我的问题是我使用的是一个独立的自定义本地存储库。当我同步运行这两个测试时,第一个测试大约需要130秒,因为它下载了执行构建所需的全套maven插件和其他部分。剩下的时间大约是5-10秒。例如,当我添加parallelThreads=5时,我的前五个测试并行运行,但都安装了相同的依赖关系图。
我尝试使用来拥有一个首先运行的项目,它将有效地启动所有集成测试共享的本地存储库。
不走运。如果我转到parallelThreads=5,我会得到我的安装项目以及其他项目,所有这些都是同时运行的。我想要的是一种方法,让这样的安装项目运行在所有其他项目之前,即使并行线程是多个的。
我已经尝试过了。然而,这需要我显式地列出每个版本的每个工件,要安装的工件,并且不计算传递依赖(看起来是这样)。我最终需要管理一个非常脆弱的依赖项列表。
发布于 2013-05-28 15:52:27
maven-invoker-plugin的配置有机会运行setupIncludes,但不幸的是,目前有一个bug in maven-invoker-plugin which exactly failes in the situation。
但是您可以通过使用如下所示的extraArtifact配置来解决这个问题:
<executions>
<execution>
<id>pre-integration-tests</id>
<goals>
<goal>install</goal>
</goals>
<configuration>
<extraArtifacts>
<extraArtifact>junit:junit:4.8:jar</extraArtifact>
<extraArtifact>com.soebes.maven.plugins:maven-echo-plugin:0.1:maven-plugin</extraArtifact>
<extraArtifact>org.apache.maven.surefire:surefire-junit4:2.10:jar</extraArtifact>
<extraArtifact>org.apache.maven.plugins:maven-surefire-plugin:2.10:maven-plugin</extraArtifact>
<extraArtifact>org.apache.maven.plugins:maven-assembly-plugin:2.4:maven-plugin</extraArtifact>
<extraArtifact>org.apache.maven.plugins:maven-war-plugin:2.1.1:maven-plugin</extraArtifact>
<extraArtifact>org.apache.maven.plugins:maven-resources-plugin:2.6:maven-plugin</extraArtifact>
<extraArtifact>org.apache.maven.plugins:maven-resources-plugin:2.5:maven-plugin</extraArtifact>
<extraArtifact>org.apache.maven.plugins:maven-resources-plugin:2.4.3:maven-plugin</extraArtifact>
</extraArtifacts>
</configuration>
</execution>因此,您可以定义集成测试期间所需的所有依赖项。要么是插件,要么是通常的依赖项。
https://stackoverflow.com/questions/16785718
复制相似问题