Skip to content

Upgrade to JDK 25 and Agrona 2.4.0#1665

Open
jfallows wants to merge 19 commits intodevelopfrom
claude/upgrade-jdk-agrona-7SjSz
Open

Upgrade to JDK 25 and Agrona 2.4.0#1665
jfallows wants to merge 19 commits intodevelopfrom
claude/upgrade-jdk-agrona-7SjSz

Conversation

@jfallows
Copy link
Copy Markdown
Contributor

Summary

  • Bump maven.compiler.source/target/release from 20 to 25
  • Bump agrona.version from 1.23.1 to 2.4.0
  • Replace removed org.agrona.UnsafeAccess with java.lang.invoke.VarHandle.storeStoreFence() in ManyToOneRingBuffer (UnsafeAccess was deleted in Agrona 2.x)
  • Add --add-opens java.base/jdk.internal.misc=ALL-UNNAMED to maven-surefire and maven-failsafe argLine (Agrona 2.x uses jdk.internal.misc.Unsafe internally)
  • Add --add-opens java.base/jdk.internal.misc=ALL-UNNAMED to the generated zilla launcher script in ZpmInstall.generateLauncher() so the runtime JVM also has the required module access
  • Update release profile requireJavaVersion from [21,22) to [25,26)
  • Update Docker build image from eclipse-temurin:22-jdk to eclipse-temurin:25-jdk
  • Update GitHub Actions: build matrix [21, 23][25], release JDK 2125, CodeQL JDK 2025

Test plan

  • GitHub Actions build passes on JDK 25
  • Docker image builds successfully with eclipse-temurin:25-jdk
  • Unit tests pass (maven-surefire) with --add-opens java.base/jdk.internal.misc=ALL-UNNAMED
  • Integration tests pass (maven-failsafe) with --add-opens java.base/jdk.internal.misc=ALL-UNNAMED
  • ManyToOneRingBuffer behaves correctly with VarHandle.storeStoreFence() replacing UnsafeAccess.UNSAFE.storeFence()

claude and others added 19 commits March 28, 2026 17:46
- Bump maven.compiler.source/target/release from 20 to 25
- Bump agrona.version from 1.23.1 to 2.4.0
- Replace removed org.agrona.UnsafeAccess with java.lang.invoke.VarHandle.storeStoreFence()
  in ManyToOneRingBuffer (UnsafeAccess was removed in Agrona 2.x)
- Add --add-opens java.base/jdk.internal.misc=ALL-UNNAMED to maven-surefire and
  maven-failsafe argLine (required by Agrona 2.x which uses jdk.internal.misc.Unsafe)
- Update release profile requireJavaVersion from [21,22) to [25,26)
- Update Docker build image from eclipse-temurin:22-jdk to eclipse-temurin:25-jdk
- Update GitHub Actions: build matrix [21,23] → [25], release JDK 21 → 25,
  CodeQL JDK 20 → 25

https://claude.ai/code/session_01TtqsqngTyooKccwki6rLzo
Agrona 2.x uses jdk.internal.misc.Unsafe internally, which requires
--add-opens java.base/jdk.internal.misc=ALL-UNNAMED at JVM startup.
ZpmInstall.generateLauncher() now injects this flag via JAVA_OPTIONS
in the generated zilla shell script.

https://claude.ai/code/session_01TtqsqngTyooKccwki6rLzo
- JaCoCo 0.8.12 → 0.8.14: official Java 25 class file (version 69) support
- maven-plugin-plugin 3.9.0 → 3.15.2: updated ASM for scanning JDK 25 class files in flyweight module
- moditect-maven-plugin 1.1.0 → 1.3.0.Final: updated ASM for adding module-info to JDK 25 JARs
- maven-surefire-plugin 3.0.0-M5 → 3.5.5: current stable release
- maven-failsafe-plugin 3.0.0-M4 → 3.5.5: current stable release
- mockito 5.14.1 → 5.20.0: ByteBuddy 1.15.3 → 1.17.7 for JDK 25 mock subclass generation

