我将 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>
`