allure结果为空

c6ubokkw  于 2021-07-03  发布在  Java
关注(0)|答案(2)|浏览(422)

我在pomxml中配置了allure来生成测试报告,当我通过maven触发测试时,allure结果xml是空的。但是,当intellij触发相同的测试时,结果是正确的。有人能帮我找出哪里出了问题吗。这是工作,直到最后一天,突然之间没有任何变化对pom这是这样的行为。下面是pom xml代码

`<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>fgrest</groupId>
  <artifactId>fgrest</artifactId>
  <version>0.0.1-SNAPSHOT</version>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>8</source>
                    <target>8</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.20</version>
                <configuration>
                    <argLine>
                        -javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar"
                    </argLine>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.aspectj</groupId>
                        <artifactId>aspectjweaver</artifactId>
                        <version>${aspectj.version}</version>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <groupId>io.qameta.allure</groupId>
                <artifactId>allure-maven</artifactId>
                <version>2.10.0</version>
                <configuration>
                    <resultsDirectory>${project.basedir}/target/allure-results</resultsDirectory>
                    <reportingOutputDirectory>${project.basedir}/target/allure-reports</reportingOutputDirectory>
                </configuration>
            </plugin>
            <plugin>
                <groupId>ru.yandex.qatools.allure</groupId>
                <artifactId>allure-maven-plugin</artifactId>
                <version>2.6</version>
            </plugin>
        </plugins>
    </build>

    <packaging>jar</packaging>

  <name>xxxx</name>
  <url>http://maven.apache.org</url>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
      <aspectj.version>1.8.10</aspectj.version>
      <allure.results.directory>${project.basedir}/target/allure-results</allure.results.directory>
      <allure.report.directory>${project.basedir}/target/allure-report</allure.report.directory>
  </properties>

  <dependencies>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>3.8.1</version>
        <scope>test</scope>
    </dependency>
        <dependency>
            <groupId>com.jayway.jsonpath</groupId>
            <artifactId>json-path</artifactId>
            <version>2.4.0</version>
        </dependency>
    <dependency>
        <groupId>io.rest-assured</groupId>
        <artifactId>rest-assured</artifactId>
        <version>3.1.1</version>
    </dependency>
    <dependency>
        <groupId>org.testng</groupId>
        <artifactId>testng</artifactId>
        <version>6.14.3</version>
    </dependency>
    <dependency>
        <groupId>org.json</groupId>
        <artifactId>json</artifactId>
        <version>20180813</version>
  </dependency>
  <dependency>
        <groupId>com.google.code.gson</groupId>
        <artifactId>gson</artifactId>
        <version>2.8.5</version>
  </dependency>
  <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-databind</artifactId>
        <version>2.9.8</version>
  </dependency>
  <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi-ooxml</artifactId>
            <version>4.1.0</version>
        </dependency>
      <dependency>
          <groupId>io.qameta.allure</groupId>
          <artifactId>allure-testng</artifactId>
          <version>2.10.0</version>
          <scope>test</scope>
      </dependency>
      <dependency>
          <groupId>ru.yandex.qatools.allure</groupId>
          <artifactId>allure-testng-adaptor</artifactId>
          <version>1.5.4</version>
          <exclusions>
              <exclusion>
                  <groupId>junit</groupId>
                  <artifactId>junit</artifactId>
              </exclusion>
          </exclusions>
      </dependency>
      <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-server</artifactId>
            <version>3.14.0</version>
        </dependency>
      <dependency>
          <groupId>ru.yandex.qatools.allure</groupId>
          <artifactId>allure-java-adaptor-api</artifactId>
          <version>1.5.4</version>
          <scope>compile</scope>
      </dependency>
  </dependencies>
</project>
q5lcpyga

q5lcpyga1#

测试正在运行,只有诱惑报告生成有问题。不管怎样,经过大量的谷歌搜索,我终于解决了这个问题。我已经在plugin标签的dependencies部分添加了aspect jweaver依赖项,并将surefire插件更新到3.0.0-m1版本,现在allure results xml中填充了数据。

mrphzbgm

mrphzbgm2#

你能提供以下细节吗,
测试是否正在运行,只有诱惑报告生成有问题。
请提供您使用的maven命令。

相关问题