You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
TEDEFO-5290 Build and target Java 21 instead of Java 11 - #8
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 Notice Viewer #127 first, following EXT #185 and ECL #74. Confirm Viewer 0.14.0-SNAPSHOT is published, update the CLI's Viewer pin, and verify the packaged CLI including visualise. SDK Analyzer is not a prerequisite for CLI.
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.
Completes the proposed Java 21 series for ECL (TEDEFO-5287), EXT (TEDEFO-5288) and ENV (TEDEFO-5289); their prerequisite PRs are linked above. The CLI was the last piece of the EFX Toolkit family still on Java 11, while its own main dependency efx-toolkit-java 2.0.0-SNAPSHOT already builds at release 21.
Changes
pom.xml: replace maven.compiler.source / maven.compiler.target (11) with maven.compiler.release (21). Unlike source/target, release also checks that no API newer than the target is referenced, so a Java 21 method cannot silently leak into a build claiming an older target. It is also the property name already used by efx-toolkit-java, so the two poms stay consistent.
README.md: the requirements section now states Java 21 or later.
No source changes were needed: all 22 main sources and 2 test sources compile unchanged. maven-compiler-plugin was already pinned (3.13.0), and this repository has no CI workflows, so the scope is narrower than TEDEFO-5288.
Tested
mvn clean package passes on Temurin 21.0.12.1 with Maven 3.8.8, the compiler reporting release 21 for both source sets, no warnings.
The shaded uber-jar builds and runs: --version and --help both work, and all six commands are present (translate-rules, validate, visualise, extract-dependencies, config, clear).
Emitted bytecode confirmed at class-file major version 65.
Test suite: 11 tests, 7 pass, 4 fail.
Pre-existing test failures, not caused by this change
All 4 failures are ValidateCommandTest.testFullPipeline and share one root cause: the test requests eForms SDK 2.0.0-SNAPSHOT at sdk-path=eforms-sdk, which is neither resolvable from the repository nor present on disk. The run reports SDK download failed (No artifacts found for SDK 2.0.0-SNAPSHOT.) followed by Failed to instantiate Symbol Resolver, so EFX translation never happens.
Re-running the same suite with -Dmaven.compiler.release=11 reproduces the identical 4 failures in the identical scenarios, which confirms they predate this change.
The 7 passing tests do cover the runtime stack on Java 21: ValidateCommandTest.testValidation uses --schematron to bypass EFX translation, needs no SDK, and passes in both schxslt and phpure modes, exercising Saxon-HE 11.3, SchXSLT and ph-schematron-pure end to end.
Notes for the reviewer
Breaking change, but milder than for ECL and EXT: the CLI ships as an executable shaded uber-jar rather than a consumed library, so the impact lands on the JRE users launch it with, not on a downstream compile-time dependency chain.
The visualise path (freemarker, JCS cache) has no test coverage, so it is verified as compiling only, not as running on 21.
CHANGELOG.md is deliberately untouched here: it currently documents only 0.1.0, so the new runtime requirement belongs in the 0.2.0 release notes.
Out of scope: adding maven-enforcer-pluginrequireJavaVersion [21,) so a developer on an older JDK gets a clear message instead of invalid target release: 21; and the README usage examples still referencing efx-cli-0.1.0.jar while the pom is at 0.2.0-SNAPSHOT.
The Java 21 compiler change looks sound. Please keep the CLI at 0.2.0-SNAPSHOT and complete the following adjustments for the coordinated migration:
Align the Notice Viewer dependency. The CLI currently pins eforms-notice-viewer:0.13.0-SNAPSHOT, while TEDEFO-5289: Build and target Java 21 instead of Java 11 eforms-notice-viewer#127 targets 0.14.0-SNAPSHOT. Once that aligned snapshot is available, update the CLI dependency to 0.14.0-SNAPSHOT so the packaged CLI includes the Viewer migration. Consuming the older Java 11 Viewer on Java 21 is not itself a bytecode error; this adjustment is needed to include the intended migration across the dependency chain.
Record the runtime boundary and reconcile installation instructions. State in the README and the 0.2.0 changelog/release notes that “EFX CLI 0.2.0 and later require Java 21 or later.” The open installation-guide PR Added INSTALLATION.md #7 currently says JDK 17+ in both its prerequisites and version-check example; coordinate an update to Java 21 so the merged instructions agree.
Rerun verification with the final dependency set and smoke-test visualisation. Run mvn clean verify, check the shaded JAR's --help and --version, and run visualise with a known notice/SDK to verify the Viewer path on Java 21. Record the exact dependency versions and results in this PR. Also revise the description's “already done” wording: the related ECL, EXT and Viewer Java 21 PRs are still open.
Review evidence at head d97ac52: the CLI compiled at release 21 and mvn verify passed all 11 tests, including all four full-pipeline cases, against locally built Java 21 ECL 2 and EXT 2 aligned to it. Shaded-JAR packaging, --help and --version also passed. No CLI source edits were needed. This run retained the CLI's existing Viewer 0.13.0-SNAPSHOT; it does not validate Viewer PR #127 or the visualise command. The four failures described in the PR were therefore not reproduced in this environment; please rerun and update the test section rather than treating them as an unavoidable baseline.
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
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.
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.
0.14.0-SNAPSHOTis published, update the CLI's Viewer pin, and verify the packaged CLI includingvisualise. SDK Analyzer is not a prerequisite for CLI.MDM currently targets Java 11 and already consumes EXT
2.0.0-SNAPSHOT, Analyzer1.16.0-SNAPSHOTand Notice Viewer0.14.0-SNAPSHOT. Avoid publishing Java 21 replacements for those active coordinates before MDM is ready. ECL uses the new2.0.0-SNAPSHOTcoordinate; 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.
Jira: TEDEFO-5290
Completes the proposed Java 21 series for ECL (TEDEFO-5287), EXT (TEDEFO-5288) and ENV (TEDEFO-5289); their prerequisite PRs are linked above. The CLI was the last piece of the EFX Toolkit family still on Java 11, while its own main dependency
efx-toolkit-java2.0.0-SNAPSHOT already builds atrelease 21.Changes
pom.xml: replacemaven.compiler.source/maven.compiler.target(11) withmaven.compiler.release(21). Unlikesource/target,releasealso checks that no API newer than the target is referenced, so a Java 21 method cannot silently leak into a build claiming an older target. It is also the property name already used byefx-toolkit-java, so the two poms stay consistent.README.md: the requirements section now states Java 21 or later.No source changes were needed: all 22 main sources and 2 test sources compile unchanged.
maven-compiler-pluginwas already pinned (3.13.0), and this repository has no CI workflows, so the scope is narrower than TEDEFO-5288.Tested
mvn clean packagepasses on Temurin 21.0.12.1 with Maven 3.8.8, the compiler reportingrelease 21for both source sets, no warnings.--versionand--helpboth work, and all six commands are present (translate-rules,validate,visualise,extract-dependencies,config,clear).Pre-existing test failures, not caused by this change
All 4 failures are
ValidateCommandTest.testFullPipelineand share one root cause: the test requests eForms SDK2.0.0-SNAPSHOTatsdk-path=eforms-sdk, which is neither resolvable from the repository nor present on disk. The run reportsSDK download failed (No artifacts found for SDK 2.0.0-SNAPSHOT.)followed byFailed to instantiate Symbol Resolver, so EFX translation never happens.Re-running the same suite with
-Dmaven.compiler.release=11reproduces the identical 4 failures in the identical scenarios, which confirms they predate this change.The 7 passing tests do cover the runtime stack on Java 21:
ValidateCommandTest.testValidationuses--schematronto bypass EFX translation, needs no SDK, and passes in bothschxsltandphpuremodes, exercising Saxon-HE 11.3, SchXSLT and ph-schematron-pure end to end.Notes for the reviewer
visualisepath (freemarker, JCS cache) has no test coverage, so it is verified as compiling only, not as running on 21.CHANGELOG.mdis deliberately untouched here: it currently documents only 0.1.0, so the new runtime requirement belongs in the 0.2.0 release notes.maven-enforcer-pluginrequireJavaVersion [21,)so a developer on an older JDK gets a clear message instead ofinvalid target release: 21; and the README usage examples still referencingefx-cli-0.1.0.jarwhile the pom is at0.2.0-SNAPSHOT.