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

Java 9 Illegal reflective access groovy 2.4.13 #46

Closed
hheg opened this issue Apr 28, 2018 · 7 comments
Closed

Java 9 Illegal reflective access groovy 2.4.13 #46

hheg opened this issue Apr 28, 2018 · 7 comments

Comments

@hheg
Copy link

hheg commented Apr 28, 2018

[INFO] --- spotbugs-maven-plugin:3.1.1:spotbugs (spotbugs) @ project --- WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass (file:/home/hheg/.m2/repository/org/codehaus/groovy/groovy/2.4.13/groovy-2.4.13.jar) to method java.lang.Object.finalize() WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.reflection.CachedClass 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 [INFO] [INFO] <<< spotbugs-maven-plugin:3.1.1:check (default) < :spotbugs @ project <<< [INFO]

The project is a parent and of a pom type.

This error is probably related to https://issues.apache.org/jira/browse/GROOVY-8339

From spotbugs/spotbugs#598

@hazendaz
Copy link
Member

Closing issue as this is not a problem with our library. Groovy is aware of the issue and it is not fixed in any of their versions includuing 2.5, 2.6, and 3.0 releases. There is no need for us to track their issue. We are otherwise good through jdk10.

@electrum
Copy link

We should be able to fix this when when using <fork>true</fork> by adding the appropriate --add-opens arguments for the forked JVM. I did something similar for a Maven plugin that uses Jython: airlift/sphinx-maven-plugin@c870da4

@hazendaz
Copy link
Member

hazendaz commented Dec 30, 2018 via email

@electrum
Copy link

electrum commented Dec 30, 2018

I still see this warning with version 3.1.10 of the plugin. It actually happens during configuration, even if the plugin is disabled with <skip>true</skip>:

[INFO] --- spotbugs-maven-plugin:3.1.10:spotbugs (spotbugs) @ presto-spi ---
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.vmplugin.v7.Java7$1 (file:/Users/dphillips/.m2/repository/org/codehaus/groovy/groovy/2.5.4/groovy-2.5.4.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
[INFO] 
[INFO] <<< spotbugs-maven-plugin:3.1.10:check (default-cli) < :spotbugs @ presto-spi <<<

@electrum
Copy link

Ah, I see that the plugin itself is written in Groovy (rather than embedding it), which explains why it happens even when disabled, so the suggested workaround isn't an option.

@hazendaz
Copy link
Member

hazendaz commented Dec 30, 2018 via email

@bentatham
Copy link

For those curious to follow and/or vote for the root issue:
https://issues.apache.org/jira/browse/GROOVY-8339

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants