Closed aaime closed 4 years ago
@aaime That issue is with groovy and as indicated by its output the issue needs raised with the owner which is groovy project but the version is not their latest. Aside from that concern, we are using groovy 2.5.5. Are you defining groovy separately as 2.5.4?
I'm using the latest maven plugin, which depends on 2.5.4, no extra dep overrides: https://mvnrepository.com/artifact/com.github.spotbugs/spotbugs-maven-plugin/3.1.10
I see spotbugs is now at 3.1.11, but I don't see a corresponding maven plugin version on the repos: https://mvnrepository.com/artifact/com.github.spotbugs/spotbugs-maven-plugin
About the issue being in groovy, yep, I understand, you can keep this report as a reminder to upgrade, when groovy fixes the issue :-p
Ah, btw, I see this PR and associated ticket: https://github.com/apache/groovy/pull/811 https://issues.apache.org/jira/browse/GROOVY-8843
So I'm guessing that an upgrade to Groovy 3 will be required, once it's released.
@aaime While we did run a release once before using groovy 3.x alpha series, it is alpha and we were doing so to get around some other issues we encountered. While I could push back to 3.x alpha as it seems to cause no harm, i'm not sure at the moment that we need to since this is just noise that doesn't cause any particular issue right now. I am going to release 3.1.11 version of the plugin today which will at least be on groovy 2.5.5. Once groovy is onto beta for 3.x, I'll look at bumping. My concern is really what groovy wants to do with alpha as it apears they had a 2.6 alpha then dropped it recently. While I don't expect that with version 3.x, the entire 3.x is still subject for other changes which could cause stability issues. I was really pushing the envelope in prior releases due to jdk 11 support issues so the fact it works now in jdk 11, I'm ok even with the noise.
Updated issue name as the problem persists with 2.5.6 as well.
This has been annoying me, now that my projects are building using Java 11 more and more. Hopefully, 3.0.0 will release soon, unless spotbugs is comfortable using the beta-1, which is now available.
@ctubbsii I don't have any problems switching back to 3. We used it in a couple of releases on earlier cuts. We only fell back as it didn't benefit any to be there. The stack works fine on it though so not a big deal to switch back if it indeed fixes the issues as indicated on GROOVY-8339.
@ctubbsii This is fixed on master now. If you could, pull the project and run a quick build and test to confirm it behaves as you would expect. I had been hanging on release so I could keep version strings in sync with spotbugs but most likely if this is ok now will release a 3.1.12.1 release. I could do that pretty much as soon as this is confirmed by others.
@hazendaz Built bee21966a0d41d52bc4d97d137bb036a4e8fc776 as 3.1.13-SNAPSHOT and tested on a large project (Apache Accumulo) and it works as expected, without groovy warnings. 3.1.12.1
would be a nice release version.
@ctubbsii Thanks for confirming! I have pushed a release as 3.1.12.1. It should hit central in next couple of hours.
Thanks for the new release, however I'm still seeing this with Java 12.0.1 + and the new version. Stack trace is below after running with --illegal-access=debug
[INFO] --- spotbugs-maven-plugin:3.1.12.1:spotbugs (spotbugs) @ application ---
WARNING: Illegal reflective access by org.codehaus.groovy.reflection.ReflectionUtils (file:/Users/xxx/.m2/repository/org/codehaus/groovy/groovy/3.0.0-beta-2/groovy-3.0.0-beta-2-indy.jar) to method java.util.Collections$UnmodifiableCollection.toString()
at org.codehaus.groovy.reflection.ReflectionUtils.makeAccessible(ReflectionUtils.java:204)
at org.codehaus.groovy.reflection.ReflectionUtils.makeAccessible(ReflectionUtils.java:196)
at org.codehaus.groovy.reflection.ReflectionUtils$1.run(ReflectionUtils.java:189)
at org.codehaus.groovy.reflection.ReflectionUtils$1.run(ReflectionUtils.java:187)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:310)
at org.codehaus.groovy.reflection.ReflectionUtils.makeAccessibleInPrivilegedAction(ReflectionUtils.java:187)
at org.codehaus.groovy.reflection.CachedMethod.makeAccessibleIfNecessary(CachedMethod.java:380)
at org.codehaus.groovy.reflection.CachedMethod.setAccessible(CachedMethod.java:155)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoCachedMethodSite.<init>(PojoMetaMethodSite.java:182)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoCachedMethodSiteNoUnwrapNoCoerce.<init>(PojoMetaMethodSite.java:207)
at org.codehaus.groovy.reflection.CachedMethod.createPojoMetaMethodSite(CachedMethod.java:313)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.createCachedMethodSite(PojoMetaMethodSite.java:159)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.createPojoMetaMethodSite(PojoMetaMethodSite.java:148)
at groovy.lang.MetaClassImpl.createPojoCallSite(MetaClassImpl.java:3525)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.createPojoSite(CallSiteArray.java:131)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.createCallSite(CallSiteArray.java:165)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:115)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:119)
at org.codehaus.mojo.spotbugs.SpotBugsMojo.executeSpotbugs(SpotBugsMojo.groovy:1022)
at org.codehaus.groovy.runtime.callsite.PlainObjectMetaMethodSite.doInvoke(PlainObjectMetaMethodSite.java:43)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:190)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:58)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:51)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:156)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:168)
at org.codehaus.mojo.spotbugs.SpotBugsMojo.canGenerateReport(SpotBugsMojo.groovy:566)
at org.codehaus.mojo.spotbugs.SpotBugsMojo.execute(SpotBugsMojo.groovy:701)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:148)
Environment:
Maven home: /Users/mcgin/dev/tools/apache-maven-3.6.1
Java version: 12.0.1, vendor: Oracle Corporation, runtime: /Users/mcgin/dev/tools/jdk-12.0.1.jdk/Contents/Home
Default locale: en_GB, platform encoding: UTF-8
OS name: "mac os x", version: "10.14.5", arch: "x86_64", family: "mac"
@aaime I'll open up a new issue for tracking. This is a yet to be fixed item with groovy. They still have a tracking item related to illegal access issues. Our integration tests pick this one up (only this one). I'll link back to here and note the test in the new ticket.
updated groovy to 3.0.0-betta2 and finally have no more this issue with JDK12
Running spotbugs:gui but also running spotbugs:check results in the following, on a JDK 11 build:
Likely related to https://issues.apache.org/jira/browse/GROOVY-8339