That is a fair and technically valid perspective, especially if the goal is to be as "invisible" as possible. Here is the revised summary for your group, reflecting the decision to omit the serialVersionUID to allow the runtime environment to take full control.
Technical Summary: The "Transparent Stub" Strategy for etsf Java 21 Migration
Context & Discovery
Analysis of the etsf.jar manifest (built with Ant 1.6.5) and current application implementations like coes-nam reveals that ValidationContext and ValidationResult are not fixed library dependencies. Instead, they function as Shared Contracts—re-implemented by different applications to suit their specific business logic.
The Legacy "Provided" Pattern
Historically, this was handled by using Compile-Only Stubs. The etsf library was compiled against "shell" classes to establish the type hierarchy (extending WorkflowContext and WorkflowResult), but these shells were never distributed within the final JAR.
The Java 21 Migration Path: Transparent Stubs
To move etsf into our Java 21 pipeline (Harness/Tekton) while maintaining this flexibility, we will use a Transparent Stub approach:
- Minimal Interface Mapping: We will create stubs that define only the necessary class names and parent-child relationships required for a successful Java 21 build.
-
Intentional Omission of `serialVersionUID
: We will **NOT** explicitly define aserialVersionUID` in our stubs. This ensures the stub remains a "blank slate." -
Runtime Authority: By omitting the version ID and using the
compileOnlyscope, we ensure the JVM ignores our build-time stubs entirely at runtime. The serial versioning will be determined solely by the actual implementation provided by the consuming application (e.g., the version indna.jaror the app's internal classes). -
Zero Classpath Friction: This approach prevents
InvalidClassExceptionerrors that could occur if our hardcoded ID conflicted with an application’s auto-generated or differently-defined ID.
Why This Is Convincing
-
Maximum Adaptability: The
etsf.jarbecomes truly "implementation-agnostic." It can be used by any application regardless of how that app has implemented thevalenginepackage. -
Modern Standard: Using Gradle’s
compileOnlysource sets brings the 2007-era "Ant trick" into a modern, supported DevOps workflow for Java 21. - Risk Reduction: It avoids the "split-brain" problem where a library tries to force its own versioning onto a host application.
Recommendation: Proceed with Transparent Stubs (no logic, no version IDs) in a separate Gradle source set to unblock the build while deferring all runtime authority to the existing legacy ecosystem.
Top comments (0)