Skip to content

build: Java 17 variant of common, spec and sdk for 2.0.7 (2.0.7-a8c.1) - #119

Draft
joaopamaral wants to merge 3 commits into
release-2.0.7from
release-2.0.7-java17
Draft

joaopamaral wants to merge 3 commits into
release-2.0.7from
release-2.0.7-java17

Conversation

@joaopamaral

Copy link
Copy Markdown

Summary

Build branch for the Java 17 variant of the OpenMetadata 2.0.7 Java artifacts (common, openmetadata-spec, openmetadata-sdk), for consumers that still compile and run on JDK 17. No functional change.

Stock 2.0.7 openmetadata-spec and common are compiled for Java 21 (class file 65), unlike 1.12.x where the spec was Java 17. A Java 17 SDK alone is therefore no longer enough: javac 17 rejects the spec classes (class file has wrong version 65.0, should be 61.0). This branch builds the whole chain for Java 17 under one version so the SDK POM references a matching spec and common.

Commits

  • build(sdk): target Java 17 and fix: make openmetadata-sdk tests pass on Java 17 (carried from the 1.12 branch).
  • build: version 2.0.7-a8c.1 and compile common/spec for Java 17: mvn versions:set -DnewVersion=2.0.7-a8c.1, root and spec maven-compiler-plugin source/target 17, and ArrayAlignment.collectRun uses Collections.reverse instead of List.reversed() (Java 21 SequencedCollection).

Build

JAVA_HOME=<jdk17> mvn -B -pl common,openmetadata-spec,openmetadata-sdk -DskipTests -Dmaven.javadoc.skip=true clean package

Publish the three JARs with their POMs plus the parent platform POM (packaging pom), since every module POM references org.open-metadata:platform:2.0.7-a8c.1.

Test plan

  • common, openmetadata-spec, openmetadata-sdk build on Temurin 17.0.14; all class files are version 61
  • A JDK 17 consumer compiles against the published spec + sdk

joaopamaral and others added 3 commits November 9, 2026 15:15
Two unrelated blockers prevented the SDK module from being usable on
Java 17 against the 1.12.6-release tag:

1. JUnit / Surefire version mismatch — sdk pom pinned junit
   5.9.3 / junit-platform 1.9.3 locally, while parent (and the
   maven-surefire-plugin shipped launcher) expected 5.11.4 / 1.11.4.
   Test discovery failed with:
     JUnitException: ... resolution failed:
     'boolean ReflectionUtils.returnsVoid(java.lang.reflect.Method)'
   because returnsVoid was added in junit-platform-commons 1.10+.
   Bump sdk pom to junit 5.11.4 / platform 1.11.4 to align with parent
   and the running surefire plugin.

2. Java 21-only API in test code — DomainMockTest.testRetrieveDomainWithChildren
   used List#getFirst() (added in JDK 21 via SequencedCollection).
   That blocked test compilation on Java 17 even with -release=17.
   Replace with get(0).

After both fixes: 195/195 tests pass on Java 17 with
-Dmaven.compiler.release=17 (and continue to pass on Java 21).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
(cherry picked from commit 563a999)
(cherry picked from commit 585dbf0)
The stock 2.0.7 common and openmetadata-spec jars are compiled for Java 21 (class file 65), so a Java 17 consumer cannot use them even with a Java 17 SDK. Build the whole chain (common, spec, sdk) for Java 17 under one version so the published SDK POM references the matching spec/common artifacts. ArrayAlignment used List.reversed() (Java 21 SequencedCollection); replaced with Collections.reverse().

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

This branch has not been deployed

No deployments
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.

1 participant