xvik / gradle-quality-plugin

Gradle quality plugin for Java and Groovy
http://xvik.github.io/gradle-quality-plugin
MIT License
134 stars 11 forks source link

Update Spotbugs Gradle plugin to 5.1.4 #94

Closed AlexanderZobkov closed 10 months ago

AlexanderZobkov commented 1 year ago

When using this quality plugin with Gradle 8.2.1, Gradle reports that API used in Spotbugs Gradle plugin (4.8.0) is deprecated. Let's upgrade Spotbugs Gradle plugin to 5.1.4 for Gradle 8.x compatibility purposes.

The org.gradle.api.plugins.Convention type has been deprecated. This is scheduled to be removed in Gradle 9.0. Consult the upgrading guide for further information: https://docs.gradle.org/8.2.1/userguide/upgrading_version_8.html#deprecated_access_to_conventions
        at org.gradle.internal.extensibility.DefaultConvention.logConventionDeprecation(DefaultConvention.java:398)
        at org.gradle.internal.extensibility.DefaultConvention.findPlugin(DefaultConvention.java:100)
        at org.gradle.internal.extensibility.DefaultConvention.getPlugin(DefaultConvention.java:89)
        at com.github.spotbugs.snom.internal.SpotBugsTaskFactory.lambda$generateForJava$2(SpotBugsTaskFactory.java:48)
        at org.gradle.configuration.internal.DefaultUserCodeApplicationContext$CurrentApplication$1.execute(DefaultUserCodeApplicationContext.java:123)
...
        at org.gradle.api.internal.DefaultMutationGuard$1.execute(DefaultMutationGuard.java:45)
        at org.gradle.api.internal.collections.CollectionFilter$1.execute(CollectionFilter.java:59)
        at org.gradle.api.internal.DefaultDomainObjectCollection.configureEach(DefaultDomainObjectCollection.java:185)
        at com.github.spotbugs.snom.internal.SpotBugsTaskFactory.generateForJava(SpotBugsTaskFactory.java:45)
        at com.github.spotbugs.snom.internal.SpotBugsTaskFactory.generate(SpotBugsTaskFactory.java:37)
        at ru.vyarus.gradle.plugin.quality.spotbugs.CustomSpotBugsPlugin.apply(CustomSpotBugsPlugin.java:46)
        at ru.vyarus.gradle.plugin.quality.spotbugs.CustomSpotBugsPlugin.apply(CustomSpotBugsPlugin.java:28)
        at org.gradle.api.internal.plugins.ImperativeOnlyPluginTarget.applyImperative(ImperativeOnlyPluginTarget.java:43)
xvik commented 1 year ago

Sure, will do. I was keeping old version for backwards compatibility with old gradle versions (as long as I can).

baev commented 10 months ago

@xvik, are there any updates? This issue is the only one that keeps us from upgrading to Gradle 8.

xvik commented 10 months ago

No updates yet. I will look this in priority

xvik commented 10 months ago

5.0.0 released

Spotbugs plugin updated to the latest 5.x plugin version (because 6.x drops gradle 7 and java 8 support)

I also removed all deprecated apis usage, so there should be no warnings now. Configuration cache is still not supported (not sure it's possible at all currently)

One downside of new gradle apis usage is that console report might appear not directly below quality task, but only in strict mode (I can't do anything with it)

Gradle 5 and 6 support was dropped (due to switching to groovy 3).