Skip to content

Conformance-test instructions reference -2.0.1-SNAPSHOT.jar, but the build produces -2.2.0-SNAPSHOT.jar #1311

Closed

Description

@lxcxjxhx

说清楚我做了什么

按 README.md → "Conformance tests" 一节照抄命令跑客户端一致性测试:

./mvnw clean package -DskipTests -pl conformance-tests/client-jdk-http-client -am
npx @modelcontextprotocol/conformance client \
  --command "java -jar conformance-tests/client-jdk-http-client/target/client-jdk-http-client-2.0.1-SNAPSHOT.jar" \
  --scenario initialize

实际发生

构建产出的 jar 不是文档里的名字:

conformance-tests/client-jdk-http-client/target/client-jdk-http-client-2.2.0-SNAPSHOT.jar

因为模块没有自己声明 version,继承父 POM 的 2.2.0-SNAPSHOT(pom.xml:9、conformance-tests/client-jdk-http-client/pom.xml:9)。所以上面的 java -jar ...2.0.1-SNAPSHOT.jar 直接 Unable to access jarfile,一致性测试跑不起来。

影响范围(全部为 2.0.1-SNAPSHOT)

文件 出现次数
README.md 2
conformance-tests/client-jdk-http-client/README.md 7
conformance-tests/client-spring-http-client/README.md 5

共 14 处,全部指向同一个不存在的产物名。

建议

最小修法是把 14 处替换为 2.2.0-SNAPSHOT。但它每次发版都会再腐坏一次,所以更耐久的写法是让文档不写死版本,例如:

JAR=$(ls conformance-tests/client-jdk-http-client/target/client-jdk-http-client-*.jar | head -1)
--command "java -jar $JAR"

我没有直接开 PR,是因为 CONTRIBUTING.md 要求外部 PR 必须链接一个已分配给我或带 help wanted 的 issue。如果这个 issue 被标记 help wanted(或分配给我),我可以按上面任一方案提 PR。

环境

  • JDK 17
  • 仓库 main,pom.xml 版本 2.2.0-SNAPSHOT

Activity

  1. added
    documentation
    on Nov 3, 2026
  2. added
    P3
    on Nov 3, 2026
  3. added a commit that references this issue on Nov 4, 2026
    e7d8a36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3documentation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions