首页 > 其他 > 详细

Maven项目中,命令执行特定的testng.xml配置文件

时间:2021-05-16 01:09:42      阅读:13      评论:0      收藏:0      [点我收藏+]
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>org.example</groupId>
    <artifactId>TheDemo</artifactId>
    <version>1.0-SNAPSHOT</version>
    <dependencies>
      ...
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>3.0.0-M5</version>
                <configuration>
                    <!-- <suiteXmlFile>${testng.xml}</suiteXmlFile>配置,然后执行:mvn test -Dtestng.xml=xxx.xml(需要执行testng文件名) -->
                    <suiteXmlFiles>
                        <suiteXmlFile>${testng.xml}</suiteXmlFile>
                    </suiteXmlFiles>
                    <reportsDirectory>${basedir}/test-out</reportsDirectory>

                </configuration>
            </plugin>
            <plugin>
              
            </plugin>
        </plugins>
    </build>

</project>

Maven项目中,命令执行特定的testng.xml配置文件

原文:https://www.cnblogs.com/zizhuxuexi/p/14772947.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!