I'm trying to get the base for a serenity-cucumber5 project going by tweaking a starter project I found on GitHub. I've updated the pom.xml file with the latest version numbers so it won't error out anymore, but when I run it through a maven (mvn clean verify), I get a build success, but no tests actually run and I get the following error and stack trace:
java.lang.NoClassDefFoundError: gherkin/ParserException
at net.thucydides.core.requirements.FileSystemRequirementsTagProvider.loadFromFeatureFile (FileSystemRequirementsTagProvider.java:609)
at net.thucydides.core.requirements.FileSystemRequirementsTagProvider.readRequirementsFromStoryOrFeatureFile (FileSystemRequirementsTagProvider.java:564)
at java.util.stream.ReferencePipeline$3$1.accept (ReferencePipeline.java:195)
at java.util.Spliterators$ArraySpliterator.forEachRemaining (Spliterators.java:948)
at java.util.stream.AbstractPipeline.copyInto (AbstractPipeline.java:484)
at java.util.stream.AbstractPipeline.wrapAndCopyInto (AbstractPipeline.java:474)
at java.util.stream.ForEachOps$ForEachOp.evaluateSequential (ForEachOps.java:150)
at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential (ForEachOps.java:173)
at java.util.stream.AbstractPipeline.evaluate (AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.forEach (ReferencePipeline.java:497)
at net.thucydides.core.requirements.FileSystemRequirementsTagProvider.capabilitiesAndStoriesIn (FileSystemRequirementsTagProvider.java:196)
at java.util.stream.ReferencePipeline$3$1.accept (ReferencePipeline.java:195)
at java.util.HashMap$KeySpliterator.forEachRemaining (HashMap.java:1694)
at java.util.stream.AbstractPipeline.copyInto (AbstractPipeline.java:484)
at java.util.stream.AbstractPipeline.wrapAndCopyInto (AbstractPipeline.java:474)
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential (ReduceOps.java:913)
at java.util.stream.AbstractPipeline.evaluate (AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.collect (ReferencePipeline.java:578)
at net.thucydides.core.requirements.FileSystemRequirementsTagProvider.getRequirements (FileSystemRequirementsTagProvider.java:178)
at net.thucydides.core.requirements.FileSystemRequirementsTagProvider.readChildrenFrom (FileSystemRequirementsTagProvider.java:726)
at net.thucydides.core.requirements.FileSystemRequirementsTagProvider.requirementFromDirectoryName (FileSystemRequirementsTagProvider.java:635)
at net.thucydides.core.requirements.FileSystemRequirementsTagProvider.readRequirementFrom (FileSystemRequirementsTagProvider.java:557)
at java.util.stream.ReferencePipeline$3$1.accept (ReferencePipeline.java:195)
at java.util.Spliterators$ArraySpliterator.forEachRemaining (Spliterators.java:948)
at java.util.stream.AbstractPipeline.copyInto (AbstractPipeline.java:484)
at java.util.stream.AbstractPipeline.wrapAndCopyInto (AbstractPipeline.java:474)
at java.util.stream.ForEachOps$ForEachOp.evaluateSequential (ForEachOps.java:150)
at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential (ForEachOps.java:173)
at java.util.stream.AbstractPipeline.evaluate (AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.forEach (ReferencePipeline.java:497)
at net.thucydides.core.requirements.FileSystemRequirementsTagProvider.capabilitiesAndStoriesIn (FileSystemRequirementsTagProvider.java:192)
at java.util.stream.ReferencePipeline$3$1.accept (ReferencePipeline.java:195)
at java.util.HashMap$KeySpliterator.forEachRemaining (HashMap.java:1694)
at java.util.stream.AbstractPipeline.copyInto (AbstractPipeline.java:484)
at java.util.stream.AbstractPipeline.wrapAndCopyInto (AbstractPipeline.java:474)
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential (ReduceOps.java:913)
at java.util.stream.AbstractPipeline.evaluate (AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.collect (ReferencePipeline.java:578)
at net.thucydides.core.requirements.FileSystemRequirementsTagProvider.getRequirements (FileSystemRequirementsTagProvider.java:178)
at net.thucydides.core.requirements.RequirementsProvided.by (RequirementsProvided.java:15)
at net.thucydides.core.requirements.reports.MultipleSourceRequirmentsOutcomeFactory.buildRequirementsOutcomesFrom (MultipleSourceRequirmentsOutcomeFactory.java:57)
at net.thucydides.core.reports.html.HtmlAggregateStoryReporter.generateReportsForTestResultsIn (HtmlAggregateStoryReporter.java:154)
at net.thucydides.core.reports.html.HtmlAggregateStoryReporter.generateReportsForTestResultsFrom (HtmlAggregateStoryReporter.java:136)
at net.serenitybdd.maven.plugins.SerenityAggregatorMojo.generateHtmlStoryReports (SerenityAggregatorMojo.java:250)
at net.serenitybdd.maven.plugins.SerenityAggregatorMojo.execute (SerenityAggregatorMojo.java:193)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:64)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:564)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
at org.codehaus.classworlds.Launcher.main (Launcher.java:47)
Caused by: java.lang.ClassNotFoundException: gherkin.ParserException
at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass (SelfFirstStrategy.java:50)
at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass (ClassRealm.java:271)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass (ClassRealm.java:247)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass (ClassRealm.java:239)
at net.thucydides.core.requirements.FileSystemRequirementsTagProvider.loadFromFeatureFile (FileSystemRequirementsTagProvider.java:609)
at net.thucydides.core.requirements.FileSystemRequirementsTagProvider.readRequirementsFromStoryOrFeatureFile (FileSystemRequirementsTagProvider.java:564)
at java.util.stream.ReferencePipeline$3$1.accept (ReferencePipeline.java:195)
at java.util.Spliterators$ArraySpliterator.forEachRemaining (Spliterators.java:948)
at java.util.stream.AbstractPipeline.copyInto (AbstractPipeline.java:484)
at java.util.stream.AbstractPipeline.wrapAndCopyInto (AbstractPipeline.java:474)
at java.util.stream.ForEachOps$ForEachOp.evaluateSequential (ForEachOps.java:150)
at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential (ForEachOps.java:173)
at java.util.stream.AbstractPipeline.evaluate (AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.forEach (ReferencePipeline.java:497)
at net.thucydides.core.requirements.FileSystemRequirementsTagProvider.capabilitiesAndStoriesIn (FileSystemRequirementsTagProvider.java:196)
at java.util.stream.ReferencePipeline$3$1.accept (ReferencePipeline.java:195)
at java.util.HashMap$KeySpliterator.forEachRemaining (HashMap.java:1694)
at java.util.stream.AbstractPipeline.copyInto (AbstractPipeline.java:484)
at java.util.stream.AbstractPipeline.wrapAndCopyInto (AbstractPipeline.java:474)
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential (ReduceOps.java:913)
at java.util.stream.AbstractPipeline.evaluate (AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.collect (ReferencePipeline.java:578)
at net.thucydides.core.requirements.FileSystemRequirementsTagProvider.getRequirements (FileSystemRequirementsTagProvider.java:178)
at net.thucydides.core.requirements.FileSystemRequirementsTagProvider.readChildrenFrom (FileSystemRequirementsTagProvider.java:726)
at net.thucydides.core.requirements.FileSystemRequirementsTagProvider.requirementFromDirectoryName (FileSystemRequirementsTagProvider.java:635)
at net.thucydides.core.requirements.FileSystemRequirementsTagProvider.readRequirementFrom (FileSystemRequirementsTagProvider.java:557)
at java.util.stream.ReferencePipeline$3$1.accept (ReferencePipeline.java:195)
at java.util.Spliterators$ArraySpliterator.forEachRemaining (Spliterators.java:948)
at java.util.stream.AbstractPipeline.copyInto (AbstractPipeline.java:484)
at java.util.stream.AbstractPipeline.wrapAndCopyInto (AbstractPipeline.java:474)
at java.util.stream.ForEachOps$ForEachOp.evaluateSequential (ForEachOps.java:150)
at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential (ForEachOps.java:173)
at java.util.stream.AbstractPipeline.evaluate (AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.forEach (ReferencePipeline.java:497)
at net.thucydides.core.requirements.FileSystemRequirementsTagProvider.capabilitiesAndStoriesIn (FileSystemRequirementsTagProvider.java:192)
at java.util.stream.ReferencePipeline$3$1.accept (ReferencePipeline.java:195)
at java.util.HashMap$KeySpliterator.forEachRemaining (HashMap.java:1694)
at java.util.stream.AbstractPipeline.copyInto (AbstractPipeline.java:484)
at java.util.stream.AbstractPipeline.wrapAndCopyInto (AbstractPipeline.java:474)
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential (ReduceOps.java:913)
at java.util.stream.AbstractPipeline.evaluate (AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.collect (ReferencePipeline.java:578)
at net.thucydides.core.requirements.FileSystemRequirementsTagProvider.getRequirements (FileSystemRequirementsTagProvider.java:178)
at net.thucydides.core.requirements.RequirementsProvided.by (RequirementsProvided.java:15)
at net.thucydides.core.requirements.reports.MultipleSourceRequirmentsOutcomeFactory.buildRequirementsOutcomesFrom (MultipleSourceRequirmentsOutcomeFactory.java:57)
at net.thucydides.core.reports.html.HtmlAggregateStoryReporter.generateReportsForTestResultsIn (HtmlAggregateStoryReporter.java:154)
at net.thucydides.core.reports.html.HtmlAggregateStoryReporter.generateReportsForTestResultsFrom (HtmlAggregateStoryReporter.java:136)
at net.serenitybdd.maven.plugins.SerenityAggregatorMojo.generateHtmlStoryReports (SerenityAggregatorMojo.java:250)
at net.serenitybdd.maven.plugins.SerenityAggregatorMojo.execute (SerenityAggregatorMojo.java:193)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:64)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:564)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
at org.codehaus.classworlds.Launcher.main (Launcher.java:47)
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>
<name>serenity-cucumber5-starter</name>
<groupId>net.serenity-bdd</groupId>
<artifactId>serenity-cucumber5</artifactId>
<version>2.1.3-SNAPSHOT</version>
<description>Serenity Cucumber integration</description>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<bintray.repo>serenity/maven</bintray.repo>
<bintray.package>serenity-cucumber5</bintray.package>
<java.version>1.8</java.version>
<serenity.version>2.1.2</serenity.version>
<cucumber.version>6.10.3</cucumber.version>
<maven.core.version>3.5.0</maven.core.version>
<maven.repoorting.version>3.0</maven.repoorting.version>
<maven.plugin.version>3.5</maven.plugin.version>
<junit.version>4.12</junit.version>
<hamcrest.version>1.3</hamcrest.version>
<mokito.version>1.10.19</mokito.version>
<assertj.version>3.6.2</assertj.version>
</properties>
<url>https://github.com/serenity-bdd/serenity-cucumber5</url>
<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
<url>http://www.apache.org/license/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
</license>
</licenses>
<developers>
<developer>
<id>johnsmart</id>
<name>John Ferguson Smart</name>
<email>[email protected]</email>
</developer>
</developers>
<scm>
<connection>scm:git:https://github.com/serenity-bdd/serenity-cucumber5.git</connection>
<developerConnection>scm:git:https://github.com/serenity-bdd/serenity-cucumber5.git</developerConnection>
<url>https://github.com/serenity-bdd/serenity-cucumber5</url>
<tag>serenity-cucumber4-2.1.0</tag>
</scm>
<build>
<plugins>
<plugin>
<groupId>net.serenity-bdd.maven.plugins</groupId>
<artifactId>serenity-maven-plugin</artifactId>
<version>2.3.31</version>
<dependencies>
<dependency>
<groupId>net.serenity-bdd</groupId>
<artifactId>serenity-core</artifactId>
<version>${serenity.version}</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>serenity-reports</id>
<phase>post-integration-test</phase>
<goals>
<goal>aggregate</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>3.0.0-M1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M5</version>
<configuration>
<reuseForks>false</reuseForks>
<forkCount>1</forkCount>
<testFailureIgnore>true</testFailureIgnore>
<parallel>classes</parallel>
<threadCount>5</threadCount>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>net.serenity-bdd</groupId>
<artifactId>serenity-cucumber5</artifactId>
<version>2.2.6</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M5</version>
<type>maven-plugin</type>
</dependency>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.2.0</version>
</dependency>
<dependency>
<groupId>net.serenity-bdd</groupId>
<artifactId>serenity-core</artifactId>
<version>${serenity.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>net.serenity-bdd</groupId>
<artifactId>serenity-screenplay</artifactId>
<version>${serenity.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>net.serenity-bdd</groupId>
<artifactId>serenity-screenplay-webdriver</artifactId>
<version>${serenity.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>datatable-matchers</artifactId>
<version>1.1.14</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-csv</artifactId>
<version>1.5</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<!-- <scope>compile</scope>-->
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.6.1</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.4</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>${assertj.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.serenity-bdd.maven.plugins</groupId>
<artifactId>serenity-maven-plugin</artifactId>
<version>2.4.21</version>
</dependency>
</dependencies>
<distributionManagement>
<repository>
<id>bintray-serenity-maven</id>
<name>serenity-cucumber5</name>
<url>https://api.bintray.com/maven/${bintray.repo}/${bintray.package}/;publish=1</url>
</repository>
</distributionManagement>
</project>
I know I've got to be missing something from my pom or elsewhere, but haven't been able to figure out what. Any help or insight would be very much appreciated.
Your dependencies are inconsistent. You can use
mvn dependency:tree -Dverbose=true
to determine what exactly the problem is. Though I suspect it comes from mixing incompatible versions of Cucumber and Serenity.