我在pom.xml中具有以下条目,其中包含在配置中定义的套件文件。
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>testng.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>
Run Code Online (Sandbox Code Playgroud)
使用Maven在cmd中运行此代码的正确方法是什么?我可以使用下面的命令运行测试,但是当pom中已经定义了testng.xml时,在命令中再次指示testng.xml是没有意义的。
mvn clean test -DsuiteXmlFile=testng.xml
Run Code Online (Sandbox Code Playgroud)