Skip to content

TEDEFO-5288: Build and target Java 21 instead of Java 11 - #185

Draft
amiliosc wants to merge 2 commits into
developfrom
feature/TEDEFO-5288-java-21
Draft

amiliosc wants to merge 2 commits into
developfrom
feature/TEDEFO-5288-java-21

Conversation

@amiliosc

@amiliosc amiliosc commented Oct 20, 2026 •

Copy link
Copy Markdown

Merge prerequisites — on hold

Keep this PR in draft while MDM is not ready for Java 21. This is the agreed hold for the coordinated migration.

  • MDM readiness: TEDEFO-5065 — MDM migrate to Java 21. No MDM Java 21 migration MR was found as of 26 October 2026. Add its link here when opened and verify build, CI and runtime readiness before lifting the hold. MDM !1406 is already merged, but was only the preparatory step retaining Java 11.
  • Upstream PR(s): Merge ECL #74 first and confirm its 2.0.0-SNAPSHOT is published. Update this PR's ECL pin to that version and verify against it before merging.

MDM currently targets Java 11 and already consumes EXT 2.0.0-SNAPSHOT, Analyzer 1.16.0-SNAPSHOT and Notice Viewer 0.14.0-SNAPSHOT. Avoid publishing Java 21 replacements for those active coordinates before MDM is ready. ECL uses the new 2.0.0-SNAPSHOT coordinate; holding ECL too is part of the agreed rollout sequence.

After the hold is lifted: ECL → EXT → Analyzer and Notice Viewer (either order) → CLI after Notice Viewer. Wait for successful upstream snapshot publication and downstream verification between dependent merges.


Moves the EFX Toolkit from Java 11 to Java 21. Java 11 left Oracle premier support in September 2023; Java 21 is the current LTS and matches the direction already taken for ECL (TEDEFO-5287) and the MDM (TEDEFO-5065).

Changes

  • pom.xml: replaced maven.compiler.source/target (11) with maven.compiler.release (21). The release flag also verifies no API newer than the target is referenced, so a Java 21 method cannot silently leak into a build claiming an older target.
  • pom.xml: pinned maven-compiler-plugin in pluginManagement via a new version.compiler.plugin property. It was previously unpinned, so its version floated with whatever Maven version was in use.
  • Workflows (build, javadoc, publish): java-version 11 -> 21 and distribution adopt -> temurin. The adopt distribution is deprecated and publishes no Java 21 builds.
  • README.md / CHANGELOG.md: record the new requirement.

No source changes were needed - the existing main and test sources, including the ANTLR-generated parsers, compile unchanged under release 21.

Testing

Verified locally against Temurin 21.0.12:

  • mvn install - 1550/1550 tests pass, compiler reports release 21
  • javadoc:javadoc + javadoc:test-javadoc - clean (the javadoc.yml gate)
  • -Prelease verify - produces main, sources and javadoc jars
  • deploy to a local file repository - upload mechanics, checksums and metadata intact
  • Emitted bytecode is class-file major version 65; jar manifest reports Build-Jdk-Spec: 21
  • A separate downstream consumer project resolved the installed artifact, compiled at release 21 and ran the public API successfully

Breaking change

This raises the bytecode level of a published artifact, so every consumer must be on Java 21 or later. Targets EXT 2.0.0. Consumers to confirm: Notice Viewer, SDK Analyzer, MDM.

Java 21 can consume Java 11 bytecode, but this coordinated migration will adopt ECL 2.0.0-SNAPSHOT and therefore follows ECL PR #74 as linked above.

Not addressed here

Publishing is blocked for an unrelated reason: the version is 2.0.0-SNAPSHOT and depends on eforms-core 1.10.0-SNAPSHOT and eforms-sdk 1.16.0/2.0.0-SNAPSHOT. Central does not accept a release depending on snapshots, so the version and those pins need settling before a 2.0.0 deploy. Worth noting the release profile sets autoPublish=true, which pushes straight to Central with no staging gate to inspect or drop.

Replace maven.compiler.source/target (11) with maven.compiler.release
(21). The release flag also verifies that no API newer than the target
is referenced, so a Java 21 method cannot silently leak into a build
claiming an older target.

Pin maven-compiler-plugin in pluginManagement via a new
version.compiler.plugin property; it was previously unpinned and its
version floated with the Maven version in use.

Move the build, javadoc and publish workflows to java-version 21 and
distribution temurin. The adopt distribution is deprecated and
publishes no Java 21 builds.

No source changes are needed: the existing main and test sources,
including the ANTLR-generated parsers, compile unchanged under
release 21.

This raises the bytecode level of a published artifact, so consumers
must be on Java 21 or later. README and CHANGELOG record the new
requirement.
@amiliosc
amiliosc requested a review from rousso October 20, 2026 13:44

rousso commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

Reviewed commit 22b8af0. The Java 21 compiler configuration, plugin pin, three workflows, README and changelog changes look sound. EXT is already on the 2.0.0-SNAPSHOT version line.

Please coordinate the ECL dependency with the version change requested on ECL PR #74. Once the Java 21 ECL build is available as 2.0.0-SNAPSHOT, update pom.xml:

<version.eforms-core>2.0.0-SNAPSHOT</version.eforms-core>

I tested that combination locally on JDK 21 in an isolated Maven repository: ECL PR #74 at a7d0f62f60724b6f6bfa12910255d25d1157ca9b, rebuilt with only its project version changed to 2.0.0-SNAPSHOT, and this EXT commit with -Dversion.eforms-core=2.0.0-SNAPSHOT.

  • verify javadoc:javadoc javadoc:test-javadoc passed.
  • All 1,550 tests passed, with no failures or skips.
  • The test classpath confirmed the locally built ECL 2.0.0-SNAPSHOT jar was used.
  • No EXT source changes were needed.

Java 21 can consume the current Java 11 ECL, so the existing pin does not itself break this PR. The update aligns EXT with the new ECL version line. Recommended sequence: make ECL 2.0.0-SNAPSHOT available, update this dependency, and rerun CI against the published snapshot. No additional defects found in the Java 21 changes.

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