Maven项目中mvn test执行TestNG配置文件

           <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>3.0.0-M5</version>
                <configuration>
                    <!-- Suite testng xml file to consider for test execution -->
                    <suiteXmlFiles>
                    <!--mvn test命令默认执行的testng.xml文件名 -->
                        <suiteXmlFile>testng2.xml</suiteXmlFile>
                    </suiteXmlFiles>
                    <!--mvn test命令输出默认报告的文件目录 -->
                    <reportsDirectory>${basedir}/test-out</reportsDirectory>

                </configuration>
            </plugin>
原文地址:https://www.cnblogs.com/zizhuxuexi/p/14748631.html