Fix instructions for running conformance tests

- The server-servlet app depends on mcp, which must be either installed
  or included in the compile artifact for `mvn exec:java` to pick it up.
- Change the build instructions to build from root, use a `-pl` flag to
  target the servlet app.
- Disable the exec plugin from the root pom.

Signed-off-by: Daniel Garnier-Moiroux <git@garnier.wf>
This commit is contained in:
Daniel Garnier-Moiroux 2026-03-02 11:56:39 +01:00
commit d4c4a2517f
4 changed files with 20 additions and 11 deletions

View file

@ -78,8 +78,7 @@ Uses the `client-spring-http-client` module with Spring Security OAuth2 and the
### Server
```bash
# Start server
cd conformance-tests/server-servlet
../../mvnw compile exec:java -Dexec.mainClass="io.modelcontextprotocol.conformance.server.ConformanceServlet"
./mvnw compile -pl conformance-tests/server-servlet -am exec:java
# Run tests (in another terminal)
npx @modelcontextprotocol/conformance server --url http://localhost:8080/mcp --suite active
@ -94,7 +93,7 @@ cd conformance-tests/client-jdk-http-client
# Run all scenarios
for scenario in initialize tools_call elicitation-sep1034-client-defaults sse-retry; do
npx @modelcontextprotocol/conformance client \
--command "java -jar target/client-jdk-http-client-1.0.0-SNAPSHOT.jar" \
--command "java -jar target/client-jdk-http-client-1.1.0-SNAPSHOT.jar" \
--scenario $scenario
done
```
@ -111,7 +110,7 @@ cd conformance-tests/client-spring-http-client
# Run auth suite
npx @modelcontextprotocol/conformance@0.1.15 client \
--spec-version 2025-11-25 \
--command "java -jar target/client-spring-http-client-0.18.0-SNAPSHOT.jar" \
--command "java -jar target/client-spring-http-client-1.1.0-SNAPSHOT.jar" \
--suite auth
```

View file

@ -54,7 +54,7 @@ cd conformance-tests/client-jdk-http-client
This creates an executable JAR at:
```
target/client-jdk-http-client-1.0.0-SNAPSHOT.jar
target/client-jdk-http-client-1.1.0-SNAPSHOT.jar
```
## Running Tests
@ -65,19 +65,19 @@ Run a single scenario:
```bash
npx @modelcontextprotocol/conformance client \
--command "java -jar conformance-tests/client-jdk-http-client/target/client-jdk-http-client-1.0.0-SNAPSHOT.jar" \
--command "java -jar conformance-tests/client-jdk-http-client/target/client-jdk-http-client-1.1.0-SNAPSHOT.jar" \
--scenario initialize
npx @modelcontextprotocol/conformance client \
--command "java -jar conformance-tests/client-jdk-http-client/target/client-jdk-http-client-1.0.0-SNAPSHOT.jar" \
--command "java -jar conformance-tests/client-jdk-http-client/target/client-jdk-http-client-1.1.0-SNAPSHOT.jar" \
--scenario tools_call
npx @modelcontextprotocol/conformance client \
--command "java -jar conformance-tests/client-jdk-http-client/target/client-jdk-http-client-1.0.0-SNAPSHOT.jar" \
--command "java -jar conformance-tests/client-jdk-http-client/target/client-jdk-http-client-1.1.0-SNAPSHOT.jar" \
--scenario elicitation-sep1034-client-defaults
npx @modelcontextprotocol/conformance client \
--command "java -jar conformance-tests/client-jdk-http-client/target/client-jdk-http-client-1.0.0-SNAPSHOT.jar" \
--command "java -jar conformance-tests/client-jdk-http-client/target/client-jdk-http-client-1.1.0-SNAPSHOT.jar" \
--scenario sse-retry
```
@ -85,7 +85,7 @@ Run with verbose output:
```bash
npx @modelcontextprotocol/conformance client \
--command "java -jar conformance-tests/client-jdk-http-client/target/client-jdk-http-client-1.0.0-SNAPSHOT.jar" \
--command "java -jar conformance-tests/client-jdk-http-client/target/client-jdk-http-client-1.1.0-SNAPSHOT.jar" \
--scenario initialize \
--verbose
```
@ -96,7 +96,7 @@ You can also run the client manually if you have a test server:
```bash
export MCP_CONFORMANCE_SCENARIO=initialize
java -jar conformance-tests/client-jdk-http-client/target/client-jdk-http-client-1.0.0-SNAPSHOT.jar http://localhost:3000/mcp
java -jar conformance-tests/client-jdk-http-client/target/client-jdk-http-client-1.1.0-SNAPSHOT.jar http://localhost:3000/mcp
```
## Test Results

View file

@ -65,6 +65,7 @@
<version>3.1.0</version>
<configuration>
<mainClass>io.modelcontextprotocol.conformance.server.ConformanceServlet</mainClass>
<skip>false</skip>
</configuration>
</plugin>
</plugins>

View file

@ -263,6 +263,15 @@
<artifactId>maven-deploy-plugin</artifactId>
<version>${maven-deploy-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<skip>true</skip>
<mainClass>ignored</mainClass>
</configuration>
</plugin>
</plugins>
</build>