【发布时间】:2018-01-08 14:51:00
【问题描述】:
我遇到了一个 Maven 问题,在互联网上我找不到任何答案。如果有人可以帮助我,我将不胜感激。我的目标是测试作为参数发送到 POM 的 2 个 testng 文件:
mvn clean test -DsuiteXmlFiles=1.xml,2.xml
POM 文件是:
<plugins>
<!-- Following plugin executes the testng tests -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
<configuration>
<!-- Suite testng xml file to consider for test execution -->
<suiteXmlFiles>
<suiteXmlFile>${suiteXmlFile}</suiteXmlFile>
</suiteXmlFiles>
<testFailureIgnore>true</testFailureIgnore>
</configuration>
</plugin>
<!-- Compiler plugin configures the java version to be usedfor compiling
the code -->
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
但是,当我运行时,它只运行 2.xml 文件并运行两次!!!
尝试了许多选项,但无论第二个 xml 文件是什么,它都会完全忽略第一个并运行第二个两次。
有人可以帮忙吗?
谢谢
【问题讨论】:
-
您能否详细说明您尝试过的其他选项?
标签: maven testng maven-surefire-plugin