Skip to content

Commit 53574e2

Browse files
committed
Use the Maven wrapper in all GitHub workflows
The ubuntu-24.04 runner image now ships Maven 3.10, where the staging metadata is written as maven-metadata-local.xml. central-publishing 0.7.0 only removes maven-metadata-central-staging.xml before bundling, so the leftover files end up in the bundle and Central rejects it ("Bundle has content that does NOT have a .pom file"). Use ./mvnw everywhere, so CI runs the Maven version pinned in maven-wrapper.properties instead of whatever the runner image ships. Signed-off-by: Daniel Garnier-Moiroux <git@garnier.wf>
1 parent 1078d36 commit 53574e2

5 files changed

Lines changed: 15 additions & 13 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
cache: 'maven'
2121

2222
- name: Build
23-
run: mvn verify
23+
run: ./mvnw verify
2424

2525
jackson2-tests:
2626
name: Jackson 2 Integration Tests
@@ -37,4 +37,4 @@ jobs:
3737
cache: 'maven'
3838

3939
- name: Jackson 2 Integration Tests
40-
run: mvn -pl mcp-test -am -Pjackson2 test
40+
run: ./mvnw -pl mcp-test -am -Pjackson2 test

‎.github/workflows/conformance.yml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ jobs:
2222

2323
- name: Build and start server
2424
run: |
25-
mvn clean install -DskipTests
26-
mvn exec:java -pl conformance-tests/server-servlet -Dexec.mainClass="io.modelcontextprotocol.conformance.server.ConformanceServlet" &
25+
./mvnw clean install -DskipTests
26+
./mvnw exec:java -pl conformance-tests/server-servlet -Dexec.mainClass="io.modelcontextprotocol.conformance.server.ConformanceServlet" &
2727
timeout 30 bash -c 'until curl -s http://localhost:8080/mcp > /dev/null 2>&1; do sleep 0.5; done'
2828
2929
- name: Run conformance tests
@@ -51,7 +51,7 @@ jobs:
5151
cache: 'maven'
5252

5353
- name: Build client
54-
run: mvn clean install -DskipTests
54+
run: ./mvnw clean install -DskipTests
5555

5656
- name: Run conformance test
5757
uses: modelcontextprotocol/conformance@v0.1.16
@@ -92,7 +92,7 @@ jobs:
9292
cache: 'maven'
9393

9494
- name: Build client
95-
run: mvn clean install -DskipTests
95+
run: ./mvnw clean install -DskipTests
9696

9797
- name: Run conformance test
9898
uses: modelcontextprotocol/conformance@v0.1.16

‎.github/workflows/docs.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
- name: Deploy docs (push to main)
3838
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
3939
run: |
40-
PROJECT_VERSION=$(mvn help:evaluate -Dexpression=project.version --quiet -DforceStdout)
40+
PROJECT_VERSION=$(./mvnw help:evaluate -Dexpression=project.version --quiet -DforceStdout)
4141
if [[ "${PROJECT_VERSION}" == *-SNAPSHOT ]]; then
4242
ALIAS="latest-snapshot"
4343
else

‎.github/workflows/maven-central-release.yml‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,17 @@ jobs:
2929
# Deploy runs the integration tests, but only with Jackson 3
3030
# We run Jackson 2 IT manually
3131
- name: Jackson 2 Integration Tests
32-
run: mvn -pl mcp-test -am -Pjackson2 test
32+
run: ./mvnw -pl mcp-test -am -Pjackson2 test
3333

3434
# Deploy runs all previous maven goals, including test and verify
3535
# Conformance tests are not published, and they break javadoc:aggregate: its forked
3636
# compile lifecycle never produces mcp classes (compiled at prepare-package), so their
3737
# dependency on mcp falls back to Maven Central, where the release does not exist yet.
38+
# Use the wrapper (Maven 3.9.x): with Maven 3.10, central-publishing 0.7.0 leaves
39+
# maven-metadata-local.xml files in the bundle, and Central rejects it.
3840
- name: Publish to Maven Central
3941
run: |
40-
mvn --batch-mode \
42+
./mvnw --batch-mode \
4143
-Prelease \
4244
-Pjavadoc \
4345
-pl '!conformance-tests,!conformance-tests/client-jdk-http-client,!conformance-tests/client-spring-http-client,!conformance-tests/server-servlet' \

‎.github/workflows/publish-snapshot.yml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,23 +30,23 @@ jobs:
3030
node-version: '20'
3131

3232
- name: Generate Java docs
33-
run: mvn -Pjavadoc -B javadoc:aggregate
33+
run: ./mvnw -Pjavadoc -B javadoc:aggregate
3434

3535
- name: Jackson 2 Integration Tests
36-
run: mvn -pl mcp-test -am -Pjackson2 test
36+
run: ./mvnw -pl mcp-test -am -Pjackson2 test
3737

3838
- name: Build with Maven and deploy to Sonatype snapshot repository
3939
env:
4040
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
4141
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
4242
MAVEN_GPG_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }}
4343
run: |
44-
mvn \
44+
./mvnw \
4545
-Pjavadoc \
4646
-Prelease \
4747
--batch-mode \
4848
--update-snapshots deploy \
4949
-Dmaven.repository.credentialScope=id
5050
5151
- name: Capture project version
52-
run: echo PROJECT_VERSION=$(mvn help:evaluate -Dexpression=project.version --quiet -DforceStdout) >> $GITHUB_ENV
52+
run: echo PROJECT_VERSION=$(./mvnw help:evaluate -Dexpression=project.version --quiet -DforceStdout) >> $GITHUB_ENV

0 commit comments

Comments
 (0)