cuppa icon indicating copy to clipboard operation
cuppa copied to clipboard

Latest version of Maven Surefire Plugin fails

Open GencoreOperative opened this issue 8 years ago • 1 comments

When attempting to use the latest version 2.20.1 of the Maven Surefire Plugin to run the JUnit tests the following error occurs.

I've not investigated it yet to understand the cause.

Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.20.1:test failed: An API incompatibility was encountered > while executing org.apache.maven.plugins:maven-surefire-plugin:2.20.1:test: java.lang.NoSuchMethodError: > org.apache.maven.surefire.report.SafeThrowable.(Ljava/lang/String;)V [ERROR] ----------------------------------------------------- [ERROR] realm = plugin>org.apache.maven.plugins:maven-surefire-plugin:2.20.1 [ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy [ERROR] urls[0] = file:/Users/.../org/apache/maven/plugins/maven-surefire-plugin/2.20.1/maven-surefire-plugin-2.20.1.jar [ERROR] urls[1] = file:/Users/.../org/forgerock/cuppa/cuppa-surefire/1.3.1/cuppa-surefire-1.3.1.jar [ERROR] urls[2] = file:/Users/.../org/apache/maven/surefire/common-java5/2.19.1/common-java5-2.19.1.jar [ERROR] urls[3] = file:/Users/.../org/forgerock/cuppa/cuppa/1.3.1/cuppa-1.3.1.jar [ERROR] urls[4] = file:/Users/.../org/apache/maven/surefire/maven-surefire-common/2.20.1/maven-surefire-common-2.20.1.jar [ERROR] urls[5] = file:/Users/.../org/apache/maven/plugin-tools/maven-plugin-annotations/3.3/maven-plugin-annotations-3.3.jar [ERROR] urls[6] = file:/Users/.../org/apache/maven/surefire/surefire-api/2.20.1/surefire-api-2.20.1.jar [ERROR] urls[7] = file:/Users/.../org/apache/maven/surefire/surefire-logger-api/2.20.1/surefire-logger-api-2.20.1.jar [ERROR] urls[8] = file:/Users/.../org/apache/maven/surefire/surefire-booter/2.20.1/surefire-booter-2.20.1.jar [ERROR] urls[9] = file:/Users/.../org/codehaus/plexus/plexus-utils/1.5.15/plexus-utils-1.5.15.jar [ERROR] urls[10] = file:/Users/.../junit/junit/4.12/junit-4.12.jar [ERROR] urls[11] = file:/Users/.../org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar [ERROR] urls[12] = file:/Users/.../backport-util-concurrent/backport-util-concurrent/3.1/backport-util-concurrent-3.1.jar [ERROR] urls[13] = file:/Users/.../org/codehaus/plexus/plexus-interpolation/1.11/plexus-interpolation-1.11.jar [ERROR] urls[14] = file:/Users/.../org/slf4j/slf4j-jdk14/1.5.6/slf4j-jdk14-1.5.6.jar [ERROR] urls[15] = file:/Users/.../org/slf4j/jcl-over-slf4j/1.5.6/jcl-over-slf4j-1.5.6.jar [ERROR] urls[16] = file:/Users/.../org/apache/maven/reporting/maven-reporting-api/3.0/maven-reporting-api-3.0.jar [ERROR] urls[17] = file:/Users/.../org/sonatype/plexus/plexus-sec-dispatcher/1.3/plexus-sec-dispatcher-1.3.jar [ERROR] urls[18] = file:/Users/.../org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar [ERROR] Number of foreign imports: 1 [ERROR] import: Entry[import from realm ClassRealm[maven.api, parent: null]]

Using 2.19.1 works ok.

GencoreOperative avatar Jan 03 '18 23:01 GencoreOperative

Hello rwhapshott,

This version of cuppa-surefire is compiled with the version 2.19.1 of common-java5 which hasn't the org.apache.maven.surefire.report.SafeThrowable.(Ljava/lang/String;)V. This constructor is used in the unmarshalling of stackTraceWriter in version 2.20.1 and the provider depends on it when using the SimpleReportEntry

If you wish to use surefire 2.20.1 cuppa-surefire must depend on the same version.

alx75 avatar Jan 28 '18 20:01 alx75