Skip to content

fix: upgrade Mockito and JaCoCo for Java 25 compatibility#1195

Open
carlossg wants to merge 1 commit into
google:mainfrom
carlossg:fix/java25-asm-compatibility
Open

fix: upgrade Mockito and JaCoCo for Java 25 compatibility#1195
carlossg wants to merge 1 commit into
google:mainfrom
carlossg:fix/java25-asm-compatibility

Conversation

@carlossg
Copy link
Copy Markdown

@carlossg carlossg commented May 12, 2026

Summary

  • Upgrade Mockito 5.20.05.23.0
  • Upgrade JaCoCo 0.8.120.8.14

Problem

Both Mockito and JaCoCo bundle an ASM library that does not recognize Java 25 class file format (major version 69). Running mvn test on Java 25 fails with:

Caused by: java.lang.IllegalArgumentException: Unsupported class file major version 69

This happens because Java 25 was released in September 2025, after these versions were published. ASM 9.7 (bundled in the old versions) supports up to Java 24; Java 25 requires ASM 9.8+.

Fix

Upgraded to versions released after Java 25 GA:

  • Mockito 5.23.0 bundles ByteBuddy/ASM with Java 25 support
  • JaCoCo 0.8.14 bundles ASM with Java 25 support

Test plan

  • mvn test -pl core passes cleanly on Java 25
  • Full mvn test passes (1247 tests, 0 failures — the only error is LangChain4jIntegrationTest which requires live API credentials and was failing before this change)

@google-cla
Copy link
Copy Markdown

google-cla Bot commented May 12, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Mockito 5.20.0 and JaCoCo 0.8.12 both bundle an ASM version that does
not recognize Java 25 class file format (major version 69), causing
IllegalArgumentException at test time. Upgrading to versions released
after Java 25 GA resolves the issue.

- mockito: 5.20.0 → 5.23.0
- jacoco-maven-plugin: 0.8.12 → 0.8.14
@carlossg carlossg force-pushed the fix/java25-asm-compatibility branch from f821dae to 8574fc5 Compare May 12, 2026 20:03
@carlossg carlossg marked this pull request as ready for review May 12, 2026 20:06
Copy link
Copy Markdown
Collaborator

@mazas-google mazas-google left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for contributing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants