serenity-bdd / serenity-cucumber

Cucumber integration for the Serenity BDD Reporting library
Other
78 stars 74 forks source link

Maven build failing with NoSuchFieldError: SERENITY_FORK_NUMBER #186

Closed rgladwell closed 5 years ago

rgladwell commented 5 years ago

The following POM file running on a Windows system with maven version 3.6.0 fails with a java.lang.NoSuchFieldError: SERENITY_FORK_NUMBER error message:

<?xml version="1.0" encoding="UTF-8"?>
<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">
    <groupId>me.gladwell.test</groupId>
    <version>0.0.1-SNAPSHOT</version>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>component-tests</artifactId>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <serenity.version>1.9.20</serenity.version>
        <serenity.maven.version>1.9.20</serenity.maven.version>
        <selenium.version>3.12.0</selenium.version>
    </properties>

    <dependencies>

        <dependency>
            <groupId>net.serenity-bdd</groupId>
            <artifactId>serenity-core</artifactId>
            <version>${serenity.version}</version>
        </dependency>

        <dependency>
            <groupId>net.serenity-bdd</groupId>
            <artifactId>serenity-junit</artifactId>
            <version>${serenity.version}</version>
        </dependency>

        <dependency>
            <groupId>net.serenity-bdd</groupId>
            <artifactId>serenity-cucumber</artifactId>
            <version>${serenity.version}</version>
        </dependency>

    </dependencies>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>2.18</version>
                <configuration>
                    <includes>
                        <include>com/unibet/bonuscampaign/tests/component/ComponentTestRunner.java</include>
                    </includes>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>integration-test</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>net.serenity-bdd.maven.plugins</groupId>
                <artifactId>serenity-maven-plugin</artifactId>
                <version>${serenity.maven.version}</version>
                <executions>
                    <execution>
                        <id>serenity-reports</id>
                        <phase>post-integration-test</phase>
                        <goals>
                            <goal>aggregate</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>
ashishgupta0007 commented 5 years ago

@rgladwell I am facing the same error. Please share the solution.

wakaleo commented 5 years ago

I think this is a maven issue? Try upgrading the maven-failsafe-plugin version.

ashishgupta0007 commented 5 years ago

I have upgraded the maven-failsafe-plugin version to 2.22.1 but still getting same error.

wakaleo commented 5 years ago

Are you using a recent version of Serenity?

sachin-s-joshi commented 5 years ago

What was the fix for this issue? I am also facing same issue using serenity 1.9.17 version And Maven failsafe version is -2.22.1