Discussion:
[all] maven surefire plugin crashes after JDK updated - solution
Aleksander Ściborek
2018-11-02 11:34:58 UTC
Permalink
Hi,
after I had installed the update of JDK8 i found that the maven surefire
plugin doesn't work correctly.
The resolution is to add following lines in plugins section:

<configuration>
<useSystemClassLoader>false</useSystemClassLoader>
</configuration>


Aleksander
Bernd Eckenfels
2018-11-02 12:34:33 UTC
Permalink
Hello,

Do you mean 8u191 introduced a problem? What error do you get in which project?

Gruss
Bernd

Gruss
Bernd
--
http://bernd.eckenfels.net

________________________________
Von: Aleksander Šciborek <***@gmail.com>
Gesendet: Freitag, November 2, 2018 12:35 PM
An: Commons Developers List
Betreff: [all] maven surefire plugin crashes after JDK updated - solution

Hi,
after I had installed the update of JDK8 i found that the maven surefire
plugin doesn't work correctly.
The resolution is to add following lines in plugins section:

<configuration>
<useSystemClassLoader>false</useSystemClassLoader>
</configuration>


Aleksander
Alex Herbert
2018-11-02 14:19:01 UTC
Permalink
Hi,

This has been discussed in a Debian bug report here:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=912333

The bug is not in Debian but is due to the latest release of OpenJDK 8
which improved validation of the class-path in JAR files:

| Improved Validation of Class-Path Attribute in JAR File Manifest
(core-libs)
|
| The JAR file specification states that URLs in the Class-Path manifest
attribute must be relative,
| though this has not been enforced. To better conform to the JAR
specification, absolute URLs
| (those that include a scheme) are now ignored. For JAR files not
loaded from the file system,
| Class-Path entries navigating to a parent directory (using "../") are
also ignored.
|
| Applications depending on a JAR file loaded from an absolute URL
element specified in
| Class-Path attribute may encounter a ClassNotFoundException. The
historical behavior can be
| restored by setting a new system property,
jdk.net.URLClassPath.disableClassPathURLCheck
| to true. Debugging info for Class-Path entries that are ignored can be
printed to stderr by
| setting -Djdk.net.URLClassPath.disableClassPathURLCheck=debug.


Any Jar file that uses non-relative URLs in the manifest will suffer
from ClassNotFoundException.

This affects the maven-surefire-plugin and under the latest OpenJDK 8 no
tests can be run. This is at least true for JUnit 5 tests.

One solution as posted is to ignore the system class loader:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=912333#63

Note however that later in the thread this is stated that it breaks some
Spring Boot integration tests. So there may not be a one size fits
solution. Either try modifying the configuration to disable the system
class loader, or downgrade Open JDK 8 until the surefire plugin is fixed.

Regards,

Alex
Post by Bernd Eckenfels
Hello,
Do you mean 8u191 introduced a problem? What error do you get in which project?
Gruss
Bernd
Gruss
Bernd
--
http://bernd.eckenfels.net
________________________________
Gesendet: Freitag, November 2, 2018 12:35 PM
An: Commons Developers List
Betreff: [all] maven surefire plugin crashes after JDK updated - solution
Hi,
after I had installed the update of JDK8 i found that the maven surefire
plugin doesn't work correctly.
<configuration>
<useSystemClassLoader>false</useSystemClassLoader>
</configuration>
Aleksander
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-***@commons.apache.org
For additional commands, e-mail: dev-***@commons.apache.org

Loading...