Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatible with Gradle 7.6 #655

Closed
Goooler opened this issue Dec 13, 2022 · 14 comments
Closed

Incompatible with Gradle 7.6 #655

Goooler opened this issue Dec 13, 2022 · 14 comments
Labels
4.x Issues related to the 4.x series bug
Milestone

Comments

@Goooler
Copy link
Contributor

Goooler commented Dec 13, 2022

You can repro this issue on apache/groovy#1832.

> Task :groovy-ant:asciidoctor
Dependency verification has been disabled for configuration detachedConfiguration2
Dependency verification has been disabled for configuration detachedConfiguration3
Error: Exception in thread "main" java.lang.NoClassDefFoundError: org/gradle/api/GradleException
	at org.gradle.internal.classpath.Instrumented.<clinit>(Instrumented.java:94)
	at org.asciidoctor.gradle.remote.AsciidoctorJavaExec.$instrumentedCallSiteArray(AsciidoctorJavaExec.groovy)
	at org.asciidoctor.gradle.remote.AsciidoctorJavaExec.$getCallSiteArray(AsciidoctorJavaExec.groovy)
	at org.asciidoctor.gradle.remote.AsciidoctorJavaExec.registerExtensions(AsciidoctorJavaExec.groovy)
	at org.asciidoctor.gradle.remote.AsciidoctorJavaExec.access$0(AsciidoctorJavaExec.groovy)
	at org.asciidoctor.gradle.remote.AsciidoctorJavaExec$_run_closure2.doCall(AsciidoctorJavaExec.groovy:64)
	at org.asciidoctor.gradle.remote.AsciidoctorJavaExec$_run_closure2.call(AsciidoctorJavaExec.groovy)
	at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2359)
	at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2344)
	at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2385)
	at org.asciidoctor.gradle.remote.AsciidoctorJavaExec.run(AsciidoctorJavaExec.groovy:62)
	at org.asciidoctor.gradle.remote.AsciidoctorJavaExec.main(AsciidoctorJavaExec.groovy:49)
Caused by: java.lang.ClassNotFoundException: org.gradle.api.GradleException
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
	... 12 more
@daniellansun
Copy link

ping @ysb33r @aalmiray ;-)

@ysb33r
Copy link
Member

ysb33r commented Dec 31, 2022

Hey @daniellansun, please try to 4.0.0-alpha.1 release and tell me if it fixes the problem

@ysb33r ysb33r added this to the 4.0.0 milestone Dec 31, 2022
@ysb33r ysb33r added the bug label Dec 31, 2022
@Goooler
Copy link
Contributor Author

Goooler commented Jan 1, 2023

@ysb33r
Copy link
Member

ysb33r commented Jan 2, 2023

@daniellansun It seems to be happening when extensions are deserialised. Since this is not happening with Gradle 7.5.1, but with Gradle 7.6, it might be possible that some Gradle dependencies are being leaked.

Do any of the Groovy asciidoc extensions rely on Gradle code?

@ysb33r
Copy link
Member

ysb33r commented Jan 2, 2023

@daniellansun That seems to be the problem. If I apply this diff to your repo, the build passes.

