Open markslater opened 9 months ago
v1.1.3
is an old version that is pulling another very old Asciidoctor, have tried the latest https://rubygems.org/gems/asciidoctor-revealjs/versions/5.1.0 ?
You're right, @abelsromero , it's a long way out of date! Unfortunately, 5.1.0
produces the same result:
$ ./gradlew asciidoctor
Successfully installed asciidoctor-2.0.21
Successfully installed asciidoctor-revealjs-5.1.0
2 gems installed
> Task :asciidoctor
Exception in thread "main" org.jruby.exceptions.LoadError: (LoadError) no such file to load -- asciidoctor-revealjs
at org.jruby.RubyKernel.require(org/jruby/RubyKernel.java:1017)
at RUBY.require(uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:85)
at RUBY.<main>(<script>:1)
> Task :asciidoctor FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':asciidoctor'.
> Process 'command '/usr/lib/jvm/java-11-openjdk-amd64/bin/java'' finished with non-zero exit value 1
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.
BUILD FAILED in 35s
2 actionable tasks: 2 executed
Sorry, forgot to come back. I could reproduce the issue in my machine (Linux) but could not deal with it currently. The current effort is in fixing docs, then we can address this.
Is there any workaround for this or is the only solution to wait for code fix?
Comment out the requires line. In 4.x all GEMs are rolled up in a JAR which are placed on the classpath.
Get BlueMail for Android
On 12 Mar 2024, 00:08, at 00:08, Austin Arbor @.***> wrote:
Is there any workaround for this or is the only solution to wait for code fix?
-- Reply to this email directly or view it on GitHub: https://github.com/asciidoctor/asciidoctor-gradle-plugin/issues/718#issuecomment-1989614047 You are receiving this because you are subscribed to this thread.
Message ID: @.***>
Removing the requires line doesn't seem to work for me (certainly not for all GEMs at any rate; for example asciidoctor-tabs definitely doesn't work). I found a slightly grungy workaround though:
asciidoctorj {
requires(
project.layout.buildDirectory.file(".asciidoctorGems/gems/asciidoctor-revealjs-5.1.0/lib/asciidoctor-revealjs.rb")
)
}
I was also trying with the asciidoctor-tabs extension but couldn't get it to work
It's pretty important to be able to add additional gems. Is the problem with this plugin, or in the JRuby plugin? I don't think we want to see a proliferation of builds that are relying on internal behavior, so it seems to be something worth figuring out.
While I fully agree with @mojavelinux that the proliferation of a workaround is undesirable, in the interests of expediency, @austinarbor asciidoctor-tabs works for me with this:
asciidoctorj {
requires(
"asciidoctor",
project.layout.buildDirectory.file(".asciidoctorGems/gems/asciidoctor-tabs-1.0.0.beta.6/lib/asciidoctor-tabs.rb")
)
}
See here for an example project.
@markslater thanks! can confirm this works on Gradle 8.6, but does not appear to work on Gradle 8.7
exception thrown for request to /rubygems/asciidoctor-tabs/1.0.0.beta.6/ivy.xml
java.lang.NoClassDefFoundError: org/gradle/wrapper/ExclusiveFileAccessManager
at java.base/java.lang.Class.getDeclaredFields0(Native Method)
at java.base/java.lang.Class.privateGetDeclaredFields(Class.java:3297)
at java.base/java.lang.Class.getDeclaredFields(Class.java:2371)
at org.codehaus.groovy.reflection.CachedClass$1.lambda$initValue$2(CachedClass.java:59)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:318)
at org.codehaus.groovy.reflection.CachedClass$1.initValue(CachedClass.java:62)
at org.codehaus.groovy.reflection.CachedClass$1.initValue(CachedClass.java:54)
at org.codehaus.groovy.util.LazyReference.getLocked(LazyReference.java:50)
at org.codehaus.groovy.util.LazyReference.get(LazyReference.java:37)
at org.codehaus.groovy.reflection.CachedClass.getFields(CachedClass.java:256)
at groovy.lang.MetaClassImpl.addFields(MetaClassImpl.java:2499)
at groovy.lang.MetaClassImpl.inheritFields(MetaClassImpl.java:2494)
at groovy.lang.MetaClassImpl.setupProperties(MetaClassImpl.java:2380)
at groovy.lang.MetaClassImpl.addProperties(MetaClassImpl.java:3421)
at groovy.lang.MetaClassImpl.reinitialize(MetaClassImpl.java:3395)
at groovy.lang.MetaClassImpl.initialize(MetaClassImpl.java:3388)
at org.codehaus.groovy.reflection.ClassInfo.getMetaClassUnderLock(ClassInfo.java:273)
at org.codehaus.groovy.reflection.ClassInfo.getMetaClass(ClassInfo.java:315)
at org.ysb33r.grolifant.api.core.ExclusiveFileAccess.$getStaticMetaClass(ExclusiveFileAccess.groovy)
at org.ysb33r.grolifant.api.core.ExclusiveFileAccess.<init>(ExclusiveFileAccess.groovy)
at org.ysb33r.gradle.jruby.internal.core.DefaultIvyXmlFactory.createIvyXml(DefaultIvyXmlFactory.groovy:152)
at org.ysb33r.gradle.jruby.internal.core.DefaultIvyXmlFactory.ivyXmlPath(DefaultIvyXmlFactory.groovy:87)
at org.ysb33r.gradle.jruby.internal.resolver.RatpackServerFactory.lambda$null$0(RatpackServerFactory.java:63)
at ratpack.handling.internal.DefaultContext.next(DefaultContext.java:157)
at ratpack.handling.internal.MethodHandler.handle(MethodHandler.java:44)
at ratpack.handling.internal.DefaultContext.next(DefaultContext.java:157)
at ratpack.handling.internal.DefaultContext.insert(DefaultContext.java:179)
at ratpack.path.internal.PathHandler.handle(PathHandler.java:61)
at ratpack.handling.internal.DefaultContext.next(DefaultContext.java:157)
at ratpack.handling.internal.DefaultContext.lambda$start$4(DefaultContext.java:104)
at ratpack.exec.internal.DefaultExecution.lambda$new$0(DefaultExecution.java:82)
at ratpack.exec.internal.DefaultExecution$InitialExecStream.exec(DefaultExecution.java:403)
at ratpack.exec.internal.DefaultExecution.exec(DefaultExecution.java:224)
at ratpack.exec.internal.DefaultExecution.exec(DefaultExecution.java:217)
at ratpack.exec.internal.DefaultExecution.drain(DefaultExecution.java:187)
at io.netty.util.concurrent.PromiseTask$RunnableAdapter.call(PromiseTask.java:38)
at io.netty.util.concurrent.PromiseTask.run(PromiseTask.java:73)
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:404)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:474)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:909)
at ratpack.exec.internal.DefaultExecController$ExecControllerBindingThreadFactory.lambda$newThread$0(DefaultExecController.java:137)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.ClassNotFoundException: org.gradle.wrapper.ExclusiveFileAccessManager
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:445)
at org.gradle.internal.classloader.VisitableURLClassLoader$InstrumentingVisitableURLClassLoader.findClass(VisitableURLClassLoader.java:187)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:587)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
... 44 more
@austinarbor see https://github.com/asciidoctor/asciidoctor-gradle-plugin/issues/725
I'm having some difficulty requiring GEMs, using the example from the documentation.
Here's my build script:
And here's the output:
I'm running:
I'm guessing there's some problem with the Ruby path configuration because I see:
I'm very new to Asciidoctor, so apologies if I've missed something obvious. Full reproducer here