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

Is it possible to remove warnings when asciidoctor task is run on Java 9+ #400

Closed
bric3 opened this issue Jun 15, 2019 · 6 comments
Closed
Labels
1.[56].x Issues related to the 1.5.x/1.6.x series 2.x Issue related to the 2.x series 3.x Issues related to the 3.x has-external-block question

Comments

@bric3
Copy link
Contributor

bric3 commented Jun 15, 2019

I'm switching an existing project currently running on Java 8 to Java 11, and this is not a surprise, some tasks display some warnings about illegal reflective access. Is it possible to tell the asciidoctor task to run with specific JVM arguments. For example the Test task can be configured with jvmArgs :

jvmArgs '--illegal-access=warn' // warn to find the all illegal accesses

Is it possible with asciidoctor gradle plugin (1.6.1)

> Task :asciidoctor
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.vmplugin.v7.Java7$1 (file:/Users/bric3/.gradle/caches/modules-2/files-2.1/org.codehaus.groovy/groovy/2.5.7/99907efe4b69f800c42584386f5d668e4d952bd5/groovy-2.5.7.jar) to constructor java.lang.invoke.MethodHandles$Lookup(java.lang.Class,int)
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.vmplugin.v7.Java7$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
$ ./gradlew --version

------------------------------------------------------------
Gradle 5.4.1
------------------------------------------------------------

Build time:   2019-04-26 08:14:42 UTC
Revision:     261d171646b36a6a28d5a19a69676cd098a4c19d

Kotlin:       1.3.21
Groovy:       2.5.4
Ant:          Apache Ant(TM) version 1.9.13 compiled on July 10 2018
JVM:          11.0.2 (AdoptOpenJDK 11.0.2+9)
OS:           Mac OS X 10.14.5 x86_64
plugins {
    id 'org.asciidoctor.convert' version '1.6.1'
}

asciidoctorj {
    version = "1.5.8.1"
}

asciidoctor {
    requires 'asciidoctor-diagram'
    options doctype: 'book'
    attributes = ['source-highlighter': 'coderay',
                  'encoding'          : 'utf-8']
    sources {
        include 'index.adoc'
    }
}

I'm currently blocked on this version because of this issue : spring-projects/spring-restdocs#581

@ysb33r
Copy link
Member

ysb33r commented Jun 16, 2019

@bric3 The warning you see are Groovy-based. I believe they will be fixed in Groovy 3 and will as such disappear when Gradle adopts that (probably not earlier than Gradle 6).

@ysb33r
Copy link
Member

ysb33r commented Jun 16, 2019

I'm currently blocked on this version because of this issue : spring-projects/spring-restdocs#581

This will need to be resolved on the Spring side.

@ysb33r ysb33r added 1.[56].x Issues related to the 1.5.x/1.6.x series 2.x Issue related to the 2.x series 3.x Issues related to the 3.x has-external-block labels Jun 16, 2019
@ysb33r
Copy link
Member

ysb33r commented Jun 27, 2019

I'm currently blocked on this version because of this issue : spring-projects/spring-restdocs#581

Please see spring-projects/spring-restdocs#625 which is about adsressing your block.

I am closing this issue as nothing more can be done directly.

@ysb33r ysb33r closed this as completed Jun 27, 2019
@bric3
Copy link
Contributor Author

bric3 commented Jun 27, 2019

@ysb33r Thanks for the pointer. Indeed I know those are Groovy warnings, I've adressed them in my tests tasks using jvmArgs but I'd like to do the same here. I believe that asciidoctor gradle plugin v2 has some way to pass arguments to the forked process ? Regardless of the spring-restdocs or java 9 module warnings passing these options could be useful.

@ysb33r
Copy link
Member

ysb33r commented Jun 27, 2019

I believe that asciidoctor gradle plugin v2 has some way to pass arguments to the forked process.

Yes, use forkOptions with a closure or an Action. Basically any setting you can do for a JavaForkOptions instance, can be used.

asciidoctor {
   forkOptions {
     jvmArgs '-Xdiag'
     minHeapSize =  '256M'
   }
}

@bric3
Copy link
Contributor Author

bric3 commented Jun 28, 2019

Ah great, thanks !

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 3.x Issues related to the 3.x has-external-block question
Projects
None yet
Development

No branches or pull requests

2 participants