spotbugs / spotbugs-maven-plugin

Maven Mojo Plug-In to generate reports based on the SpotBugs Analyzer
https://spotbugs.github.io/spotbugs-maven-plugin/
Apache License 2.0
69 stars 51 forks source link

Java 9 Illegal reflective access groovy 2.4.13 #46

Closed hheg closed 6 years ago

hheg commented 6 years ago

[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 commented 6 years ago

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 commented 5 years ago

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: https://github.com/airlift/sphinx-maven-plugin/commit/c870da4b6436fe75d0e71dbd3a9ff079793d3927

hazendaz commented 5 years ago

Groovy long since fixed issues. We are no longer having any problems I'm aware of. We run fine on all jdk version now.

Get Outlook for Androidhttps://aka.ms/ghei36


From: David Phillips notifications@github.com Sent: Sunday, December 30, 2018 1:50:37 AM To: spotbugs/spotbugs-maven-plugin Cc: Jeremy Landis; State change Subject: Re: [spotbugs/spotbugs-maven-plugin] Java 9 Illegal reflective access groovy 2.4.13 (#46)

We should be able to fix this when when using true 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@c870da4https://github.com/airlift/sphinx-maven-plugin/commit/c870da4b6436fe75d0e71dbd3a9ff079793d3927

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHubhttps://github.com/spotbugs/spotbugs-maven-plugin/issues/46#issuecomment-450542794, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AA7ho9k6ZE2R1KkTh2f_IQWhhCoGi2Iyks5u-GI9gaJpZM4Trkv_.

electrum commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

Yes but that is a warning originating in third party. I have zero plans to hide the warning. That does nothing to fix it. As it stated, report to owner of the library in question. This plugin isnt the issue. Groovy is. They are aware anyways and it will eventually be fixed. Until then there is no issue here.

Just caught your last message. You got it! Thanks!

Get Outlook for Androidhttps://aka.ms/ghei36


From: David Phillips notifications@github.com Sent: Sunday, December 30, 2018 2:16:14 AM To: spotbugs/spotbugs-maven-plugin Cc: Jeremy Landis; State change Subject: Re: [spotbugs/spotbugs-maven-plugin] Java 9 Illegal reflective access groovy 2.4.13 (#46)

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.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHubhttps://github.com/spotbugs/spotbugs-maven-plugin/issues/46#issuecomment-450543648, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AA7ho_nz7XJ0VnAU0qpQzWUDqoMiWSZTks5u-Gg-gaJpZM4Trkv_.

bentatham commented 5 years ago

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