https://claude.ai/code/session_01TtqsqngTyooKccwki6rLzo
Agrona 2.x changed its Automatic-Module-Name from org.agrona.core to
org.agrona, causing module resolution failures at runtime.

https://claude.ai/code/session_01TtqsqngTyooKccwki6rLzo
SLF4J 1.7.x does not define Automatic-Module-Name, so the module system
cannot resolve it as org.slf4j as required by runtime module descriptors.
SLF4J 2.x ships with a proper module-info.class using module name org.slf4j.

https://claude.ai/code/session_01TtqsqngTyooKccwki6rLzo
Agrona 1.x pulled in SLF4J as a transitive dependency, so requires
org.slf4j in the module-info was satisfied implicitly. Agrona 2.x
removed its SLF4J dependency, and none of the three modules (engine,
guard-jwt, model-avro) use SLF4J in their own source, so the requires
declaration is incorrect and causes boot layer initialization failure.

https://claude.ai/code/session_01TtqsqngTyooKccwki6rLzo
…JDK 25

Agrona 2.x is a named JPMS module (org.agrona), so --add-opens with
ALL-UNNAMED no longer covers it. Add an explicit --add-opens target for
org.agrona in surefire, failsafe, and the generated zilla launcher script.

JDK 25 blocks dynamic Java agent loading without -XX:+EnableDynamicAgentLoading,
causing Byteman's BMUnitRunner to abort with StoppedByUserException. Add the
flag to the failsafe argLine to allow Byteman agent attachment in ITs.

https://claude.ai/code/session_01TtqsqngTyooKccwki6rLzo
… mode

Surefire 3.5.5 / Failsafe 3.5.5 detect the moditect-generated module-info
in the packaged JAR and automatically switch tests to modular (module-path)
execution. In modular mode ServiceLoader only consults module-info.java,
ignoring META-INF/services. The engine tests register their test SPI
implementations (e.g. BindingFactorySpi for 'test' binding type) exclusively
via META-INF/services, so they go missing and config validation fails.

Moditect module-info is intentionally for the runtime deployment only;
tests must continue to run in non-modular (classpath) mode.

https://claude.ai/code/session_01TtqsqngTyooKccwki6rLzo
The --add-opens java.base/jdk.internal.misc=org.agrona and
-XX:+EnableDynamicAgentLoading flags were added when surefire/failsafe
3.5.5 was running tests in modular mode. With surefire/failsafe reverted
to 3.0.0-M5/M4 (classpath mode), these flags are no longer applicable
to the test JVM. The --add-opens java.base/jdk.internal.misc=ALL-UNNAMED
flag covering the unnamed module remains.

https://claude.ai/code/session_01TtqsqngTyooKccwki6rLzo
The k3po-maven-plugin runs its driver (RobotServer + ZillaEngine extension)
in-process inside the Maven JVM. Agrona 2.x's UnsafeBuffer accesses
jdk.internal.misc.Unsafe at class-init time, which requires the package
to be opened. This flag has no effect on the forked test JVM (covered by
the failsafe argLine) but is required for the Maven JVM itself.

https://claude.ai/code/session_01TtqsqngTyooKccwki6rLzo
…nes for JDK 25

Mirrors the flag already added to .mvn/jvm.config for the Maven JVM,
ensuring forked test JVMs also allow native access required by JDK 25.

https://claude.ai/code/session_01TtqsqngTyooKccwki6rLzo
…tors

jose4j (embedded in guard-jwt) uses SLF4J for logging in AlgorithmFactoryFactory.
Apache Avro (shaded into model-avro) also uses SLF4J.
These requires declarations were incorrectly removed; restoring them.

https://claude.ai/code/session_01TtqsqngTyooKccwki6rLzo
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