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

Fix issue running AsciidoctorJ out of process on Gradle 4.10 #269

Closed
ysb33r opened this issue Nov 3, 2018 · 15 comments
Closed

Fix issue running AsciidoctorJ out of process on Gradle 4.10 #269

ysb33r opened this issue Nov 3, 2018 · 15 comments
Assignees
Labels
1.[56].x Issues related to the 1.5.x/1.6.x series 2.x Issue related to the 2.x series bug
Milestone

Comments

@ysb33r
Copy link
Member

ysb33r commented Nov 3, 2018

Running something like

asciidoctorPdf {
    inProcess OUT_OF_PROCESS
    logDocuments true
    sourceDir 'src/docs/asciidoc'

    sources {
        include 'subdir/sample2.ad'
    }
}

will fail with an error

Caused by: groovy.lang.GroovyRuntimeException: Conflicting module versions. Module [groovy-all is loaded in version 2.4.12 and you are trying to load version 2.4.15
	at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl$DefaultModuleListener.onModule(MetaClassRegistryImpl.java:513)
	at org.codehaus.groovy.runtime.m12n.ExtensionModuleScanner.scanExtensionModuleFromProperties(ExtensionModuleScanner.java:80)
	at org.codehaus.groovy.runtime.m12n.ExtensionModuleScanner.scanExtensionModuleFromMetaInf(ExtensionModuleScanner.java:74)
	at org.codehaus.groovy.runtime.m12n.ExtensionModuleScanner.scanClasspathModules(ExtensionModuleScanner.java:56)
	at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.<init>(MetaClassRegistryImpl.java:113)
	at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.<init>(MetaClassRegistryImpl.java:74)
	at groovy.lang.GroovySystem.<clinit>(GroovySystem.java:36)
@ysb33r ysb33r added bug 2.x Issue related to the 2.x series labels Nov 3, 2018
@ysb33r ysb33r added this to the 2.0.0 milestone Nov 3, 2018
@ysb33r ysb33r self-assigned this Nov 3, 2018
@ysb33r ysb33r mentioned this issue Nov 3, 2018
28 tasks
ysb33r added a commit to ysb33r/asciidoctor-gradle-plugin that referenced this issue Nov 7, 2018
GEM support:
- Add compatibility test for gems support plugin.

Reveal.js:
- Reveal.js plugin & base plugin.
- `revealjs` extension.
- `revealjsPlugins` extension.
- Plugin support is ignored if reveal.js backend < 1.2.0.
- Compatibility test checks for content in generated files.

JDK & Gradle support:
- Upgradle build to 4.8.1.
- Test with JDK8, JDK10, JDK11 on Travis.
- Add Gradle 4.10.2 & Gradle 5.10-rc-1 to compatibility matrix.
- Minimum Gradle version for compatibility testing on JDK11 is 4.8.1.
- Use at least Jacoco 0.8.3 for JDK11.
- Inject Guava classpath for Gradle 4.8.
- Make publishing Gradle 5.0 compatible.
- Work around Gradle 5.0 worker classpath leakage

Miscellaneous:
- Add upgrading note regarding extensions.
- GitHub archives unpack in a repository-branch pattern.
- Compatibility Asciidoctor Task will support legacy attributes.
  In order to ease migration `legacyAttributes=true` can be set on
  the compatibility conversion task. This will enable `projectdir` and
  `rootdir` attributes. it will also print a warning message to change the
  usage to the new attributes.
- Under test if the Groovy versions are different, then run using
  JAVA_EXEC instead (asciidoctor#269).
@ragnor
Copy link

ragnor commented Jan 18, 2019

Hi,
Is there any way to run version 1.5.9.2 on gradle 5.1.1 so below exception won't occur:

Exception in thread "main" java.lang.ExceptionInInitializerError
        at org.codehaus.groovy.runtime.InvokerHelper.<clinit>(InvokerHelper.java:86)
        at groovy.lang.GroovyObjectSupport.getDefaultMetaClass(GroovyObjectSupport.java:59)
        at groovy.lang.GroovyObjectSupport.<init>(GroovyObjectSupport.java:32)
        at groovy.lang.Reference.<init>(Reference.java:38)
        at org.asciidoctor.gradle.backported.AsciidoctorJavaExec.main(AsciidoctorJavaExec.groovy:188)
Caused by: groovy.lang.GroovyRuntimeException: Conflicting module versions. Module [groovy-all is loaded in version 2.5.4 and you are trying to load version 2.4.12
        at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl$DefaultModuleListener.onModule(MetaClassRegistryImpl.java:523)
        at org.codehaus.groovy.runtime.m12n.ExtensionModuleScanner.scanExtensionModuleFromProperties(ExtensionModuleScanner.java:87)
        at org.codehaus.groovy.runtime.m12n.ExtensionModuleScanner.scanExtensionModuleFromMetaInf(ExtensionModuleScanner.java:81)
        at org.codehaus.groovy.runtime.m12n.ExtensionModuleScanner.scanClasspathModulesFrom(ExtensionModuleScanner.java:63)
        at org.codehaus.groovy.runtime.m12n.ExtensionModuleScanner.scanClasspathModules(ExtensionModuleScanner.java:55)
        at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.<init>(MetaClassRegistryImpl.java:124)
        at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.<init>(MetaClassRegistryImpl.java:85)
        at groovy.lang.GroovySystem.<clinit>(GroovySystem.java:36)
        ... 5 more

@ysb33r
Copy link
Member Author

ysb33r commented Jan 18, 2019

Try using 2.0-alpha.5 instead.

We are only plannign to do a small maintenance releases on 1.5.x and currently there is no plan to fully support it on Gradle 5.x once the 2.x version of the plugin is released.

@ragnor
Copy link

ragnor commented Jan 18, 2019

Thank you for the answer.
Unfortunately I'm using Spring REST Docs that requires asciidoctor 1.5.x. What is surprising downgrading to 1.5.3 (this one is suggested in Spring REST Docs documentation) seams to solve the issue.
With 2.0-alpha.5 and gradle 5.1.1 I had an issue Exception in thread "main" java.lang.ClassNotFoundException: com.google.common.collect.ImmutableSet$SerializedForm

@shevek
Copy link

shevek commented Feb 10, 2019

Asciidoctor 1.5.9.2 doesn't work on 4.10.3 either, even in-process.
Version 1.5.3 does. Also downgrading as workaround.

AD 1.5.9.2 DID work on Gradle 4.5.1, so something changed.

@wimdeblauwe
Copy link

Also had to downgrade to 1.5.3 to work with Gradle 5.2.1

@ysb33r
Copy link
Member Author

ysb33r commented Feb 20, 2019

@wimdeblauwe @shevek @ragnor Are any of you using build.gradle.kts instead of build.gradle ?

@wimdeblauwe
Copy link

@wimdeblauwe @shevek @ragnor Are any of you using build.gradle.kts instead of build.gradle ?

Not me

@shevek
Copy link

shevek commented Feb 24, 2019

We are using build.gradle in groovy, no kts here.

@shevek
Copy link

shevek commented Feb 25, 2019

The issue is that AbstractAsciidoctorTask is including everything plus the kitchen sink on the classpath when it invokes an external JVM. Heaven only knows why half that stuff is on there, there's at least 3 groovy versions that I can see. It's including the entire runtime classpath for the project without even doing dependency resolution. So yes, it's SNAFU'd.

@ysb33r
Copy link
Member Author

ysb33r commented Mar 2, 2019

I think I have tracked down the issue. I might do a maintenance release within the next two weeks. Time is limited atm.

@ysb33r ysb33r added the 1.[56].x Issues related to the 1.5.x/1.6.x series label Mar 3, 2019
@ysb33r ysb33r modified the milestones: 2.0.0, 1.5.9.3 / 1.5.10 Mar 22, 2019
ysb33r added a commit to ysb33r/asciidoctor-gradle-plugin that referenced this issue Apr 23, 2019
ysb33r added a commit to ysb33r/asciidoctor-gradle-plugin that referenced this issue Apr 23, 2019
ysb33r added a commit to ysb33r/asciidoctor-gradle-plugin that referenced this issue Apr 23, 2019
ysb33r added a commit to ysb33r/asciidoctor-gradle-plugin that referenced this issue Apr 23, 2019
@ysb33r ysb33r modified the milestones: 1.5.9.3 / 1.5.10, 1.5.12 Apr 23, 2019
@ysb33r
Copy link
Member Author

ysb33r commented Apr 23, 2019

Finally got to do the fix for this after 2.1.0 was released and 2.2.0 work has bene prepped.

The fix will be released in 1.5.12 and 1.6.1. Will get @aalmiray to release when he has the time.

@shevek
Copy link

shevek commented May 28, 2019

Is there a release of 1.5.12? asciidoctor just broke for us globally with no change on our side, so we're hunting for a bunch of outstanding fixes. :(

@ysb33r
Copy link
Member Author

ysb33r commented May 28, 2019

Yes 1.5.12 & 1.6.1 was released some weeks ago.

@shevek
Copy link

shevek commented May 28, 2019

Thank you. Didn't see it on Central. See it now in Gradle plugins.

@ysb33r
Copy link
Member Author

ysb33r commented May 29, 2019

Closing thisissue. Please raise a new one if you still see something similar.

@ysb33r ysb33r closed this as completed May 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.[56].x Issues related to the 1.5.x/1.6.x series 2.x Issue related to the 2.x series bug
Projects
None yet
Development

No branches or pull requests

4 participants