maven testng 运行指定的suite.xml

有时候,需要项目中会有多个测试套件,想要在不同的环境指定运行maven 指定的testng的suite.xml配置文件。

第一步 在pom.xml中添加配置

<build>
	<plugins>
		<plugin>
			<groupId>org.apache.maven.plugins</groupId>
			<artifactId>maven-surefire-plugin</artifactId>
		</plugin>
	</plugins>
</build>

 第二步,在运行的命令中指定要运行的suite

mvn clean test -Dsurefire.suiteXmlFiles=src/test/java/game-unit-test-suite.xml

 转自:http://www.xinyues.com/h-nd-188.html#_np=2_560

原文地址:https://www.cnblogs.com/wgslucky/p/11203825.html