fix: upgrade spotbugs-maven-plugin to 4.8.6.8 for jdk 17+ support - #1816
Open
aws-kevinrickard wants to merge 1 commit into
Open
fix: upgrade spotbugs-maven-plugin to 4.8.6.8 for jdk 17+ support#1816aws-kevinrickard wants to merge 1 commit into
aws-kevinrickard wants to merge 1 commit into
Conversation
spotbugs-maven-plugin 4.0.0 crashes with 'Unsupported class file major version 61' when run on a JDK 17+ JVM, because its bundled ASM version predates class file format 61 (Java 17). Upgrade to 4.8.6.8, the latest version whose own minimum JVM requirement is still JDK 8 (per the official compatibility table at https://spotbugs.github.io/spotbugs-maven-plugin/plugin-info.html). Pin the spotbugs core analyzer to 4.8.6 (matching the plugin line) and align spotbugs-annotations to the same version. The upgraded analyzer detects additional pre-existing bug patterns that 4.0.0 did not. These are excluded in findbugs-exclude.xml with a comment noting they should be addressed in follow-up work. maven.compiler.source/target remains 1.8 — this change only upgrades the static-analysis tooling version, not the project's compiled bytecode target.
|
Unit Tests Coverage Report
Minimum allowed coverage is Generated by 🐒 cobertura-action against 0b1b678 |
|
Integration Tests Coverage Report
Minimum allowed coverage is Generated by 🐒 cobertura-action against 0b1b678 |
alter-mage
approved these changes
Jul 24, 2026
muboheng
approved these changes
Aug 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
spotbugs-maven-pluginis pinned to version4.0.0, which crashes with:when the build is invoked using a JDK 17+ JVM. This is because SpotBugs 4.0.0's bundled ASM library does not recognize Java 17 class files (major version 61).
Upstream references:
Solution
Upgrade
spotbugs-maven-pluginfrom4.0.0to4.8.6.8, with the SpotBugs core analyzer pinned to4.8.6andspotbugs-annotationsaligned to the same version.Why 4.8.6.8?
Per the official compatibility table, the plugin's own minimum JVM requirement was bumped to JDK 11 starting at
4.9.0.0. Version4.8.6.8is the top of the last JDK-8-runtime-compatible line, meaning:maven.compiler.source/maven.compiler.targetremain1.8— this PR does not change the project's compiled bytecode targetNew SpotBugs findings
The upgraded analyzer detects several additional bug patterns (
CT_CONSTRUCTOR_THROW,MC_OVERRIDABLE_METHOD_CALL_IN_CONSTRUCTOR,NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR, etc.) that 4.0.0 was unable to detect. These are all pre-existing code patterns, not regressions. They are excluded incodestyle/findbugs-exclude.xmlwith a comment noting they should be addressed in follow-up work and then removed from the filter.Testing
mvn testpasses with JDK 17 (1181/1182 tests pass; 1 pre-existing flaky testTokenExchangeServiceTestunrelated to this change)checkgoal completes successfully (no crash)Changes
pom.xml: bumpspotbugs-maven-plugin4.0.0 → 4.8.6.8, pinspotbugscore 4.8.6, alignspotbugs-annotations4.6.0 → 4.8.6codestyle/findbugs-exclude.xml: exclude newly-detected pre-existing bug patterns