Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/393.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/docker/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 是否可以通过Maven POM文件针对特定的TestNG.xml文件?_Java_Xml_Maven_Testing_Selenium Webdriver - Fatal编程技术网

Java 是否可以通过Maven POM文件针对特定的TestNG.xml文件?

Java 是否可以通过Maven POM文件针对特定的TestNG.xml文件?,java,xml,maven,testing,selenium-webdriver,Java,Xml,Maven,Testing,Selenium Webdriver,可以只针对Maven POM文件中列出的两个TestNG xml文件中的一个吗 我的Maven POM文件指向两个xml文件:uat.xml和prepod.xml,如何使用Maven命令(如mvn clean compile test)仅针对其中一个xml文件 <build> <pluginManagement> <plugins> <plugin> <group

可以只针对Maven POM文件中列出的两个TestNG xml文件中的一个吗

我的Maven POM文件指向两个xml文件:uat.xml和prepod.xml,如何使用Maven命令(如mvn clean compile test)仅针对其中一个xml文件

<build>
    <pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.6.1</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <fork>true</fork>
                    <!--<executable>C:\Program Files\Java\jdk1.8.0_121\bin\javac.exe</executable> -->
                    <executable>${env.JAVA_HOME}\bin\javac.exe</executable>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.20</version>
                <configuration>
                    <suiteXmlFiles>
                        <suiteXmlFile>uat.xml</suiteXmlFile>
                        <suiteXmlFile>preprod.xml</suiteXmlFile>
                    </suiteXmlFiles>
                    <testErrorIgnore>false</testErrorIgnore>
                    <testFailureIgnore>false</testFailureIgnore>
                </configuration>
            </plugin>
        </plugins>
    </pluginManagement>
</build>

org.apache.maven.plugins
maven编译器插件
3.6.1
1.8
1.8
真的
${env.JAVA\u HOME}\bin\javac.exe
org.apache.maven.plugins
maven surefire插件
2.20
uat.xml
prepod.xml
假的
假的

见下文。您将按名称引用该文件。所以

mvn清洁测试-Dtestfile=uat.xml

<configuration>
  <suiteXmlFiles>
    <suiteXmlFile>${testfile}</suiteXmlFile>
  </suiteXmlFiles>
</configuration>

${testfile}

见下文。您将按名称引用该文件。所以

mvn清洁测试-Dtestfile=uat.xml

<configuration>
  <suiteXmlFiles>
    <suiteXmlFile>${testfile}</suiteXmlFile>
  </suiteXmlFiles>
</configuration>

${testfile}