1
votes

I updated Allure ver from 1.2.2 to 1.4. And now I have an error, executing mvn clean test.

Stack:

` T E S T S

Running qwer.selenium.LoginTest Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.065 sec <<< FAILURE! - in qwer.selenium.LoginTest initializationError(qwer.selenium.LoginTest) Time elapsed: 0.016 sec <<< ERROR! java.lang.NoClassDefFoundError: Lru/yandex/qatools/allure/junit/TestSuiteReportRule; at java.lang.Class.getDeclaredFields0(Native Method) at java.lang.Class.privateGetDeclaredFields(Class.java:2436) at java.lang.Class.getDeclaredFields(Class.java:1806) at org.junit.runners.model.TestClass.(TestClass.java:49) at org.junit.runners.ParentRunner.(ParentRunner.java:75) at org.junit.runners.BlockJUnit4ClassRunner.(BlockJUnit4ClassRunner.java:57) at org.junit.internal.builders.JUnit4Builder.runnerForClass(JUnit4Builder.java:10) at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59) at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26) at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59) at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:26) at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:262) at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153) at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124) at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103) Caused by: java.lang.ClassNotFoundException: ru.yandex.qatools.allure.junit.TestSuiteReportRule at java.net.URLClassLoader$1.run(URLClassLoader.java:366) at java.net.URLClassLoader$1.run(URLClassLoader.java:355) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:354) at java.lang.ClassLoader.loadClass(ClassLoader.java:425) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:358) at java.lang.Class.getDeclaredFields0(Native Method) at java.lang.Class.privateGetDeclaredFields(Class.java:2436) at java.lang.Class.getDeclaredFields(Class.java:1806) at org.junit.runners.model.TestClass.(TestClass.java:49) at org.junit.runners.ParentRunner.(ParentRunner.java:75) at org.junit.runners.BlockJUnit4ClassRunner.(BlockJUnit4ClassRunner.java:57) at org.junit.internal.builders.JUnit4Builder.runnerForClass(JUnit4Builder.java:10) at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59) at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26) at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59) at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:26) at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:262) at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153) at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124) at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)`

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>

`

1

1 Answers

2
votes

thanks for the feedback

First of all, remove allure-junit-plugin from your project configuration. It's solve your problem

Then change version of allure-maven-plugin to 2.0.


Also you can read migration guide from 1.3.* to 1.4 https://github.com/allure-framework/allure-core/wiki/Upgrading-to-1.4

PS today we release allure version 1.4.1