<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.19.1</version> <configuration> <forkCount>3</forkCount> <reuseForks>true</reuseForks> <argLine> -javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar" </argLine> <suiteXmlFiles> <suiteXmlFile>${suiteXmlFile}</suiteXmlFile> </suiteXmlFiles> <testFailureIgnore>true</testFailureIgnore> <systemProperties> <propertiesFilePath>src/test/resources/allure.properties</propertiesFilePath> </systemProperties> </configuration> <dependencies> <dependency> <groupId>org.aspectj</groupId> <artifactId>aspectjweaver</artifactId> <version>${aspectj.version}</version> </dependency> </dependencies> </plugin> </plugins> </build> ``` report: allure-maven
<reporting> <excludeDefaults>true</excludeDefaults> <plugins> <plugin> <groupId>io.qameta.allure</groupId> <artifactId>allure-maven</artifactId> <version>2.10.0</version> <configuration> <reportVersion>${allure.version}</reportVersion> </configuration> </plugin> </plugins> </reporting> 2.2 allure.properties
allure.results.directory=target/allure-results allure.link.issue.pattern=https://example.org/issue/{} allure.link.tms.pattern=https://example.org/tms/{} 2.3 运行命令
mvn clean test -DsuiteXmlFile=src/test/resources/testng_sanity.xml
生成allure报告:mvn io.qameta.allure:allure-maven:serve OR mvn io.qameta.allure:allure-maven:report
Integrate with Jenkins 3.