Skip to content

Commit 75136af

Browse files
committed
Merge branch 'v0.2.0'
# Conflicts: # README.adoc
2 parents d4cf9ed + 8b47a4f commit 75136af

24 files changed

+865
-172
lines changed

.editorconfig

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,7 @@ end_of_line = lf
66
indent_size = 4
77
indent_style = space
88
insert_final_newline = true
9-
trim_trailing_whitespace = true
9+
trim_trailing_whitespace = true
10+
11+
[*.yml]
12+
indent_size = 2

.github/workflows/maven-build.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Maven Build
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
build:
11+
name: maven build
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
# Build with JDK 17
18+
- name: Set up JDK 17
19+
uses: actions/setup-java@v4
20+
with:
21+
cache: maven
22+
java-version: '17'
23+
distribution: 'temurin'
24+
- name: Build with Maven
25+
run: mvn -B package --file pom.xml
26+
27+
# Upload coverage reports to Codecov
28+
- name: Upload coverage reports to Codecov
29+
uses: codecov/codecov-action@v4
30+
with:
31+
token: ${{ secrets.CODECOV_TOKEN }}

README.adoc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
= Annotation-driven MCP Java SDK
22

3+
image:https://img.shields.io/badge/Java-17+-blue[java-version]
4+
image:https://img.shields.io/maven-central/v/io.github.codeboyzhou/mcp-declarative-java-sdk?color=blue[maven-central-version]
5+
image:https://img.shields.io/codecov/c/github/awesome-java-web/spring-boot-commons?color=brightgreen[codecov-coverage]
6+
image:https://img.shields.io/github/actions/workflow/status/io.github.codeboyzhou/mcp-declarative-java-sdk/maven-build.yml[github-action-status]
7+
38
Declarative https://github.com/modelcontextprotocol/java-sdk[MCP Java SDK] Development with Java Annotations.
49

