[MNG-11642] Add JPMS module support to Maven 4#12135
Draft
gnodet wants to merge 2 commits into
Draft
Conversation
Add explicit module-info.java to 17 modules (11 API, 6 impl) and Automatic-Module-Name manifest entries to all 34 remaining modules. API modules get full module descriptors with proper requires transitive, exports, uses, and provides directives. Impl modules that don't depend on compat (split-package) modules also get module-info.java. The remaining modules (maven-core, maven-cli, maven-executor, maven-testing, and all 13 compat modules) get Automatic-Module-Name only, since split packages between compat modules prevent them from becoming named modules. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Configure annotationProcessorPaths for maven-impl, maven-di, and maven-jline to ensure the DiIndexProcessor runs during modular compilation and generates META-INF/maven/org.apache.maven.api.di.Inject. Default @nullable collection parameters to empty collections in DefaultModelProcessor and DefaultModelBuilder to prevent NPE when no implementations are available. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
module-info.javato 17 modules (11 API + 6 impl) with properrequires,exports,uses, andprovidesdirectivesAutomatic-Module-Namemanifest entries to all 17 remaining modules (4 impl + 13 compat) viamaven-jar-pluginconfiguration in root POMDetails
Modules with
module-info.java(17)API modules (11):
maven-api-annotations,maven-api-di,maven-api-xml,maven-api-metadata,maven-api-model,maven-api-settings,maven-api-toolchain,maven-api-plugin,maven-api-core,maven-api-spi,maven-api-cliImpl modules (6):
maven-di,maven-xml,maven-support,maven-impl(open module),maven-jline,maven-loggingModules with
Automatic-Module-Nameonly (17)Impl (4):
maven-core,maven-cli,maven-executor,maven-testing— cannot usemodule-info.javadue to split packages with compat modules or complex DI/compat dependenciesCompat (13): All compat modules — split packages among themselves prevent named module status
Notable decisions
maven-implis anopen modulebecause Maven's DI framework needs reflective access to instantiate componentsmaven-cliwas originally planned formodule-info.javabut was downgraded toAutomatic-Module-Namedue to split packages between compat modules it depends on (e.g.,org.apache.maven.settingsin bothmaven-settingsandmaven-core)maven-api-modeldeclaresuses ModelObjectProcessorfor ServiceLoader supportmaven-impldeclaresuses RootDetectorfor ServiceLoader supportmaven-implsurefire configured withuseModulePath=falseto preserve existing test behaviorTest plan
mvn verify -B -DskipTests— all 34 modules compile successfullymvn verify -B— all tests pass except pre-existing failures unrelated to this PR (Mimir daemon tests in maven-cli/maven-executor, DI binding tests in maven-impl that also fail on master)jar --describe-moduleshows correct module descriptors for all 17 module-info modulesAutomatic-Module-Namemanifest entries present in all 17 remaining module JARs🤖 Generated with Claude Code