You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Thorsten Heit (JIRA)" <ji...@apache.org> on 2018/07/12 08:23:00 UTC
[jira] [Created] (SUREFIRE-1537) ClassNotFoundException with
m-surefire-p 2.22.0
Thorsten Heit created SUREFIRE-1537:
---------------------------------------
Summary: ClassNotFoundException with m-surefire-p 2.22.0
Key: SUREFIRE-1537
URL: https://issues.apache.org/jira/browse/SUREFIRE-1537
Project: Maven Surefire
Issue Type: Bug
Components: Maven Surefire Plugin
Affects Versions: 2.22.0
Environment: Windows 8.1 x64
Maven 3.5.4
Java 10.0.1
Reporter: Thorsten Heit
With Surefire plugin 2.22.0 a JUnit test in one of our projects doesn't work anymore; a ClassNotFoundException is thrown when using {{mvn clean test}}. Using 2.21.0 everyhing works.
This is the output of {{mvn dependency:tree}}:
{noformat}
[INFO] Scanning for projects...
[INFO]
[INFO] -------------< myorg:facade >-------------
[INFO] Building facade 2018.2.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ facade ---
[INFO] myorg:facade:jar:2018.2.0-SNAPSHOT
[INFO] +- myorg:accessors:jar:2018.2.0:compile
[INFO] | +- myorg:myids:jar:2018.2.0:compile
[INFO] | +- myorg:output:jar:2018.2.0:compile
[INFO] | \- org.slf4j:slf4j-api:jar:1.8.0-beta2:compile
[INFO] +- myorg:utilities:jar:2.2.0:compile
[INFO] +- com.sun.mail:javax.mail:jar:1.6.1:test
[INFO] +- javax.activation:javax.activation-api:jar:1.2.0:test
[INFO] +- externals:externallib:jar:2.1.3:compile
[INFO] | +- org.apache.xmlgraphics:fop:jar:2.2:compile
[INFO] | | +- org.apache.xmlgraphics:xmlgraphics-commons:jar:2.2:compile
[INFO] | | +- org.apache.xmlgraphics:batik-svg-dom:jar:1.9:compile
[INFO] | | | +- org.apache.xmlgraphics:batik-css:jar:1.9:compile
[INFO] | | | +- org.apache.xmlgraphics:batik-dom:jar:1.9:compile
[INFO] | | | +- org.apache.xmlgraphics:batik-parser:jar:1.9:compile
[INFO] | | | +- org.apache.xmlgraphics:batik-util:jar:1.9:compile
[INFO] | | | | +- org.apache.xmlgraphics:batik-constants:jar:1.9:compile
[INFO] | | | | \- org.apache.xmlgraphics:batik-i18n:jar:1.9:compile
[INFO] | | | \- xml-apis:xml-apis-ext:jar:1.3.04:compile
[INFO] | | +- org.apache.xmlgraphics:batik-bridge:jar:1.9:compile
[INFO] | | | +- org.apache.xmlgraphics:batik-anim:jar:1.9:compile
[INFO] | | | +- org.apache.xmlgraphics:batik-script:jar:1.9:compile
[INFO] | | | \- org.apache.xmlgraphics:batik-xml:jar:1.9:compile
[INFO] | | +- org.apache.xmlgraphics:batik-awt-util:jar:1.9:compile
[INFO] | | +- org.apache.xmlgraphics:batik-gvt:jar:1.9:compile
[INFO] | | +- org.apache.xmlgraphics:batik-transcoder:jar:1.9:compile
[INFO] | | | \- org.apache.xmlgraphics:batik-svggen:jar:1.9:compile
[INFO] | | +- org.apache.xmlgraphics:batik-extension:jar:1.9:compile
[INFO] | | +- org.apache.xmlgraphics:batik-ext:jar:1.9:compile
[INFO] | | +- org.apache.avalon.framework:avalon-framework-api:jar:4.3.1:compile
[INFO] | | +- org.apache.avalon.framework:avalon-framework-impl:jar:4.3.1:compile
[INFO] | | \- org.apache.pdfbox:fontbox:jar:2.0.4:compile
[INFO] | +- commons-io:commons-io:jar:2.5:compile
[INFO] | \- org.slf4j:jcl-over-slf4j:jar:1.8.0-beta2:compile
[INFO] +- myorg:business-objects:jar:2018.2.0:compile
[INFO] +- org.eclipse.jdt:org.eclipse.jdt.annotation:jar:1.1.0-v20130513-1648:provided
[INFO] \- junit:junit:jar:4.12:test
[INFO] \- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.184 s
[INFO] Finished at: 2018-07-12T09:24:08+02:00
[INFO] ------------------------------------------------------------------------
{noformat}
The supposedly missing class when using 2.22.0 is contained in the dependency *externals:externallib* (see above) which itself is contained as a direct compile-time dependency in my project.
What I see is that the output of {{mvn -X test}} differs between the two plugin versions:
2.21.0:
{noformat}
(...)
[INFO] --- maven-surefire-plugin:2.21.0:test (default-test) @ facade ---
(...)
[DEBUG] test(compact) classpath: test-classes output-2018.2.0.jar slf4j-api-1.8.0-beta2.jar **externallib-2.1.3.jar** fop-2.2.jar xmlgraphics-commons-2.2.jar batik-svg-dom-1.9.jar batik-css-1.9.jar batik-dom-1.9.jar batik-parser-1.9.jar batik-util-1.9.jar batik-constants-1.9.jar batik-i18n-1.9.jar xml-apis-ext-1.3.04.jar batik-bridge-1.9.jar batik-anim-1.9.jar **batik-script-1.9.jar** batik-xml-1.9.jar batik-awt-util-1.9.jar batik-gvt-1.9.jar batik-transcoder-1.9.jar batik-svggen-1.9.jar batik-extension-1.9.jar batik-ext-1.9.jar avalon-framework-api-4.3.1.jar avalon-framework-impl-4.3.1.jar fontbox-2.0.4.jar commons-io-2.5.jar jcl-over-slf4j-1.8.0-beta2.jar junit-4.12.jar hamcrest-core-1.3.jar
[DEBUG] test(compact) modulepath: org.eclipse.jdt.annotation-1.1.0-v20130513-1648.jar utilities-2.2.0.jar javax.activation-api-1.2.0.jar business-objects-2018.2.0.jar classes accessors-2018.2.0.jar javax.mail-1.6.1.jar myids-2018.2.0.jar
[DEBUG] provider(compact) classpath: surefire-junit4-2.21.0.jar surefire-api-2.21.0.jar surefire-logger-api-2.21.0.jar
(...)
{noformat}
With 2.22.0:
{noformat}
(...)
[INFO] --- maven-surefire-plugin:2.22.0:test (default-test) @ facade ---
(...)
[DEBUG] test(compact) classpath: test-classes output-2018.2.0.jar slf4j-api-1.8.0-beta2.jar fop-2.2.jar xmlgraphics-commons-2.2.jar batik-svg-dom-1.9.jar batik-css-1.9.jar batik-dom-1.9.jar batik-parser-1.9.jar batik-util-1.9.jar batik-constants-1.9.jar batik-i18n-1.9.jar xml-apis-ext-1.3.04.jar batik-bridge-1.9.jar batik-anim-1.9.jar batik-xml-1.9.jar batik-awt-util-1.9.jar batik-gvt-1.9.jar batik-transcoder-1.9.jar batik-svggen-1.9.jar batik-extension-1.9.jar batik-ext-1.9.jar avalon-framework-api-4.3.1.jar avalon-framework-impl-4.3.1.jar fontbox-2.0.4.jar commons-io-2.5.jar jcl-over-slf4j-1.8.0-beta2.jar junit-4.12.jar hamcrest-core-1.3.jar
[DEBUG] test(compact) modulepath: classes accessors-2018.2.0.jar myids-2018.2.0.jar utilities-2.2.0.jar javax.mail-1.6.1.jar javax.activation-api-1.2.0.jar business-objects-2018.2.0.jar org.eclipse.jdt.annotation-1.1.0-v20130513-1648.jar
[DEBUG] provider(compact) classpath: surefire-junit4-2.22.0.jar surefire-api-2.22.0.jar surefire-logger-api-2.22.0.jar
(...)
{noformat}
There you see that the dependencies to *externallib-2.1.3.jar* and the transitive one to *batik-script-1.9.jar* are *NOT* contained in 2.22.0 whereas they are in 2.21.0...
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)