510
== Advantages
@@ -15,7 +20,7 @@ Just put this one line code in your `main` method:
1520
[source,java]
1621
----
1722
// You can use this annotation to specify the base package
18-
// to scan for MCP resources, prompts, tools, but it's not required.
23+
// to scan for MCP resources, prompts, tools, but it's optional.
1924
@McpComponentScan(basePackage = "com.github.codeboyzhou.mcp.examples")
2025
public class MyMcpServer {
2126
@@ -82,6 +87,7 @@ Add the following Maven dependency to your project:
8287

8388
[source,xml]
8489
----
90+
<!-- Internally relies on native MCP Java SDK 0.8.1 -->
8591
<dependency>
8692
<groupId>io.github.codeboyzhou</groupId>
8793
<artifactId>mcp-declarative-java-sdk</artifactId>

pom.xml

Lines changed: 81 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
54

65
<modelVersion>4.0.0</modelVersion>
76

87
<groupId>io.github.codeboyzhou</groupId>
98
<artifactId>mcp-declarative-java-sdk</artifactId>
10-
<version>0.1.0</version>
9+
<version>0.2.0</version>
1110

1211
<name>MCP Declarative Java SDK</name>
13-
<description>Annotation-driven MCP (Model Context Protocol) Development with Java - Zero Spring Framework Dependencies</description>
12+
<description>Annotation-driven MCP (Model Context Protocol) Development with Java - No Spring Framework Required</description>
1413
<url>https://github.com/codeboyzhou/mcp-declarative-java-sdk</url>
1514

1615
<licenses>
@@ -45,28 +44,40 @@
4544
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
4645
<!--==================== maven plugin versions ====================-->
4746
<central-publishing-maven-plugin.version>0.7.0</central-publishing-maven-plugin.version>
47+
<jacoco-maven-plugin.version>0.8.12</jacoco-maven-plugin.version>
4848
<maven-gpg-plugin.version>3.1.0</maven-gpg-plugin.version>
4949
<maven-javadoc-plugin.version>3.6.3</maven-javadoc-plugin.version>
5050
<maven-source-plugin.version>3.3.0</maven-source-plugin.version>
51+
<maven-surefire-plugin.version>3.2.3</maven-surefire-plugin.version>
52+
<sortpom-maven-plugin.version>4.0.0</sortpom-maven-plugin.version>
5153
<!--==================== dependency versions ======================-->
52-
<mcp-sdk.version>0.8.1</mcp-sdk.version>
5354
<jetty.version>12.0.18</jetty.version>
55+
<junit5.version>5.10.2</junit5.version>
56+
<logback.version>1.5.18</logback.version>
57+
<mcp-sdk.version>0.9.0</mcp-sdk.version>
5458
<reflections.version>0.10.2</reflections.version>
5559
</properties>
5660

5761
<dependencyManagement>
5862
<dependencies>
63+
<!-- Note: local installation is required if the mcp-sdk.version is SNAPSHOT -->
5964
<dependency>
6065
<groupId>io.modelcontextprotocol.sdk</groupId>
6166
<artifactId>mcp-bom</artifactId>
6267
<version>${mcp-sdk.version}</version>
63-
<scope>import</scope>
6468
<type>pom</type>
69+
<scope>import</scope>
6570
</dependency>
6671
</dependencies>
6772
</dependencyManagement>
6873

6974
<dependencies>
75+
<dependency>
76+
<groupId>ch.qos.logback</groupId>
77+
<artifactId>logback-classic</artifactId>
78+
<version>${logback.version}</version>
79+
<scope>test</scope>
80+
</dependency>
7081
<dependency>
7182
<groupId>io.modelcontextprotocol.sdk</groupId>
7283
<artifactId>mcp</artifactId>
@@ -76,6 +87,12 @@
7687
<artifactId>jetty-ee10-servlet</artifactId>
7788
<version>${jetty.version}</version>
7889
</dependency>
90+
<dependency>
91+
<groupId>org.junit.jupiter</groupId>
92+
<artifactId>junit-jupiter</artifactId>
93+
<version>${junit5.version}</version>
94+
<scope>test</scope>
95+
</dependency>
7996
<dependency>
8097
<groupId>org.reflections</groupId>
8198
<artifactId>reflections</artifactId>
@@ -85,17 +102,38 @@
85102

86103
<build>
87104
<plugins>
105+
<plugin>
106+
<groupId>com.github.ekryd.sortpom</groupId>
107+
<artifactId>sortpom-maven-plugin</artifactId>
108+
<version>${sortpom-maven-plugin.version}</version>
109+
<configuration>
110+
<nrOfIndentSpace>4</nrOfIndentSpace>
111+
<createBackupFile>false</createBackupFile>
112+
<indentAttribute>schemaLocation</indentAttribute>
113+
<sortModules>true</sortModules>
114+
<sortPlugins>groupId,artifactId</sortPlugins>
115+
<sortDependencies>groupId,artifactId</sortDependencies>
116+
<sortDependencyManagement>groupId,artifactId</sortDependencyManagement>
117+
</configuration>
118+
<executions>
119+
<execution>
120+
<goals>
121+
<goal>sort</goal>
122+
</goals>
123+
</execution>
124+
</executions>
125+
</plugin>
88126
<plugin>
89127
<groupId>org.apache.maven.plugins</groupId>
90128
<artifactId>maven-gpg-plugin</artifactId>
91129
<version>${maven-gpg-plugin.version}</version>
92130
<executions>
93131
<execution>
94132
<id>sign-artifacts</id>
95-
<phase>verify</phase>
96133
<goals>
97134
<goal>sign</goal>
98135
</goals>
136+
<phase>verify</phase>
99137
</execution>
100138
</executions>
101139
</plugin>
@@ -125,6 +163,41 @@
125163
</execution>
126164
</executions>
127165
</plugin>
166+
<plugin>
167+
<groupId>org.apache.maven.plugins</groupId>
168+
<artifactId>maven-surefire-plugin</artifactId>
169+
<version>${maven-surefire-plugin.version}</version>
170+
<configuration>
171+
<!--suppress UnresolvedMavenProperty for IntelliJ IDEA-->
172+
<argLine>${jacoco.agent.argLine}</argLine>
173+
</configuration>
174+
</plugin>
175+
<plugin>
176+
<groupId>org.jacoco</groupId>
177+
<artifactId>jacoco-maven-plugin</artifactId>
178+
<version>${jacoco-maven-plugin.version}</version>
179+
<executions>
180+
<execution>
181+
<id>pre-unit-test</id>
182+
<goals>
183+
<goal>prepare-agent</goal>
184+
</goals>
185+
<configuration>
186+
<propertyName>jacoco.agent.argLine</propertyName>
187+
</configuration>
188+
</execution>
189+
<execution>
190+
<id>post-unit-test</id>
191+
<goals>
192+
<goal>report</goal>
193+
</goals>
194+
<phase>test</phase>
195+
<configuration>
196+
<outputDirectory>${project.build.directory}/unit-test-report</outputDirectory>
197+
</configuration>
198+
</execution>
199+
</executions>
200+
</plugin>
128201
<plugin>
129202
<groupId>org.sonatype.central</groupId>
130203
<artifactId>central-publishing-maven-plugin</artifactId>

0 commit comments

Comments
 (0)