mvn网站总是在/ target目录中寻找诱惑结果。但是,在我的项目基目录中生成了allure-results目录。
我正在使用诱惑2以下是我的pom文件配置。
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<cucumber.version>1.2.5</cucumber.version>
<extentreports.version>3.0.6</extentreports.version>
<spring.version>4.1.5.RELEASE</spring.version>
<selenium.version>3.4.0</selenium.version>
<testng.version>6.10</testng.version>
<aspectj.version>1.8.10</aspectj.version>
<allure.results.directory>allure-results</allure.results.directory>
<allure.report.directory>${basedir}\test-output\allure-report</allure.report.directory>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<allure.results_pattern>allure-results</allure.results_pattern>
</properties>
....
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.21.0</version>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>TestNG.xml</suiteXmlFile>
</suiteXmlFiles>
<argLine>
-javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar"
</argLine>
<systemProperties>
<property>
<name>allure.results.directory</name>
<value>${allure.results.directory}</value>
</property>
</systemProperties>
<!-- <resultsDirectory>${allure.results.directory}</resultsDirectory> -->
<!-- <reportsDirectory>${allure.report.directory}</reportsDirectory> -->
</configuration>
<dependencies>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>${aspectj.version}</version>
</dependency>
</dependencies>
</plugin>
....
<dependency>
<groupId>io.qameta.allure</groupId>
<artifactId>allure-testng</artifactId>
<version>2.6.0</version>
</dependency>
....
<reporting>
<excludeDefaults>true</excludeDefaults>
<plugins>
<plugin>
<groupId>io.qameta.allure</groupId>
<artifactId>allure-maven</artifactId>
<version>2.9</version>
<configuration>
<reportVersion>2.6.0</reportVersion>
<resultsPattern>${allure.results_pattern}</resultsPattern>
<!-- <outputDirectory>${allure.report.directory}</outputDirectory> -->
<!-- <allureResultsDirectory>${allure.results.directory}</allureResultsDirectory> -->
<resultsDirectory>${allure.results.directory}</resultsDirectory>
<reportDirectory>${allure.report.directory}</reportDirectory>
</configuration>
</plugin>
</plugins>
</reporting>
答案 0 :(得分:0)
您可以通过创建包含以下内容的allure-results
文件来更改src/test/resources/allure.properties
生成路径:
allure.results.directory=target/allure-results
更新
在创建allure-results
allure.properties
个变量中清除pom.xml