Skip to content

Add CI build using JDK 25 - #2921

Merged
eamonnmcmanus merged 1 commit into
google:mainfrom
Marcono1234:marcono1234/ci-jdk-25
Oct 6, 2025
Merged

eamonnmcmanus merged 1 commit into
google:mainfrom
Marcono1234:marcono1234/ci-jdk-25

Conversation

@Marcono1234

@Marcono1234 Marcono1234 commented Oct 6, 2025 •

Copy link
Copy Markdown
Contributor

Purpose

Add CI build using JDK 25, so that we can be sure Gson works with JDK 25

Supersedes #2847

Description

However, because building with JDK 25 does not fully work yet, mainly due to issues with ProGuard, still disallow building with JDK 25 by default. This way it fails fast for users locally instead of causing confusing failures later on.

Note that there are a few warnings related to Unsafe usage by Maven (respectively its dependencies) and by protobuf-java.

And also one test is causing warnings:

[INFO] Running com.google.gson.typeadapters.UtcDateTypeAdapterTest
WARNING: Use of the three-letter time zone ID "NST" is deprecated and it will be removed in a future release
WARNING: Use of the three-letter time zone ID "AST" is deprecated and it will be removed in a future release
WARNING: Use of the three-letter time zone ID "MST" is deprecated and it will be removed in a future release

(that test uses all time zones provided by TimeZone.getAvailableIDs())

But besides that the build and Gson itself seems to work fine with JDK 25.

However, because building with JDK 25 does not fully work yet, mainly due
to issues with ProGuard, still disallow building with JDK 25 by default.
This way it fails fast for users locally instead of causing confusing
failures later on.
Comment thread gson/pom.xml
<jdk>[25,)</jdk>
</activation>
<properties>
<excludeTestCompilation>com/google/gson/functional/EnumWithObfuscatedTest.java</excludeTestCompilation>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

For simplicity I reused the existing excludeTestCompilation property which we are already using for excluding JDK 17+ tests on JDK 11.

A slightly cleaner solution might be to adjust the maven-surefire-plugin configuration instead, to exclude that test. But I am not sure if that is worth it, given that hopefully soon in the future ProGuard supports JDK 25.

@eamonnmcmanus eamonnmcmanus left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Seems very reasonable. Thanks for doing this!

@eamonnmcmanus
eamonnmcmanus merged commit 44ccfd0 into google:main Oct 6, 2025
15 checks passed
@Marcono1234
Marcono1234 deleted the marcono1234/ci-jdk-25 branch October 8, 2025 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants