Invalid Automatic-Module-Name in mcp-core#722
Open
cdivilly wants to merge 3 commits intomodelcontextprotocol:mainfrom
Open
Invalid Automatic-Module-Name in mcp-core#722cdivilly wants to merge 3 commits intomodelcontextprotocol:mainfrom
cdivilly wants to merge 3 commits intomodelcontextprotocol:mainfrom
Conversation
Author
|
More testing shows a split package issue. The package In Java modules, it is not permitted for the same package name to be used in more than one jar. |
Author
|
The
|
Author
|
I've revised this PR to address the split package issue.
|
6fb0ef4 to
a4af515
Compare
…nfiguration, as causes duplicate classes, causing split package problem across mcp-json and mcp-core.
a4af515 to
1a2fb85
Compare
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.
Fixes #560
build-helper-maven-pluginto generate a Maven property namedautomatic.module.namegenerated from${project.groupId}.${project.artifactId}, whilst ensuring the value is a syntactically valid Java Module name, by replacing any-characters with.charactersAutomatic-Module-Namein./mcp-core/pom.xmlbnd-maven-pluginconfiguration which was generating a value with an invalid value (Java Module names cannot contain the-character)./pom.xmlmaven-jar-pluginconfiguration to addAutomatic-Module-Nameproperty to the JAR manifest. Doing this here, ensures each sub-project JAR has a valid automatic module nameMotivation and Context
In versions 0.12.1 and older, the SDK consisted of a single module,
mcp. TheAutomatic-Module-Namemanifest attribute was generated by thebnd-maven-plugin. Note that the single module name does not contain any dash (-) characters.In 0.13.0 and later, the SDK was refactored into multiple modules,
mcp-core,mcp-jsonetc. Note the addition of the-character in the artifactId. The existing logic for generatingAutomatic-Module-Namewas not updated, resulting in syntactically invalid values being generated for the value, as Java module names are not allowed contain the-character:With the changes described above, this becomes:
How Has This Been Tested?
META/MANIFEST.MFin each jar is a valid Java module nameBreaking Changes
Types of changes
Checklist
Additional context
org.codehaus.mojo:build-helper-maven-pluginis added to the rootpom.xml. This purpose of this plugin is to generate and rewrite the value of${automatic.module.name}property into a syntactically valid Java module nameAutomatic-Module-Nameis moved from thebnd-maven-pluginconfiguration to themaven-jar-pluginconfiguration, so it can be uniformly applied to all sub-modules.