From f967986ace9e4914e5c1e6e36e8383321f1cd41a Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 23 Oct 2026 20:12:34 +0000 Subject: [PATCH] Compile the pre-26 NMS modules with JDK 21 through a toolchain The first semver release of Codex failed in codex-nms-v1_20_1: spigot-1.20.1-R0.1-SNAPSHOT.jar(.../WorldServer.class): error: Cannot attach type annotations @javax.annotation.Nullable to WorldServer.a: class file for com.mojang.datafixers.util.Pair not found Since JDK 22, javac reads type annotations from the jars it compiles against, so it needs classes those annotations reference. On the CI runner datafixerupper wasn't on the module's classpath. The build runs on JDK 25 because the main modules need WorldEdit's Java 25 classes, but only the 26.x NMS modules need 25 themselves. codex-nms now selects the compiler JDK with jdkToolchain ${nms.jdk}, defaulting to 21, and the 26.2/26.3 modules set it to 25. The shared release workflow writes a toolchains.xml for both JDKs. Without one, as in a local build, the compiler falls back to the JDK Maven runs on. Reproduced the CI error locally (JDK 25, no datafixerupper on the classpath) and confirmed the 21 toolchain compiles that module. 26.3 compiles with the 25 toolchain. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Secz6aiBJ7U8im8tnYhyLA --- codex-nms/codex-nms-v26_2/pom.xml | 1 + codex-nms/codex-nms-v26_3/pom.xml | 1 + codex-nms/pom.xml | 23 +++++++++++++++++++++++ 3 files changed, 25 insertions(+) diff --git a/codex-nms/codex-nms-v26_2/pom.xml b/codex-nms/codex-nms-v26_2/pom.xml index 307bf0e7..f25ad681 100644 --- a/codex-nms/codex-nms-v26_2/pom.xml +++ b/codex-nms/codex-nms-v26_2/pom.xml @@ -16,6 +16,7 @@ 21 + 25 diff --git a/codex-nms/codex-nms-v26_3/pom.xml b/codex-nms/codex-nms-v26_3/pom.xml index 4c384d09..80ed0823 100644 --- a/codex-nms/codex-nms-v26_3/pom.xml +++ b/codex-nms/codex-nms-v26_3/pom.xml @@ -16,6 +16,7 @@ 21 + 25 diff --git a/codex-nms/pom.xml b/codex-nms/pom.xml index 70c6e6a2..3ef46d60 100644 --- a/codex-nms/pom.xml +++ b/codex-nms/pom.xml @@ -27,6 +27,15 @@ CodexNMS A collection of NMS libraries for Codex + + + 21 + + codex-nms-v1_16_5 codex-nms-v1_17_1 @@ -56,6 +65,20 @@ + + + + org.apache.maven.plugins + maven-compiler-plugin + + + ${nms.jdk} + + + + + + MIT License