1

我将 Allure ver 从 1.2.2 更新到 1.4。现在我有一个错误,执行mvn clean test

堆:

` 测试

运行 qwer.selenium.LoginTest 测试运行:1,失败:0,错误:1,跳过:0,经过的时间:0.065 秒 <<< 失败!- 在 qwer.selenium.LoginTest 初始化错误(qwer.selenium.LoginTest)中经过的时间:0.016 秒 <<< 错误!java.lang.NoClassDefFoundError: Lru/yandex/qatools/allure/junit/TestSuiteReportRule; 在 java.lang.Class.getDeclaredFields0(Native Method) 在 java.lang.Class.privateGetDeclaredFields(Class.java:2436) 在 java.lang.Class.getDeclaredFields(Class.java:1806) 在 org.junit.runners.model .TestClass.(TestClass.java:49) 在 org.junit.runners.ParentRunner.(ParentRunner.java:75) 在 org.junit.runners.BlockJUnit4ClassRunner.(BlockJUnit4ClassRunner.java:57) 在 org.junit.internal.builders .JUnit4Builder.runnerForClass(JUnit4Builder.java:10) 在 org.junit.runners.model.RunnerBuilder。

pom.xml:`http://maven.apache.org/xsd/maven-4.0.0.xsd">4.0.0

<groupId>qwer</groupId>
<artifactId>qwer</artifactId>
<version>1.2-SNAPSHOT</version>

<!--Allure version, needed here for allure-maven-plugin. It can be moved to parent pom.-->
<properties>
    <allure.version>1.4.0</allure.version>
    <selenium.version>2.42.2</selenium.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<!--This dependency is necessary for Allure JUnit plugin. It can be moved to parent pom.-->
<dependencies>
    <dependency>
        <groupId>ru.yandex.qatools.allure</groupId>
        <artifactId>allure-junit-adaptor</artifactId>
        <version>${allure.version}</version>
    </dependency>
    <dependency>
        <groupId>ru.yandex.qatools.properties</groupId>
        <artifactId>properties-loader</artifactId>
        <version>1.5</version>
    </dependency>
    <dependency>
        <groupId>ru.yandex.qatools.htmlelements</groupId>
        <artifactId>htmlelements-java</artifactId>
        <version>1.12</version>
    </dependency>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.11</version>
    </dependency>
    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-java</artifactId>
        <version>${selenium.version}</version>
    </dependency>
    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-firefox-driver</artifactId>
        <version>${selenium.version}</version>
    </dependency>
    <dependency>
        <groupId>com.github.detro.ghostdriver</groupId>
        <artifactId>phantomjsdriver</artifactId>
        <version>1.1.0</version>
    </dependency>
</dependencies>

<!--Allure JUnit plugin. It can be moved to parent pom. -->
<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.1</version>
            <configuration>
                <source>1.7</source>
                <target>1.7</target>
            </configuration>
        </plugin>
        <plugin>
            <groupId>ru.yandex.qatools.allure</groupId>
            <artifactId>allure-junit-plugin</artifactId>
            <version>1.2.4</version>
            <executions>
                <execution>
                    <phase>test-compile</phase>
                    <goals>
                        <goal>allure</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.17</version>
            <configuration>
                <testFailureIgnore>true</testFailureIgnore>
                <includes>
                    <include>**/*.class</include>
                </includes>
                <excludes>
                    <exclude>**/RawTest.*</exclude>
                    <exclude>**/OutboxDocumentTest.*</exclude>
                </excludes>
            </configuration>
        </plugin>
    </plugins>
</build>

<!--Allure Maven Plugin. It can be moved to parent pom-->
<reporting>
    <excludeDefaults>true</excludeDefaults>
    <plugins>
        <plugin>
            <groupId>ru.yandex.qatools.allure</groupId>
            <artifactId>allure-maven-plugin</artifactId>
            <version>${allure.version}</version>
        </plugin>
    </plugins>
</reporting>

`

4

1 回答 1

2

感谢您的反馈

首先,从项目配置中删除allure-junit-plugin 。它解决了你的问题

然后将allure-maven-plugin的版本更改为2.0


您还可以阅读从 1.3.* 到 1.4 的迁移指南 https://github.com/allure-framework/allure-core/wiki/Upgrading-to-1.4

PS今天我们发布allure 1.4.1版本

于 2014-09-11T15:58:54.177 回答