Skip to content

Commit a4af515

Browse files
committed
Refactor OSGi support into mcp-osgi module
1 parent a5278d8 commit a4af515

File tree

3 files changed

+137
-0
lines changed

3 files changed

+137
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ build/
1010
out
1111
/.gradletasknamecache
1212
**/*.flattened-pom.xml
13+
**/dependency-reduced-pom.xml
1314

1415
### IDE - Eclipse/STS ###
1516
.apt_generated

mcp-osgi/pom.xml

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
<parent>
7+
<groupId>io.modelcontextprotocol.sdk</groupId>
8+
<artifactId>mcp-parent</artifactId>
9+
<version>0.18.0-SNAPSHOT</version>
10+
</parent>
11+
<artifactId>mcp-osgi</artifactId>
12+
<packaging>jar</packaging>
13+
<name>Java MCP SDK OSGi Support</name>
14+
<description>Java SDK packaged for consumption in OSGi runtimes</description>
15+
<url>https://github.com/modelcontextprotocol/java-sdk</url>
16+
17+
<scm>
18+
<url>https://github.com/modelcontextprotocol/java-sdk</url>
19+
<connection>git://github.com/modelcontextprotocol/java-sdk.git</connection>
20+
<developerConnection>[email protected]/modelcontextprotocol/java-sdk.git</developerConnection>
21+
</scm>
22+
23+
<build>
24+
<plugins>
25+
<plugin>
26+
<groupId>biz.aQute.bnd</groupId>
27+
<artifactId>bnd-maven-plugin</artifactId>
28+
<version>${bnd-maven-plugin.version}</version>
29+
<executions>
30+
<execution>
31+
<id>bnd-process</id>
32+
<goals>
33+
<goal>bnd-process</goal>
34+
</goals>
35+
<configuration>
36+
<bnd><![CDATA[
37+
Bundle-Name: Bundle ${project.groupId} : ${project.artifactId}
38+
version: ${versionmask;===;${version_cleanup;${project.version}}}
39+
Bundle-SymbolicName: ${project.groupId}.${project.artifactId}
40+
Bundle-Version: ${version}
41+
Import-Package: jakarta.*;resolution:=optional, \
42+
*;
43+
Export-Package: io.modelcontextprotocol.*;version="${version}";-noimport:=true
44+
-noimportjava: true;
45+
-nouses: true;
46+
-removeheaders: Private-Package
47+
SPI-Consumer: io.modelcontextprotocol.json.schema.JsonSchemaValidatorSupplier, \
48+
io.modelcontextprotocol.json.McpJsonMapperSupplier
49+
SPI-Provider: io.modelcontextprotocol.json.schema.JsonSchemaValidatorSupplier; \
50+
provider:=io.modelcontextprotocol.json.schema.jackson.JacksonJsonSchemaValidatorSupplier, \
51+
io.modelcontextprotocol.json.McpJsonMapperSupplier; \
52+
provider:=io.modelcontextprotocol.json.jackson.JacksonMcpJsonMapperSupplier
53+
]]>
54+
</bnd>
55+
</configuration>
56+
</execution>
57+
</executions>
58+
</plugin>
59+
60+
<plugin>
61+
<groupId>org.apache.maven.plugins</groupId>
62+
<artifactId>maven-shade-plugin</artifactId>
63+
<executions>
64+
<execution>
65+
<goals>
66+
<goal>shade</goal>
67+
</goals>
68+
<phase>package</phase>
69+
<configuration>
70+
<useDependencyReducedPomInJar>true</useDependencyReducedPomInJar>
71+
<promoteTransitiveDependencies>true</promoteTransitiveDependencies>
72+
<filters>
73+
<filter>
74+
<artifact>*:*</artifact>
75+
<excludes>
76+
<exclude>META-INF/MANIFEST.MF</exclude>
77+
</excludes>
78+
</filter>
79+
<filter>
80+
<artifact>*:*</artifact>
81+
<excludes>
82+
<exclude>META-INF/maven/**/*</exclude>
83+
</excludes>
84+
</filter>
85+
</filters>
86+
<transformers>
87+
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
88+
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
89+
<manifestEntries>
90+
<Automatic-Module-Name>${automatic.module.name}</Automatic-Module-Name>
91+
</manifestEntries>
92+
</transformer>
93+
</transformers>
94+
<artifactSet>
95+
<includes>
96+
<include>io.modelcontextprotocol.sdk:*</include>
97+
</includes>
98+
</artifactSet>
99+
</configuration>
100+
</execution>
101+
</executions>
102+
</plugin>
103+
<plugin>
104+
<groupId>org.apache.maven.plugins</groupId>
105+
<artifactId>maven-jar-plugin</artifactId>
106+
<configuration>
107+
<archive>
108+
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
109+
</archive>
110+
</configuration>
111+
</plugin>
112+
</plugins>
113+
</build>
114+
115+
<dependencies>
116+
<dependency>
117+
<groupId>io.modelcontextprotocol.sdk</groupId>
118+
<artifactId>mcp-json-jackson2</artifactId>
119+
<version>0.18.0-SNAPSHOT</version>
120+
</dependency>
121+
122+
<dependency>
123+
<groupId>io.modelcontextprotocol.sdk</groupId>
124+
<artifactId>mcp-core</artifactId>
125+
<version>0.18.0-SNAPSHOT</version>
126+
</dependency>
127+
</dependencies>
128+
129+
</project>

pom.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@
9898
<json-unit-assertj.version>4.1.0</json-unit-assertj.version>
9999
<json-schema-validator.version>2.0.0</json-schema-validator.version>
100100
<build-helper-maven-plugin.version>3.6.1</build-helper-maven-plugin.version>
101+
<maven-shade-plugin.version>3.6.0</maven-shade-plugin.version>
101102
</properties>
102103

103104
<modules>
@@ -106,6 +107,7 @@
106107
<module>mcp-core</module>
107108
<module>mcp-json-jackson2</module>
108109
<module>mcp-json</module>
110+
<module>mcp-osgi</module>
109111
<module>mcp-spring/mcp-spring-webflux</module>
110112
<module>mcp-spring/mcp-spring-webmvc</module>
111113
<module>mcp-test</module>
@@ -285,6 +287,11 @@
285287
<artifactId>maven-deploy-plugin</artifactId>
286288
<version>${maven-deploy-plugin.version}</version>
287289
</plugin>
290+
<plugin>
291+
<groupId>org.apache.maven.plugins</groupId>
292+
<artifactId>maven-shade-plugin</artifactId>
293+
<version>${maven-shade-plugin.version}</version>
294+
</plugin>
288295
</plugins>
289296
</build>
290297

0 commit comments

Comments
 (0)