Skip to content

Commit 3afc188

Browse files
committed
Modify maven-jar-plugin config to generate syntactically correct automatic module name. Remove OSGi based automatic module name generation
1 parent 082444e commit 3afc188

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

mcp-core/pom.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
version: ${versionmask;===;${version_cleanup;${project.version}}}
3939
Bundle-SymbolicName: ${project.groupId}.${project.artifactId}
4040
Bundle-Version: ${version}
41-
Automatic-Module-Name: ${project.groupId}.${project.artifactId}
4241
Import-Package: jakarta.*;resolution:=optional, \
4342
*;
4443
Export-Package: io.modelcontextprotocol.*;version="${version}";-noimport:=true

pom.xml

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
<bnd-maven-plugin.version>7.1.0</bnd-maven-plugin.version>
9898
<json-unit-assertj.version>4.1.0</json-unit-assertj.version>
9999
<json-schema-validator.version>2.0.0</json-schema-validator.version>
100-
100+
<build-helper-maven-plugin.version>3.6.1</build-helper-maven-plugin.version>
101101
</properties>
102102

103103
<modules>
@@ -113,6 +113,28 @@
113113

114114
<build>
115115
<plugins>
116+
<!-- Derive automatic module name from groupId, artifactId, replacing '-' with '.' -->
117+
<plugin>
118+
<groupId>org.codehaus.mojo</groupId>
119+
<artifactId>build-helper-maven-plugin</artifactId>
120+
<version>${build-helper-maven-plugin.version}</version>
121+
<executions>
122+
<execution>
123+
<id>rename-property</id>
124+
<goals>
125+
<goal>regex-property</goal>
126+
</goals>
127+
<phase>validate</phase>
128+
<configuration>
129+
<name>automatic.module.name</name>
130+
<value>${project.groupId}.${project.artifactId}</value>
131+
<regex>-</regex>
132+
<replacement>.</replacement>
133+
<failIfNoMatch>false</failIfNoMatch>
134+
</configuration>
135+
</execution>
136+
</executions>
137+
</plugin>
116138
<plugin>
117139
<groupId>io.spring.javaformat</groupId>
118140
<artifactId>spring-javaformat-maven-plugin</artifactId>
@@ -206,6 +228,7 @@
206228
<manifestEntries>
207229
<Implementation-Title>${project.artifactId}</Implementation-Title>
208230
<Implementation-Version>${project.version}</Implementation-Version>
231+
<Automatic-Module-Name>${automatic.module.name}</Automatic-Module-Name>
209232
</manifestEntries>
210233
</archive>
211234
</configuration>

0 commit comments

Comments
 (0)