Fix SDK build and unit tests on JDK 27 - #74
Draft
mihir-pradhan wants to merge 3 commits into
Draft
mihir-pradhan wants to merge 3 commits into
mihir-pradhan wants to merge 3 commits into
Conversation
| <groupId>net.bytebuddy</groupId> | ||
| <artifactId>byte-buddy</artifactId> | ||
| <version>1.15.4</version> | ||
| <version>1.17.7</version> |
Contributor
There was a problem hiding this comment.
I noticed a pre-existing issue (not related to your PR, but we might want to fix since we're touching this area). byte-buddy is only needed for tests, but is currently configured to be a default dependency, so it's part of the production builds as well.
We can add this to scope it to only tests:
<scope>test</scope>
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.
Description
Makes
duo-universal-sdkbuild and test on JDK 27, and adds JDK 27 to CI so it does not regress.POM changes:
maven-assembly-plugin2.5.4 → 3.8.0, goalattached→single, sinceattachedwas removed in 3.xmaven-surefire-plugin2.22.1 → 3.6.0, dropping its pinnedjunit-platform-surefire-provider, which 3.x cannot use and no longer needsmockito-core3.11.2 → 5.23.0, with ajdk8profile pinning 4.11.0 because Mockito 5 requires Java 11byte-buddy1.15.4 → 1.17.7 withbyte-buddy-agentalongside it, both test scoped and excluded fromconverter-jacksonTwo static imports in
ClientTestmove fromorg.mockito.Matchers, removed in Mockito 4, toArgumentMatchers.byte-buddy is only needed so Mockito can generate mocks.
jackson-databinddeclares it but never references it, and nothing else on the runtime classpath does either, so it no longer ships: the fat jar drops from 7.3 MB to 3.1 MB and the CycloneDX SBOM from 9 components to 8. Consumers no longer receive byte-buddy transitively from this SDK.Both CI jobs gain a JDK 27 leg. They use Zulu rather than Temurin: JDK 27 went GA on 2026-09-15 but Adoptium's newest feature release is still 26, so
distribution: temurinwithjava-version: 27fails before Maven runs. Worth collapsing back to a single distribution once Temurin 27 ships. Existing legs stay on Temurin and job names are unchanged, so this only addsSDK - Java 27andExample App - Java 27.Motivation and Context
On JDK 27 the assembly plugin fails with
No such archiver: 'jar', so no-jar-with-dependencies.jaris produced, and 47 of 87 tests error. The test errors have two separate causes: 7 inDuoConnectorTest, where Mockito 3.11 cannot generate mocks on a JDK this new, and 40 inClientTest, wheresrc/test/resources/mockito-extensions/org.mockito.plugins.MockMakeradditionally forces Mockito's inline mock maker, which cannot self-attach to a modern JVM before Mockito 5. Neither failure was caught because the CI matrix stopped at Java 21.How Has This Been Tested?
On JDK 27, unscoped
mvn -B installsucceeds with the assembly step enabled andmvn testpasses 87/87, covering both modules. The three steps CI runs for the SDK —clean install,checkstyle:checkand-P release package, each-pl duo-universal-sdk— also pass on JDK 27 and on JDK 17, producing all four jars.Client.classis still class file major 52, and the example app starts on JDK 27 and serves HTTP 200.No JDK 8 was available locally, so the
jdk8profile could only be verified as far as resolving to Mockito 4.11.0 and passing 87/87 on a JDK 17 VM. The Java 8 leg on this PR closes that gap: it passes, confirming Mockito 4.11's inline mock maker self-attaches on a real Java 8 VM. Java 11 and 21 pass as well, so there is no regression on the supported JDKs.Types of Changes