Add module-info.java for JPMS support using multi-release JAR#90
Merged
slachiewicz merged 6 commits intomasterfrom Nov 3, 2025
Merged
Add module-info.java for JPMS support using multi-release JAR#90slachiewicz merged 6 commits intomasterfrom
slachiewicz merged 6 commits intomasterfrom
Conversation
Co-authored-by: slachiewicz <[email protected]>
Co-authored-by: slachiewicz <[email protected]>
Copilot
AI
changed the title
[WIP] Add module descriptor to project
Add module-info.java for JPMS support
Nov 1, 2025
Co-authored-by: slawekjaranowski <[email protected]>
Co-authored-by: slawekjaranowski <[email protected]>
Copilot
AI
changed the title
Add module-info.java for JPMS support
Add module-info.java for JPMS support using multi-release JAR
Nov 1, 2025
src/main/java9/module-info.java
Outdated
Comment on lines
+2
to
+8
| exports org.codehaus.plexus.interpolation; | ||
| exports org.codehaus.plexus.interpolation.fixed; | ||
| exports org.codehaus.plexus.interpolation.multi; | ||
| exports org.codehaus.plexus.interpolation.object; | ||
| exports org.codehaus.plexus.interpolation.os; | ||
| exports org.codehaus.plexus.interpolation.reflection; | ||
| exports org.codehaus.plexus.interpolation.util; |
Member
There was a problem hiding this comment.
@rfscholte @slachiewicz do we need export all packages ....?
eg org.codehaus.plexus.interpolation.os look like internal one?
Member
There was a problem hiding this comment.
my hope was only org.codehaus.plexus.interpolation;
however, a quick scan through the Maven codebase:
DefaultToolchainsBuilderTest uses org.codehaus.plexus.interpolation.os.OperatingSystemUtils
PathTranslatingPostProcessor uses org.codehaus.plexus.interpolation.util.ValueSourceUtils
as long as Maven is not using the modulepath that's not an issue.
I would probably go for only org.codehaus.plexus.interpolation and investigate if there are requests for opening more packages
Removed multiple exports from the module definition.
slawekjaranowski
approved these changes
Nov 3, 2025
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adds Java Platform Module System (JPMS) support via module-info.java while maintaining Java 8 compatibility using a multi-release JAR approach.
Changes
Created
src/main/java9/module-info.java: Declares moduleorg.codehaus.plexus.interpolationwith exports for all 7 public packages (interpolation, fixed, multi, object, os, reflection, util)Updated
pom.xml: Added ajava9+Maven profile that activates on JDK 9+ using multi-release JAR (MRJAR) approach:<jdk>[9,)</jdk>compile-java9: Compiles module-info.java fromsrc/main/java9/with Java 9 and places it inMETA-INF/versions/9/maven-jar-plugin: Configured to addMulti-Release: trueto MANIFEST.MFResult: When built with JDK 9+, a multi-release JAR is created with module-info.class in
META-INF/versions/9/(bytecode version 53) and all other classes remain Java 8 (bytecode version 52). When built with JDK 8, only Java 8 classes are produced. OSGi Bundle metadata in MANIFEST.MF unchanged.Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.