diff --git a/build-logic/src/main/groovy/org.apache.groovy-asciidoctor.gradle b/build-logic/src/main/groovy/org.apache.groovy-asciidoctor.gradle
index 7b1d4bb3c3..b827285d3a 100644
--- a/build-logic/src/main/groovy/org.apache.groovy-asciidoctor.gradle
+++ b/build-logic/src/main/groovy/org.apache.groovy-asciidoctor.gradle
@@ -158,6 +158,7 @@ def htmlOutputSanityCheck = { file, text, errors ->
 
 asciidoctor {
     def errors = new LinkedHashSet<String>()
+    inProcess IN_PROCESS
     doFirst {
         def specTestDir = file('src/spec/test')
         if (specTestDir.exists()) {

@daniellansun
Copy link

@ysb33r Thanks a lot for your looking into the issue and giving the solution.
@Goooler Could you try again?

@ysb33r ysb33r added the 4.x Issues related to the 4.x series label Jan 2, 2023
@Goooler
Copy link
Contributor Author

Goooler commented Jan 3, 2023

@ysb33r
Copy link
Member

ysb33r commented Jan 3, 2023

Ah yes, that is the asciidoctorPdf task. Up to now we could not run that task IN_PROCESS, because Gradle workers leaked an incompatible version of snakeyaml onto the classpath. I'll check to see if that is still the case, given that much work has been done by the Gradle team in that area.

Otherwise, this is going to be a much bigger fix.

@mrotteveel
Copy link
Contributor

Another option is to add the Gradle API explicitly to the classpath. For example:

//...

configurations {
    asciidocExtensions
}

dependencies {
    asciidocExtensions gradleApi()
}

asciidoctor {
    configurations 'asciidocExtensions'
    // ...
}

asciidoctorPdf {
    configurations 'asciidocExtensions'
    // ...
}

// ...

@mrotteveel
Copy link
Contributor

The above suggests a potential fix is for the plugin itself to add the gradle API to the classpath when running asciidoctor.

@Goooler
Copy link
Contributor Author

Goooler commented Jan 7, 2023

@mrotteveel Failed due to

An exception occurred applying plugin request [id: 'org.apache.groovy-core']
> Failed to apply plugin 'org.apache.groovy-core'.
   > Failed to apply plugin 'org.apache.groovy-base'.
      > Failed to apply plugin 'org.apache.groovy-asciidoctor'.
         > org.gradle.internal.metaobject.AbstractDynamicObject$CustomMessageMissingMethodException: Could not find method asciidoctorPdf() for arguments [precompiled_OrgApacheGroovyAsciidoctor$_run_closure12@2b1d9078] on root project 'groovy' of type org.gradle.api.Project.

see
Goooler/groovy@5b881c8
https://github.com/Goooler/groovy/actions/runs/3862782763/jobs/6584560388

@mrotteveel
Copy link
Contributor

mrotteveel commented Jan 7, 2023

@Goooler That script doesn't seem to have org.asciidoctor.jvm.pdf as plugin, so remove the asciidoctorPdf definition. My fix worked (with 3.3.2) in https://github.com/FirebirdSQL/jaybird-manual/blob/master/build.gradle

@Goooler
Copy link
Contributor Author

Goooler commented Jan 8, 2023

@Goooler That script doesn't seem to have org.asciidoctor.jvm.pdf as plugin, so remove the asciidoctorPdf definition. My fix worked (with 3.3.2) in https://github.com/FirebirdSQL/jaybird-manual/blob/master/build.gradle

Still can't, see Goooler/groovy@8d006fa.

@PacoVK
Copy link

PacoVK commented Apr 26, 2023

@ysb33r is there yet a fix? Using 4.0.0-alpha.1 still breaks. I would contribute if possible but need at least a bit of context

ysb33r added a commit that referenced this issue Jan 3, 2024
This release filly integrates with Grolifant 2.2 and adopts the
newer JVM execution models to. This allows for better integration
with Gradle workers. THis has been so successful that the default
execution model is no a worker with classpath isolation as previously
it always has been javaexec.

JRuby: jruby-gradle plugin has been replaced with jruby-simple-plugin.
  This eliminates a number of issues with the previous plugin in
  terms of functionality and compatibiliy. It also restores
  plugin compatibility with JDK8 whereas the older plugin requires
  JDK11.

GEMs: The issues with load errors for external GEMs has been
  resolved, but eliminating the use of GEM_PATH and rather
  compiling a custom GEM Jar on the fly and placing it on the
  classpath.

Disabled plugins: Some plugsin were disabled for this
  release and will probably be fixed for future releases. Due to
  their limited usage, it was thought better to get a release out
  now and fix these later. The plugins are:

  - Leanpub
  - Slides
  - Slides export

Other:

- `asciidoctorEditorConfig` is now lazy-created

Closes: #628, #626, #655, #658, #664, #671, #673, #684, i#692, #693
ysb33r added a commit that referenced this issue Jan 3, 2024
This release filly integrates with Grolifant 2.2 and adopts the
newer JVM execution models to. This allows for better integration
with Gradle workers. THis has been so successful that the default
execution model is no a worker with classpath isolation as previously
it always has been javaexec.

JRuby: jruby-gradle plugin has been replaced with jruby-simple-plugin.
  This eliminates a number of issues with the previous plugin in
  terms of functionality and compatibiliy. It also restores
  plugin compatibility with JDK8 whereas the older plugin requires
  JDK11.

GEMs: The issues with load errors for external GEMs has been
  resolved, but eliminating the use of GEM_PATH and rather
  compiling a custom GEM Jar on the fly and placing it on the
  classpath.

Disabled plugins: Some plugsin were disabled for this
  release and will probably be fixed for future releases. Due to
  their limited usage, it was thought better to get a release out
  now and fix these later. The plugins are:

  - Leanpub
  - Slides
  - Slides export

Other:

- `asciidoctorEditorConfig` is now lazy-created

Closes: #628, #626, #655, #658, #664, #671, #673, #684, i#692, #693
ysb33r added a commit that referenced this issue Jan 3, 2024
This release filly integrates with Grolifant 2.2 and adopts the
newer JVM execution models to. This allows for better integration
with Gradle workers. THis has been so successful that the default
execution model is no a worker with classpath isolation as previously
it always has been javaexec.

JRuby: jruby-gradle plugin has been replaced with jruby-simple-plugin.
  This eliminates a number of issues with the previous plugin in
  terms of functionality and compatibiliy. It also restores
  plugin compatibility with JDK8 whereas the older plugin requires
  JDK11.

GEMs: The issues with load errors for external GEMs has been
  resolved, but eliminating the use of GEM_PATH and rather
  compiling a custom GEM Jar on the fly and placing it on the
  classpath.

Disabled plugins: Some plugsin were disabled for this
  release and will probably be fixed for future releases. Due to
  their limited usage, it was thought better to get a release out
  now and fix these later. The plugins are:

  - Leanpub
  - Slides
  - Slides export

Other:

- `asciidoctorEditorConfig` is now lazy-created

Closes: #628, #626, #655, #658, #664, #671, #673, #684, i#692, #693
ysb33r added a commit that referenced this issue Jan 3, 2024
This release filly integrates with Grolifant 2.2 and adopts the
newer JVM execution models to. This allows for better integration
with Gradle workers. THis has been so successful that the default
execution model is no a worker with classpath isolation as previously
it always has been javaexec.

JRuby: jruby-gradle plugin has been replaced with jruby-simple-plugin.
  This eliminates a number of issues with the previous plugin in
  terms of functionality and compatibiliy. It also restores
  plugin compatibility with JDK8 whereas the older plugin requires
  JDK11.

GEMs: The issues with load errors for external GEMs has been
  resolved, but eliminating the use of GEM_PATH and rather
  compiling a custom GEM Jar on the fly and placing it on the
  classpath.

Disabled plugins: Some plugsin were disabled for this
  release and will probably be fixed for future releases. Due to
  their limited usage, it was thought better to get a release out
  now and fix these later. The plugins are:

  - Leanpub
  - Slides
  - Slides export

Other:

- `asciidoctorEditorConfig` is now lazy-created

Closes: #628, #626, #655, #658, #664, #671, #673, #684, i#692, #693
ysb33r added a commit that referenced this issue Jan 3, 2024
This release filly integrates with Grolifant 2.2 and adopts the
newer JVM execution models to. This allows for better integration
with Gradle workers. THis has been so successful that the default
execution model is no a worker with classpath isolation as previously
it always has been javaexec.

JRuby: jruby-gradle plugin has been replaced with jruby-simple-plugin.
  This eliminates a number of issues with the previous plugin in
  terms of functionality and compatibiliy. It also restores
  plugin compatibility with JDK8 whereas the older plugin requires
  JDK11.

GEMs: The issues with load errors for external GEMs has been
  resolved, but eliminating the use of GEM_PATH and rather
  compiling a custom GEM Jar on the fly and placing it on the
  classpath.

Disabled plugins: Some plugsin were disabled for this
  release and will probably be fixed for future releases. Due to
  their limited usage, it was thought better to get a release out
  now and fix these later. The plugins are:

  - Leanpub
  - Slides
  - Slides export

Other:

- `asciidoctorEditorConfig` is now lazy-created

Closes: #628, #626, #655, #658, #664, #671, #673, #684, i#692, #693
ysb33r added a commit that referenced this issue Jan 3, 2024
This release filly integrates with Grolifant 2.2 and adopts the
newer JVM execution models to. This allows for better integration
with Gradle workers. THis has been so successful that the default
execution model is no a worker with classpath isolation as previously
it always has been javaexec.

JRuby: jruby-gradle plugin has been replaced with jruby-simple-plugin.
  This eliminates a number of issues with the previous plugin in
  terms of functionality and compatibiliy. It also restores
  plugin compatibility with JDK8 whereas the older plugin requires
  JDK11.

GEMs: The issues with load errors for external GEMs has been
  resolved, but eliminating the use of GEM_PATH and rather
  compiling a custom GEM Jar on the fly and placing it on the
  classpath.

Disabled plugins: Some plugsin were disabled for this
  release and will probably be fixed for future releases. Due to
  their limited usage, it was thought better to get a release out
  now and fix these later. The plugins are:

  - Leanpub
  - Slides
  - Slides export

Other:

- `asciidoctorEditorConfig` is now lazy-created

Closes: #628, #626, #655, #658, #664, #671, #673, #684, i#692, #693
ysb33r added a commit that referenced this issue Jan 3, 2024
This release filly integrates with Grolifant 2.2 and adopts the
newer JVM execution models to. This allows for better integration
with Gradle workers. THis has been so successful that the default
execution model is no a worker with classpath isolation as previously
it always has been javaexec.

JRuby: jruby-gradle plugin has been replaced with jruby-simple-plugin.
  This eliminates a number of issues with the previous plugin in
  terms of functionality and compatibiliy. It also restores
  plugin compatibility with JDK8 whereas the older plugin requires
  JDK11.

GEMs: The issues with load errors for external GEMs has been
  resolved, but eliminating the use of GEM_PATH and rather
  compiling a custom GEM Jar on the fly and placing it on the
  classpath.

Disabled plugins: Some plugsin were disabled for this
  release and will probably be fixed for future releases. Due to
  their limited usage, it was thought better to get a release out
  now and fix these later. The plugins are:

  - Leanpub
  - Slides
  - Slides export

Other:

- `asciidoctorEditorConfig` is now lazy-created

Closes: #628, #626, #655, #658, #664, #671, #673, #684, i#692, #693
ysb33r added a commit that referenced this issue Jan 4, 2024
This release filly integrates with Grolifant 2.2 and adopts the
newer JVM execution models to. This allows for better integration
with Gradle workers. THis has been so successful that the default
execution model is no a worker with classpath isolation as previously
it always has been javaexec.

JRuby: jruby-gradle plugin has been replaced with jruby-simple-plugin.
  This eliminates a number of issues with the previous plugin in
  terms of functionality and compatibiliy. It also restores
  plugin compatibility with JDK8 whereas the older plugin requires
  JDK11.

GEMs: The issues with load errors for external GEMs has been
  resolved, but eliminating the use of GEM_PATH and rather
  compiling a custom GEM Jar on the fly and placing it on the
  classpath.

Disabled plugins: Some plugsin were disabled for this
  release and will probably be fixed for future releases. Due to
  their limited usage, it was thought better to get a release out
  now and fix these later. The plugins are:

  - Leanpub
  - Slides
  - Slides export

Other:

- `asciidoctorEditorConfig` is now lazy-created

Closes: #628, #626, #655, #658, #664, #671, #673, #684, i#692, #693
ysb33r added a commit that referenced this issue Jan 4, 2024
This release filly integrates with Grolifant 2.2 and adopts the
newer JVM execution models to. This allows for better integration
with Gradle workers. THis has been so successful that the default
execution model is no a worker with classpath isolation as previously
it always has been javaexec.

JRuby: jruby-gradle plugin has been replaced with jruby-simple-plugin.
  This eliminates a number of issues with the previous plugin in
  terms of functionality and compatibiliy. It also restores
  plugin compatibility with JDK8 whereas the older plugin requires
  JDK11.

GEMs: The issues with load errors for external GEMs has been
  resolved, but eliminating the use of GEM_PATH and rather
  compiling a custom GEM Jar on the fly and placing it on the
  classpath.

Disabled plugins: Some plugins were disabled for this
  release and will probably be fixed for future releases. Due to
  their limited usage, it was thought better to get a release out
  now and fix these later. The plugins are:

  - Leanpub
  - Slides
  - Slides export

Other:

- `asciidoctorEditorConfig` is now lazy-created

Known issues:

- Supplying an extension via a configuration rather than via
  `docExtensions` does not work.
- GEM resolver test on Windows is failing.

Closes: #628, #626, #655, #658, #664, #671, #673, #684, i#692, #693
ysb33r added a commit that referenced this issue Jan 4, 2024
This release filly integrates with Grolifant 2.2 and adopts the
newer JVM execution models to. This allows for better integration
with Gradle workers. THis has been so successful that the default
execution model is no a worker with classpath isolation as previously
it always has been javaexec.

JRuby: jruby-gradle plugin has been replaced with jruby-simple-plugin.
  This eliminates a number of issues with the previous plugin in
  terms of functionality and compatibiliy. It also restores
  plugin compatibility with JDK8 whereas the older plugin requires
  JDK11.

GEMs: The issues with load errors for external GEMs has been
  resolved, but eliminating the use of GEM_PATH and rather
  compiling a custom GEM Jar on the fly and placing it on the
  classpath.

Disabled plugins: Some plugins were disabled for this
  release and will probably be fixed for future releases. Due to
  their limited usage, it was thought better to get a release out
  now and fix these later. The plugins are:

  - Leanpub
  - Slides
  - Slides export

Other:

- `asciidoctorEditorConfig` is now lazy-created

Known issues:

- Supplying an extension via a configuration rather than via
  `docExtensions` does not work.
- GEM resolver test on Windows is failing.

Closes: #628, #626, #655, #658, #664, #671, #673, #684, i#692, #693
ysb33r added a commit that referenced this issue Jan 4, 2024
This release filly integrates with Grolifant 2.2 and adopts the
newer JVM execution models to. This allows for better integration
with Gradle workers. THis has been so successful that the default
execution model is no a worker with classpath isolation as previously
it always has been javaexec.

JRuby: jruby-gradle plugin has been replaced with jruby-simple-plugin.
  This eliminates a number of issues with the previous plugin in
  terms of functionality and compatibiliy. It also restores
  plugin compatibility with JDK8 whereas the older plugin requires
  JDK11.

GEMs: The issues with load errors for external GEMs has been
  resolved, but eliminating the use of GEM_PATH and rather
  compiling a custom GEM Jar on the fly and placing it on the
  classpath.

Disabled plugins: Some plugins were disabled for this
  release and will probably be fixed for future releases. Due to
  their limited usage, it was thought better to get a release out
  now and fix these later. The plugins are:

  - Leanpub
  - Slides
  - Slides export

Other:

- `asciidoctorEditorConfig` is now lazy-created

Known issues:

- Supplying an extension via a configuration rather than via
  `docExtensions` does not work.
- GEM resolver test on Windows is failing.

Closes: #628, #626, #655, #658, #664, #671, #673, #684, i#692, #693
ysb33r added a commit that referenced this issue Jan 4, 2024
This prepares 4.0.0 final release. It fully integrates with Grolifant 2.2
and adopts the newer JVM execution models too, whichs allows for better
integration with Gradle workers. This has been so successful that the
default execution model is no a worker with classpath isolation as
previously it always has been javaexec.

JRuby: jruby-gradle plugin has been replaced with jruby-simple-plugin.
  This eliminates a number of issues with the previous plugin in
  terms of functionality and compatibiliy. It also restores
  plugin compatibility with JDK8 whereas the older plugin requires
  JDK11.

GEMs: The issues with load errors for external GEMs has been
  resolved, but eliminating the use of GEM_PATH and rather
  compiling a custom GEM Jar on the fly and placing it on the
  classpath.

Disabled plugins: Some plugins were disabled for this
  release and will probably be fixed for future releases. Due to
  their limited usage, it was thought better to get a release out
  now and fix these later. The plugins are:

  - Leanpub
  - Slides
  - Slides export

Other:

- `asciidoctorEditorConfig` is now lazy-created
- Update to NodeJs plugin 2.0.1
- Remove most deprecated Grolifant 2.0 APIs

Known issues:

- Supplying an extension via a configuration rather than via
  `docExtensions` does not work.
- GEM resolver test on Windows is failing.
- Asciidotor.convertFile. Curretnly the Asciidoctor API does not
  allow for inspection of the Option object and the old Map methods
  are all deprecated.

Closes: #628, #626, #655, #658, #664, #671, #673, #684, i#692, #693
@ysb33r ysb33r closed this as completed Jan 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.x Issues related to the 4.x series bug
Projects
None yet
Development

No branches or pull requests

5 participants