为什么maven-surefire-plugin不按优先级顺序运行testng.xml文件?

时间:2019-10-03 10:02:37

标签: testng maven-surefire-plugin

我的pom.xml文件没有按优先级顺序运行测试脚本。我已经提到了优先级,例如priority = 0、1等。但是它从包中随机选择类。它应该按照优先级顺序运行。通过testng.xml触发器可以正常工作。

<build>
      <plugins>
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
               <source>1.8</source>
               <target>1.8</target>
            </configuration>
         </plugin>
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.19.1</version>
                <configuration>
                    <suiteXmlFiles>
                        <suiteXmlFile>${suiteXmlFile}</suiteXmlFile>
                    </suiteXmlFiles>
                </configuration>
         </plugin>
      </plugins>
   </build>

可能是什么原因?

1 个答案:

答案 0 :(得分:0)

这是由于执行环境设置为JRE而不是JDK。 因此,将工作空间默认值从JRE更改为JDK可以解决此问题。 对于JRE HOME,我给了C:\ Program Files \ Java \ jdk1.8.0_171 enter image description here

因为必须具有JDK才能进行编译。

相关问题