asciidoctor-gradle-plugin icon indicating copy to clipboard operation
asciidoctor-gradle-plugin copied to clipboard

Fix gems in gradle 8.7

Open markslater opened this issue 10 months ago • 0 comments

Fixes #725.

I need some guidance on how the maintainers would like to handle one issue:

I've included a change to the test config that demonstrates the original issue with Gradle 8.7, but with the fix, the Gradle 8.7 tests fail for a different reason, which I suspect is caused by this Gradle 8.7 TestKit bug: https://github.com/gradle/gradle/issues/28729. That TestKit bug is fixed in the upcoming Gradle 8.8-RC1.

I've manually tested my change, and confirmed it fixes the issue.

Three options come to mind:

  1. Remove the Gradle 8.7 tests; the existing tests prove this change doesn't break the plugin for previous versions of Gradle.
  2. Wait for Gradle 8.8-RC1.
  3. Wait for Gradle 8.8.

For reference, the test failures are like this:

Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.NoClassDefFoundError: org/gradle/internal/classpath/InstrumentableClosure
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:757)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:473)
	at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:419)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:352)
	at java.lang.Class.getDeclaredMethods0(Native Method)
	at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
	at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
	at java.lang.Class.getMethod0(Class.java:3018)
	at java.lang.Class.getMethod(Class.java:1784)
	at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:670)
	at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:652)
Caused by: java.lang.ClassNotFoundException: org.gradle.internal.classpath.InstrumentableClosure
	at java.net.URLClassLoader.findClass(URLClassLoader.java:387)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:419)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:352)
	... 19 more

> Task :asciidoctor FAILED

markslater avatar Apr 17 '24 15:04 markslater