Skip to content

Commit d846f3a

Browse files
committed
Fix Automatic-Module-Name without hypens
Signed-off-by: Daniel Garnier-Moiroux <git@garnier.wf>
1 parent 4186ca1 commit d846f3a

10 files changed

Lines changed: 76 additions & 3 deletions

File tree

‎conformance-tests/client-jdk-http-client/pom.xml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
</scm>
2222

2323
<properties>
24+
<module.name>io.modelcontextprotocol.sdk.conformance.client.jdk</module.name>
2425
<maven.deploy.skip>true</maven.deploy.skip>
2526
</properties>
2627

‎conformance-tests/client-spring-http-client/pom.xml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
</scm>
2222

2323
<properties>
24+
<module.name>io.modelcontextprotocol.sdk.conformance.client.spring</module.name>
2425
<java.version>17</java.version>
2526
<spring-boot.version>4.1.0</spring-boot.version>
2627
<spring-ai.version>2.0.0</spring-ai.version>

‎conformance-tests/server-servlet/pom.xml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
</scm>
2222

2323
<properties>
24+
<module.name>io.modelcontextprotocol.sdk.conformance.server.servlet</module.name>
2425
<maven.deploy.skip>true</maven.deploy.skip>
2526
</properties>
2627

‎mcp-core/pom.xml‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020
<developerConnection>scm:git:ssh://git@github.com/modelcontextprotocol/java-sdk.git</developerConnection>
2121
</scm>
2222

23+
<properties>
24+
<module.name>io.modelcontextprotocol.sdk.mcp.core</module.name>
25+
</properties>
26+
2327
<build>
2428
<plugins>
2529
<plugin>
@@ -37,7 +41,7 @@
3741
Bundle-Name: Bundle ${project.groupId} : ${project.artifactId}
3842
Bundle-SymbolicName: ${project.groupId}.${project.artifactId}
3943
Bundle-Version: ${project.version}
40-
Automatic-Module-Name: ${project.groupId}.${project.artifactId}
44+
Automatic-Module-Name: ${module.name}
4145
Import-Package: jakarta.*;resolution:=optional, \
4246
*;
4347
Service-Component: OSGI-INF/io.modelcontextprotocol.json.McpJsonDefaults.xml

‎mcp-json-jackson2/pom.xml‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020
<developerConnection>scm:git:ssh://git@github.com/modelcontextprotocol/java-sdk.git</developerConnection>
2121
</scm>
2222

23+
<properties>
24+
<module.name>io.modelcontextprotocol.sdk.mcp.json.jackson2</module.name>
25+
</properties>
26+
2327
<build>
2428
<plugins>
2529
<plugin>
@@ -37,7 +41,7 @@
3741
Bundle-Name: Bundle ${project.groupId} : ${project.artifactId}
3842
Bundle-SymbolicName: ${project.groupId}.${project.artifactId}
3943
Bundle-Version: ${project.version}
40-
Automatic-Module-Name: ${project.groupId}.${project.artifactId}
44+
Automatic-Module-Name: ${module.name}
4145
Bundle-ActivationPolicy: lazy
4246
Import-Package: io.modelcontextprotocol.json,io.modelcontextprotocol.json.schema, \
4347
*;

‎mcp-json-jackson3/pom.xml‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020
<developerConnection>scm:git:ssh://git@github.com/modelcontextprotocol/java-sdk.git</developerConnection>
2121
</scm>
2222

23+
<properties>
24+
<module.name>io.modelcontextprotocol.sdk.mcp.json.jackson3</module.name>
25+
</properties>
26+
2327
<build>
2428
<plugins>
2529
<plugin>
@@ -37,7 +41,7 @@
3741
Bundle-Name: Bundle ${project.groupId} : ${project.artifactId}
3842
Bundle-SymbolicName: ${project.groupId}.${project.artifactId}
3943
Bundle-Version: ${project.version}
40-
Automatic-Module-Name: ${project.groupId}.${project.artifactId}
44+
Automatic-Module-Name: ${module.name}
4145
Bundle-ActivationPolicy: lazy
4246
Import-Package: io.modelcontextprotocol.json,io.modelcontextprotocol.json.schema, \
4347
*;

‎mcp-test/pom.xml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020
<developerConnection>scm:git:ssh://git@github.com/modelcontextprotocol/java-sdk.git</developerConnection>
2121
</scm>
2222

23+
<properties>
24+
<module.name>io.modelcontextprotocol.sdk.mcp.test</module.name>
25+
</properties>
26+
2327
<dependencies>
2428
<dependency>
2529
<groupId>io.modelcontextprotocol.sdk</groupId>

‎mcp/pom.xml‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,30 @@
2020
<developerConnection>scm:git:ssh://git@github.com/modelcontextprotocol/java-sdk.git</developerConnection>
2121
</scm>
2222

23+
<properties>
24+
<module.name>io.modelcontextprotocol.sdk.mcp</module.name>
25+
</properties>
26+
27+
<build>
28+
<plugins>
29+
<plugin>
30+
<groupId>org.apache.maven.plugins</groupId>
31+
<artifactId>maven-compiler-plugin</artifactId>
32+
<executions>
33+
<!-- module-info.java refers to the sibling modules by their JPMS names, and
34+
those only exist once the siblings have been packaged as jars: before
35+
the package phase the reactor hands the compiler bare target/classes
36+
directories, which cannot be automatic modules. Compiling at
37+
prepare-package keeps `mvn test` working on the full reactor. -->
38+
<execution>
39+
<id>java-compile</id>
40+
<phase>prepare-package</phase>
41+
</execution>
42+
</executions>
43+
</plugin>
44+
</plugins>
45+
</build>
46+
2347
<dependencies>
2448

2549
<dependency>

‎mcp/src/main/java/module-info.java‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* Copyright 2026 - 2026 the original author or authors.
3+
*/
4+
5+
/**
6+
* Aggregator module for the Java MCP SDK. Carries no code of its own; it exists so that
7+
* consumers can depend on the SDK with a single {@code requires} directive.
8+
*/
9+
module io.modelcontextprotocol.sdk.mcp {
10+
11+
requires transitive io.modelcontextprotocol.sdk.mcp.core;
12+
13+
requires transitive io.modelcontextprotocol.sdk.mcp.json.jackson3;
14+
15+
// mcp-core and mcp-json-jackson3 are automatic modules, so they cannot pull their
16+
// own dependencies into the module graph. Requiring them here spares consumers from
17+
// having to repeat these declarations. Drop this block once the SDK modules carry
18+
// their own module descriptors.
19+
requires org.slf4j;
20+
21+
requires tools.jackson.databind;
22+
23+
requires com.networknt.schema;
24+
25+
}

‎pom.xml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@
5959
<maven.compiler.target>17</maven.compiler.target>
6060
<surefireArgLine />
6161

62+
<!-- JPMS module name. Every module that produces a jar must override this;
63+
an empty value makes maven-jar-plugin fail, which is intentional. -->
64+
<module.name />
65+
6266
<assert4j.version>3.27.6</assert4j.version>
6367
<junit.version>6.0.2</junit.version>
6468
<mockito.version>5.20.0</mockito.version>
@@ -207,6 +211,7 @@
207211
<manifestEntries>
208212
<Implementation-Title>${project.artifactId}</Implementation-Title>
209213
<Implementation-Version>${project.version}</Implementation-Version>
214+
<Automatic-Module-Name>${module.name}</Automatic-Module-Name>
210215
</manifestEntries>
211216
</archive>
212217
</configuration>

0 commit comments

Comments
 (0)