一、項目的pom.xml要配置插件,同時指定testng.xml文件的位置。就被這個卡了很久apache
<properties> <maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version> <suiteXmlFile>src/test/testng.xml</suiteXmlFile> </properties> <dependencies> <dependency> <groupId>org.testng</groupId> <artifactId>testng</artifactId> <version>6.9.10</version> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>${maven-surefire-plugin.version}</version> <configuration> <suiteXmlFiles> <suiteXmlFile>${suiteXmlFile}</suiteXmlFile> </suiteXmlFiles> </configuration> </plugin> </plugins> </build>
二、Jenkins job配置相對簡單maven