You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Assign automatic module names to core Maven components #11642
Various Maven core artifacts are consumed by downstream projects (e.g. Quarkus). These downstream projects may be employing the Java platform's module system (colloquially known as JPMS). The lack of established automatic module names for Maven core components may cause some difficulty for these projects.
Each published artifact should include an automatic module name in its manifest. The automatic module name for each artifact should ideally be derived from the top-level package name of the classes within it.
This change should not impact compatibility in any meaningful way. It would be great to get this in 3.x as well as 4.x.
I performed a comprehensive analysis of the Maven 4 codebase to understand what it would take to assign Automatic-Module-Name entries (and eventually full module-info.java descriptors) to all published Maven artifacts. Here are the findings.
Current State
No module-info.java files exist anywhere in the Maven 4 codebase
No Automatic-Module-Name manifest entries are configured in any module
Maven 4 does have infrastructure to detect and handle JPMS in user projects (PathModularization, DependencyResolverResult), but its own JARs are not modularized
Module Inventory
Layer
Modules
Published JARs
API
11
11
Impl
10
9 (maven-support has no source)
Compat
14
14
Total
35
34
Proposed Automatic Module Names
API Modules (clean — no package overlaps among themselves)
ArtifactId
Proposed Module Name
Top-level Package
maven-api-annotations
org.apache.maven.api.annotations
org.apache.maven.api.annotations
maven-api-xml
org.apache.maven.api.xml
org.apache.maven.api.xml
maven-api-model
org.apache.maven.api.model
org.apache.maven.api.model
maven-api-settings
org.apache.maven.api.settings
org.apache.maven.api.settings
maven-api-toolchain
org.apache.maven.api.toolchain
org.apache.maven.api.toolchain
maven-api-metadata
org.apache.maven.api.metadata
org.apache.maven.api.metadata
maven-api-plugin
org.apache.maven.api.plugin.descriptor
org.apache.maven.api.plugin.descriptor
maven-api-di
org.apache.maven.api.di
org.apache.maven.api.di
maven-api-core
org.apache.maven.api
org.apache.maven.api
maven-api-spi
org.apache.maven.api.spi
org.apache.maven.api.spi
maven-api-cli
org.apache.maven.api.cli
org.apache.maven.api.cli
Impl Modules
ArtifactId
Proposed Module Name
Top-level Package
maven-di
org.apache.maven.di
org.apache.maven.di
maven-xml
org.apache.maven.internal.xml
org.apache.maven.internal.xml
maven-jline
org.apache.maven.jline
org.apache.maven.jline
maven-logging
org.apache.maven.logging
org.apache.maven.logging.api
maven-impl
org.apache.maven.impl
org.apache.maven.impl
maven-core
org.apache.maven.core
org.apache.maven (many sub-packages)
maven-cli
org.apache.maven.cling
org.apache.maven.cling
maven-executor
org.apache.maven.executor
org.apache.maven.cling.executor
maven-testing
org.apache.maven.testing
org.apache.maven.api.di.testing
Compat Modules (problematic — see below)
ArtifactId
Proposed Module Name
Notes
maven-artifact
org.apache.maven.artifact
Split packages with maven-compat
maven-model
org.apache.maven.model.compat
Split with maven-model-builder
maven-plugin-api
org.apache.maven.plugin.api
Split with maven-compat
maven-settings
org.apache.maven.settings.compat
Split with maven-compat
maven-builder-support
org.apache.maven.building
Clean
maven-repository-metadata
org.apache.maven.repository.metadata.compat
Split with maven-compat
maven-model-builder
org.apache.maven.model.builder
Split with maven-model
maven-settings-builder
org.apache.maven.settings.builder
Clean
maven-toolchain-model
org.apache.maven.toolchain.model.compat
Clean
maven-toolchain-builder
org.apache.maven.toolchain.builder
Clean
maven-resolver-provider
org.apache.maven.repository.internal
Clean
maven-compat
org.apache.maven.compat
Heavily split
maven-embedder
org.apache.maven.embedder
Clean
Critical Issue: Split Packages
JPMS forbids two named modules from exporting the same package. The analysis found 21 split packages across Maven modules. These fall into three categories:
1. API ↔ Impl splits (1 split)
Package
Modules
org.apache.maven.api.cli
maven-api-cli + maven-executor
Fix: Move Executor, ExecutorException, ExecutorRequest from maven-executor to maven-api-cli, or relocate them to a distinct package like org.apache.maven.executor.
2. Impl ↔ Compat splits (13 splits)
maven-core shares 13 packages with various compat modules:
Package
Compat Module(s)
org.apache.maven
maven-compat
org.apache.maven.artifact
maven-artifact, maven-compat
org.apache.maven.artifact.handler
maven-artifact
org.apache.maven.artifact.repository
maven-artifact, maven-compat
org.apache.maven.artifact.repository.layout
maven-artifact, maven-compat
org.apache.maven.artifact.resolver.filter
maven-artifact, maven-compat
org.apache.maven.execution
maven-compat
org.apache.maven.model.plugin
maven-model-builder
org.apache.maven.plugin
maven-compat, maven-plugin-api
org.apache.maven.plugin.internal
maven-compat
org.apache.maven.project
maven-compat
org.apache.maven.project.artifact
maven-compat
org.apache.maven.settings
maven-compat, maven-settings
3. Compat ↔ Compat splits (13 splits)
Multiple compat modules share packages among themselves (e.g., maven-artifact and maven-compat share 8 packages, maven-model and maven-model-builder share org.apache.maven.model.merge).
4. API namespace in impl layer
impl/maven-impl contains 23 classes in org.apache.maven.api.services.model — a package using the API namespace convention but living in the implementation layer. This would need to be relocated or promoted to an API module.
Recommended Approach
Phase 1: Add Automatic-Module-Name to API modules (low risk, high value)
The 11 API modules have zero package overlaps among themselves and form a clean module graph. Adding Automatic-Module-Name to these is safe and immediately unblocks downstream projects like Quarkus:
These are the modules that downstream projects actually depend on, so this covers the primary use case from the issue.
Phase 2: Add Automatic-Module-Name to clean impl modules (low risk)
Modules like maven-di, maven-xml, maven-jline, maven-logging, and maven-impl have no package overlaps and can safely receive automatic module names.
Phase 3: Fix split packages in impl layer (medium effort)
Move org.apache.maven.api.cli.Executor* classes out of the API namespace in maven-executor
Relocate org.apache.maven.api.services.model classes in maven-impl to org.apache.maven.impl.model.spi or similar
Address the maven-core splits with compat modules by relocating compat-side classes to distinct packages where feasible
Phase 4: Compat layer (hard, possibly deferred)
The compat modules have extensive split packages by design — they preserve the Maven 3 module/package structure where the same package was spread across multiple JARs. Options:
Do not modularize compat modules — they remain on the classpath as unnamed modules. This is pragmatic since they are deprecated.
Merge split compat modules into fewer JARs to eliminate splits (breaking change for anyone depending on individual compat JARs).
Relocate classes to eliminate splits (breaking change for direct class references).
Option 1 is recommended: compat modules should stay classpath-only, and downstream projects should migrate to the Maven 4 API.
Phase 5: Full module-info.java (future)
Once automatic module names are stable, full module descriptors can be added incrementally, starting with the leaf API modules (maven-api-annotations, maven-api-xml) and working up the dependency graph.
Summary
Phase
Scope
Risk
Modules
1
API Automatic-Module-Name
Low
11 modules
2
Clean impl Automatic-Module-Name
Low
5 modules
3
Fix impl split packages
Medium
3 modules (executor, impl, core)
4
Compat layer decision
High
14 modules (recommend: leave classpath-only)
5
Full module-info.java
High
All modules incrementally
Phase 1 alone addresses the original request and benefits downstream consumers. Phases 2-3 are incremental improvements. Phase 4 is a design decision. Phase 5 is a long-term goal.
Activity
cstamas commentedon Jan 12, 2026
@gnodet @desruisseaux
I know we have some overlapping packages (in Maven 3), unsure what is the state in Maven 4 (my fear, same IF those are in some compat modules)...
gnodet commentedon Apr 10, 2026
Analysis: Making Maven 4 truly modular (JPMS)
Claude Code on behalf of Guillaume Nodet
I performed a comprehensive analysis of the Maven 4 codebase to understand what it would take to assign
Automatic-Module-Nameentries (and eventually fullmodule-info.javadescriptors) to all published Maven artifacts. Here are the findings.Current State
module-info.javafiles exist anywhere in the Maven 4 codebaseAutomatic-Module-Namemanifest entries are configured in any modulePathModularization,DependencyResolverResult), but its own JARs are not modularizedModule Inventory
Proposed Automatic Module Names
API Modules (clean — no package overlaps among themselves)
org.apache.maven.api.annotationsorg.apache.maven.api.annotationsorg.apache.maven.api.xmlorg.apache.maven.api.xmlorg.apache.maven.api.modelorg.apache.maven.api.modelorg.apache.maven.api.settingsorg.apache.maven.api.settingsorg.apache.maven.api.toolchainorg.apache.maven.api.toolchainorg.apache.maven.api.metadataorg.apache.maven.api.metadataorg.apache.maven.api.plugin.descriptororg.apache.maven.api.plugin.descriptororg.apache.maven.api.diorg.apache.maven.api.diorg.apache.maven.apiorg.apache.maven.apiorg.apache.maven.api.spiorg.apache.maven.api.spiorg.apache.maven.api.cliorg.apache.maven.api.cliImpl Modules
org.apache.maven.diorg.apache.maven.diorg.apache.maven.internal.xmlorg.apache.maven.internal.xmlorg.apache.maven.jlineorg.apache.maven.jlineorg.apache.maven.loggingorg.apache.maven.logging.apiorg.apache.maven.implorg.apache.maven.implorg.apache.maven.coreorg.apache.maven(many sub-packages)org.apache.maven.clingorg.apache.maven.clingorg.apache.maven.executororg.apache.maven.cling.executororg.apache.maven.testingorg.apache.maven.api.di.testingCompat Modules (problematic — see below)
org.apache.maven.artifactorg.apache.maven.model.compatorg.apache.maven.plugin.apiorg.apache.maven.settings.compatorg.apache.maven.buildingorg.apache.maven.repository.metadata.compatorg.apache.maven.model.builderorg.apache.maven.settings.builderorg.apache.maven.toolchain.model.compatorg.apache.maven.toolchain.builderorg.apache.maven.repository.internalorg.apache.maven.compatorg.apache.maven.embedderCritical Issue: Split Packages
JPMS forbids two named modules from exporting the same package. The analysis found 21 split packages across Maven modules. These fall into three categories:
1. API ↔ Impl splits (1 split)
org.apache.maven.api.climaven-api-cli+maven-executorFix: Move
Executor,ExecutorException,ExecutorRequestfrommaven-executortomaven-api-cli, or relocate them to a distinct package likeorg.apache.maven.executor.2. Impl ↔ Compat splits (13 splits)
maven-coreshares 13 packages with various compat modules:org.apache.mavenorg.apache.maven.artifactorg.apache.maven.artifact.handlerorg.apache.maven.artifact.repositoryorg.apache.maven.artifact.repository.layoutorg.apache.maven.artifact.resolver.filterorg.apache.maven.executionorg.apache.maven.model.pluginorg.apache.maven.pluginorg.apache.maven.plugin.internalorg.apache.maven.projectorg.apache.maven.project.artifactorg.apache.maven.settings3. Compat ↔ Compat splits (13 splits)
Multiple compat modules share packages among themselves (e.g.,
maven-artifactandmaven-compatshare 8 packages,maven-modelandmaven-model-buildershareorg.apache.maven.model.merge).4. API namespace in impl layer
impl/maven-implcontains 23 classes inorg.apache.maven.api.services.model— a package using the API namespace convention but living in the implementation layer. This would need to be relocated or promoted to an API module.Recommended Approach
Phase 1: Add
Automatic-Module-Nameto API modules (low risk, high value)The 11 API modules have zero package overlaps among themselves and form a clean module graph. Adding
Automatic-Module-Nameto these is safe and immediately unblocks downstream projects like Quarkus:These are the modules that downstream projects actually depend on, so this covers the primary use case from the issue.
Phase 2: Add
Automatic-Module-Nameto clean impl modules (low risk)Modules like
maven-di,maven-xml,maven-jline,maven-logging, andmaven-implhave no package overlaps and can safely receive automatic module names.Phase 3: Fix split packages in impl layer (medium effort)
org.apache.maven.api.cli.Executor*classes out of the API namespace inmaven-executororg.apache.maven.api.services.modelclasses inmaven-impltoorg.apache.maven.impl.model.spior similarmaven-coresplits with compat modules by relocating compat-side classes to distinct packages where feasiblePhase 4: Compat layer (hard, possibly deferred)
The compat modules have extensive split packages by design — they preserve the Maven 3 module/package structure where the same package was spread across multiple JARs. Options:
Option 1 is recommended: compat modules should stay classpath-only, and downstream projects should migrate to the Maven 4 API.
Phase 5: Full
module-info.java(future)Once automatic module names are stable, full module descriptors can be added incrementally, starting with the leaf API modules (
maven-api-annotations,maven-api-xml) and working up the dependency graph.Summary
Automatic-Module-NameAutomatic-Module-Namemodule-info.javaPhase 1 alone addresses the original request and benefits downstream consumers. Phases 2-3 are incremental improvements. Phase 4 is a design decision. Phase 5 is a long-term goal.
cstamas commentedon Apr 10, 2026
3.10.x #11921
cstamas commentedon Apr 14, 2026
This issue should be pulled out from 3.10.0 milestone, as we have maven 3.10.x and 4.0.x stuff here.
cstamas commentedon Apr 21, 2026
We need to leave this issue "floating" as 3.10.x changes are done, but we need same for 4.0.x and master.
[MNG-11642] Add JPMS module support to Maven 4