【发布时间】:2018-02-08 12:42:23
【问题描述】:
我有一个为整个项目运行集成测试的子模块,它有几个模块。这是集成测试子模块 pom:
<?xml version="1.0"?>
<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.sample.server</groupId>
<artifactId>jacoco-test</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<groupId>com.sample.server.modules</groupId>
<artifactId>integration_test</artifactId>
<version>1.0-SNAPSHOT</version>
<name>integration_test</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.9.4</version>
</dependency>
<dependency>
<groupId>com.sample.server.modules</groupId>
<artifactId>api</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.20.1</version>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>${project.basedir}/testng/api.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</execution>
</executions>
</plugin>
</project>
当我执行 mvn install 或 verify 时,所有独立测试都会运行,之后 xml 套件也会运行。
我只想运行套件文件,我需要这样做,因为套件之外的某些测试失败。 我尝试使用排除选项,但故障安全忽略了该选项。
我该怎么做?
【问题讨论】:
标签: java maven maven-failsafe-plugin