fix: use valid JPMS module name for mcp-core#609
Open
bjorndarri wants to merge 1 commit intomodelcontextprotocol:mainmodelcontextprotocol/java-sdk:mainfrom
bjorndarri:fix/jpms-module-namebjorndarri/java-sdk:fix/jpms-module-nameCopy head branch name to clipboard
Open
fix: use valid JPMS module name for mcp-core#609bjorndarri wants to merge 1 commit intomodelcontextprotocol:mainmodelcontextprotocol/java-sdk:mainfrom bjorndarri:fix/jpms-module-namebjorndarri/java-sdk:fix/jpms-module-nameCopy head branch name to clipboard
bjorndarri wants to merge 1 commit intomodelcontextprotocol:mainmodelcontextprotocol/java-sdk:mainfrom
bjorndarri:fix/jpms-module-namebjorndarri/java-sdk:fix/jpms-module-nameCopy head branch name to clipboard
Conversation
Changed Automatic-Module-Name from io.modelcontextprotocol.sdk.mcp-core
to io.modelcontextprotocol.sdk.mcp.core. JPMS module names must be valid
Java identifiers and cannot contain dashes. This was preventing usage in
modular Java applications.
The OSGI Bundle-SymbolicName is kept as io.modelcontextprotocol.sdk.mcp-core
(with dash) for backward compatibility, as OSGI allows dashes in symbolic names.
Note: If preferred, the Automatic-Module-Name could use BND's substitution
macro instead: ${subst;${project.groupId}.${project.artifactId};-;.}
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
Oh, nice!! If you would like to change it to that here, personally I actually think that would be much nicer... (But I'm NOT a maintainer here!) Saying this mostly because I have a hunch that this |
Author
|
I agree. I would personally be fine with this PR being dropped and this automatic module name handling being added to all modules, using substitution, with |
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
Fixes #560
Automatic-Module-Nameinmcp-core/pom.xmlto use a valid JPMS module nameio.modelcontextprotocol.sdk.mcp-core(invalid - contains dash) toio.modelcontextprotocol.sdk.mcp.coreBundle-SymbolicNamekept asio.modelcontextprotocol.sdk.mcp-corefor backward compatibilityProblem
JPMS module names must be valid Java identifiers and cannot contain dashes. The previous automatic module name
io.modelcontextprotocol.sdk.mcp-coreprevented usage in modular Java applications.Solution
Hard-coded the
Automatic-Module-Nametoio.modelcontextprotocol.sdk.mcp.core.Alternative: Could use BND's substitution macro
${subst;${project.groupId}.${project.artifactId};-;.}if dynamic generation is preferred by maintainers.Compatibility
OSGI's
Bundle-SymbolicNameremains unchanged with the dash (mcp-core) as OSGI allows dashes in symbolic names. Having different names for JPMS and OSGI is acceptable and common.Test plan
mcp-coremodule successfullyAutomatic-Module-Name: io.modelcontextprotocol.sdk.mcp.coreBundle-SymbolicNameremainsio.modelcontextprotocol.sdk.mcp-core🤖 Generated with Claude Code