Open BartVanRaemdonck opened 5 years ago
"Caused by: java.lang.NoSuchMethodError: org.apache.commons.io.FileUtils.listFilesAndDirs" - looks like you have a dependency conflict with an older version of apache-commons.
I checked every dependency and updated them to the latest version, but I still get the same error.
This is my pom file:
`<?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>net.persgroep.targetqa</groupId>
<artifactId>serenity-cucumber4-smoketests</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Sample Serenity BDD project using Cucumber</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<serenity.version>2.0.76</serenity.version>
<serenity.maven.version>2.0.76</serenity.maven.version>
<serenity.cucumber.version>1.0.21</serenity.cucumber.version>
<cucumber.version>4.2.0</cucumber.version>
<encoding>UTF-8</encoding>
<tags></tags>
<parallel.tests>2</parallel.tests>
<webdriver.base.url></webdriver.base.url>
</properties>
<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>bintray</name>
<url>http://jcenter.bintray.com</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>bintray-plugins</name>
<url>http://jcenter.bintray.com</url>
</pluginRepository>
</pluginRepositories>
<dependencies>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.10.0.pr3</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.10.0.pr3</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.10.0.pr3</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>28.1-jre</version>
</dependency>
<dependency>
<groupId>de.sstoehr</groupId>
<artifactId>har-reader</artifactId>
<version>2.1.6</version>
</dependency>
<dependency>
<groupId>com.browserstack</groupId>
<artifactId>browserstack-local-java</artifactId>
<version>1.0.3</version>
</dependency>
<dependency>
<groupId>net.lightbody.bmp</groupId>
<artifactId>browsermob-core</artifactId>
<version>2.1.5</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.2.3</version>
</dependency>
<!--
- To use Cucumber 4, exclude the old Cucumber 2 cucumber-core dependency from the serenity-core dependency
- and include the Cucumber 4 cucumber-java and cucumber-junit dependencies.
-->
<dependency>
<groupId>net.serenity-bdd</groupId>
<artifactId>serenity-core</artifactId>
<version>${serenity.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-java</artifactId>
<version>${cucumber.version}</version>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-junit</artifactId>
<version>${cucumber.version}</version>
</dependency>
<dependency>
<groupId>net.serenity-bdd</groupId>
<artifactId>serenity-junit</artifactId>
<version>${serenity.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.serenity-bdd</groupId>
<artifactId>serenity-screenplay</artifactId>
<version>${serenity.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.serenity-bdd</groupId>
<artifactId>serenity-screenplay-webdriver</artifactId>
<version>${serenity.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.serenity-bdd</groupId>
<artifactId>serenity-cucumber4</artifactId>
<version>${serenity.cucumber.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>3.13.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<version>1.3</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.22.1</version>
<configuration>
<includes>
<include>**/*TestSuite.java</include>
</includes>
<excludes>
<exclude>**/starter/examples/**</exclude>
</excludes>
<systemPropertyVariables>
<webdriver.base.url>${webdriver.base.url}</webdriver.base.url>
<runname>run${surefire.forkNumber}</runname>
</systemPropertyVariables>
<parallel>classes</parallel>
<threadCount>4</threadCount>
<perCoreThreadCount>true</perCoreThreadCount>
<forkCount>4</forkCount>
</configuration>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>net.serenity-bdd.maven.plugins</groupId>
<artifactId>serenity-maven-plugin</artifactId>
<version>${serenity.maven.version}</version>
<configuration>
<tags>${tags}</tags>
</configuration>
<executions>
<execution>
<id>serenity-reports</id>
<phase>post-integration-test</phase>
<goals>
<goal>aggregate</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>parallel</id>
<build>
<plugins>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.22.1</version>
<configuration>
<includes>
<include>**/Parallel*.java</include>
</includes>
<excludes>
<exclude>**/starter/examples/**</exclude>
</excludes>
<parallel>classes</parallel>
<threadCount>4</threadCount>
<forkCount>4</forkCount>
<reuseForks>true</reuseForks>
<argLine>-Xmx1024m -XX:MaxPermSize=256m</argLine>
<systemPropertyVariables>
<environment>parallel_${surefire.forkNumber}</environment>
<runname>run${surefire.forkNumber}</runname>
</systemPropertyVariables>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
`
If it’s a dependency conflict it’s not just a matter of having the latest dependencies, you have to do a dependency analysis on the project and see if there are conflicting libraries.
After my tests are done I see no target folder in my project. In the console I see the following error:
net.persgroep.targetqa.DFPTestSuitenet.thucydides.core.reports.ReportGenerationFailedError: Failed to generate configuration report at net.thucydides.core.reports.ReportService.waitForReportGenerationToFinish(ReportService.java:204) at net.thucydides.core.reports.ReportService.generateReportsFor(ReportService.java:181) at net.thucydides.core.reports.ReportService.generateReportsFor(ReportService.java:127) at cucumber.runtime.formatter.SerenityReporter.generateReports(SerenityReporter.java:939) at cucumber.runtime.formatter.SerenityReporter.handleTestRunFinished(SerenityReporter.java:356) at cucumber.runtime.formatter.SerenityReporter.lambda$new$6(SerenityReporter.java:150) at cucumber.runner.AbstractEventPublisher.send(AbstractEventPublisher.java:45) at cucumber.runner.AbstractEventBus.send(AbstractEventBus.java:9) at cucumber.runner.TimeServiceEventBus.send(TimeServiceEventBus.java:3) at net.serenitybdd.cucumber.CucumberWithSerenity$1.evaluate(CucumberWithSerenity.java:203) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.junit.runners.Suite.runChild(Suite.java:128) at org.junit.runners.Suite.runChild(Suite.java:27) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.apache.maven.surefire.junitcore.pc.Scheduler$1.run(Scheduler.java:410) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:835) Caused by: java.util.concurrent.ExecutionException: java.lang.NoSuchMethodError: org.apache.commons.io.FileUtils.listFilesAndDirs(Ljava/io/File;Lorg/apache/commons/io/filefilter/IOFileFilter;Lorg/apache/commons/io/filefilter/IOFileFilter;)Ljava/util/Collection; at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122) at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191) at net.thucydides.core.reports.ReportService.waitForReportGenerationToFinish(ReportService.java:201) ... 21 more Caused by: java.lang.NoSuchMethodError: org.apache.commons.io.FileUtils.listFilesAndDirs(Ljava/io/File;Lorg/apache/commons/io/filefilter/IOFileFilter;Lorg/apache/commons/io/filefilter/IOFileFilter;)Ljava/util/Collection; at net.thucydides.core.files.TheDirectoryStructure.maxDepth(TheDirectoryStructure.java:58) at net.thucydides.core.requirements.FileSystemRequirementsTagProvider.lambda$maxDirectoryDepthIn$2(FileSystemRequirementsTagProvider.java:202) at java.base/java.util.stream.ReferencePipeline$4$1.accept(ReferencePipeline.java:212) at java.base/java.util.HashMap$KeySpliterator.forEachRemaining(HashMap.java:1600) at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484) at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913) at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.base/java.util.stream.IntPipeline.reduce(IntPipeline.java:496) at java.base/java.util.stream.IntPipeline.max(IntPipeline.java:459) at net.thucydides.core.requirements.FileSystemRequirementsTagProvider.maxDirectoryDepthIn(FileSystemRequirementsTagProvider.java:203) at net.thucydides.core.requirements.FileSystemRequirementsTagProvider.<init>(FileSystemRequirementsTagProvider.java:125) at net.thucydides.core.requirements.FileSystemRequirementsTagProvider.<init>(FileSystemRequirementsTagProvider.java:76) at net.thucydides.core.requirements.FileSystemRequirementsTagProvider.<init>(FileSystemRequirementsTagProvider.java:71) at net.thucydides.core.requirements.FileSystemRequirementsTagProvider.<init>(FileSystemRequirementsTagProvider.java:80) at net.thucydides.core.statistics.service.JUnitTagProviderStrategy.getTagProviders(JUnitTagProviderStrategy.java:19) at net.thucydides.core.statistics.service.ClasspathTagProviderService.allKnownTagProviders(ClasspathTagProviderService.java:90) at net.thucydides.core.statistics.service.ClasspathTagProviderService.loadTagProvidersFromPath(ClasspathTagProviderService.java:54) at net.thucydides.core.statistics.service.ClasspathTagProviderService.tagProvidersFor(ClasspathTagProviderService.java:36) at net.thucydides.core.statistics.service.ClasspathTagProviderService.getTagProviders(ClasspathTagProviderService.java:28) at net.thucydides.core.statistics.service.ClasspathTagProviderService.getTagProviders(ClasspathTagProviderService.java:18) at net.thucydides.core.requirements.ClasspathRequirementsProviderService.loadRequirementsTagProviders(ClasspathRequirementsProviderService.java:49) at net.thucydides.core.requirements.ClasspathRequirementsProviderService.getRequirementsProviders(ClasspathRequirementsProviderService.java:40) at net.thucydides.core.requirements.MultiSourceRequirementsService.getRequirementsTagProviders(MultiSourceRequirementsService.java:63) at net.thucydides.core.requirements.MultiSourceRequirementsService.getRequirements(MultiSourceRequirementsService.java:38) at net.thucydides.core.requirements.BaseRequirementsService.getRequirementTypes(BaseRequirementsService.java:197) at net.thucydides.core.reports.html.HtmlAcceptanceTestReporter.addTestOutcomeToContext(HtmlAcceptanceTestReporter.java:163) at net.thucydides.core.reports.html.HtmlAcceptanceTestReporter.generateReportFor(HtmlAcceptanceTestReporter.java:107) at net.thucydides.core.reports.ReportService.generateReportFor(ReportService.java:239) at net.thucydides.core.reports.ReportService.lambda$generateReportsFor$0(ReportService.java:177) ... 5 more net.persgroep.targetqa.DFPTestSuitejava.lang.NullPointerException at net.persgroep.targetqa.DefaultSuite.tearDown(DefaultSuite.java:46) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:567) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:33) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.junit.runners.Suite.runChild(Suite.java:128) at org.junit.runners.Suite.runChild(Suite.java:27) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.apache.maven.surefire.junitcore.pc.Scheduler$1.run(Scheduler.java:410) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:835)