Repository navigation
fix: make jline-terminal-ffm a Multi-Release JAR to fix Java 17 boot layer failure - #2285
Conversation
…layer failure (fixes jline#2284) The module-info.class for jline-terminal-ffm was compiled at Java 22 (class file major version 66) and placed at the jar root. When the jar was on the module path in a project that compiled or ran on Java 17, the JVM failed during boot layer initialization with: Error occurred during initialization of boot layer java.lang.module.FindException: Error reading module: jline-terminal-ffm-X.Y.Z.jar Caused by: java.lang.module.InvalidModuleDescriptorException: Unsupported major.minor version 66.0 The fix converts jline-terminal-ffm into a proper Multi-Release JAR: - Move module-info.java from src/main/java/ to src/main/java22/, a separate source root compiled with multiReleaseOutput=true, placing module-info.class in META-INF/versions/22/ instead of the jar root. - Add Multi-Release: true to MANIFEST.MF via maven-jar-plugin. - Switch the surefire argLine from --enable-native-access=org.jline.terminal.ffm to --enable-native-access=ALL-UNNAMED, since without a root module-info the test JVM no longer resolves the module on the module path.
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughThe terminal-ffm Maven configuration compiles Java 22 sources as multi-release output, marks the JAR as multi-release, and changes the Surefire native-access option. ChangesFFM JAR Build
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to The supplied evidence does not identify a merge-blocking issue with the multi-release JAR change. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
gnodet-bot
left a comment
There was a problem hiding this comment.
Textbook Multi-Release JAR fix — the implementation is correct end-to-end.
What was verified:
multiReleaseOutput=true+compileSourceRootspointing tosrc/main/java22/is the correct pattern for maven-compiler-plugin 3.16.0;module-info.classwill land inMETA-INF/versions/22/as intended.- Maven plugin config inheritance: the child
<configuration>formaven-jar-pluginmerges with the parent pluginManagement entry —manifestFile(Felix bundle MANIFEST.MF) andAutomatic-Module-Nameare inherited intact;Multi-Release: trueis added on top. No OSGi headers lost. --enable-native-access=ALL-UNNAMEDis correct for surefire (classpath mode, no rootmodule-info.class→ no named module resolvable). Production consumers on the module path still load the JPMS descriptor fromMETA-INF/versions/22/. Themodule-info.javaJavadoc still correctly documents--enable-native-access=org.jline.terminal.ffmfor production use.- CI passes green across all 9 platform/JDK combinations. SonarCloud: 0 new issues.
This review was generated by an AI agent, Hermès on behalf of @gnodet.



Problem
jline-terminal-ffmhad itsmodule-info.classcompiled at Java 22 (major version 66) placed at the root of the jar. When this jar was on the module path in a project using Java 17, the JVM failed during boot layer initialization:Fix
Convert
jline-terminal-ffminto a proper Multi-Release JAR:module-info.javafromsrc/main/java/tosrc/main/java22/, a separate source root compiled with<multiReleaseOutput>true</multiReleaseOutput>, which placesmodule-info.classinMETA-INF/versions/22/instead of the jar root.Multi-Release: truetoMANIFEST.MFviamaven-jar-plugin.argLinefrom--enable-native-access=org.jline.terminal.ffmto--enable-native-access=ALL-UNNAMED, since without a rootmodule-info.classthe test JVM no longer resolves the named module on the module path (this does not affect production use — the module is resolved correctly by consumers that use JPMS).Result
jline-terminal-ffmon the module path no longer fail at boot layer initialization.META-INF/versions/22/.Fixes #2284.
Summary by CodeRabbit