From b0d0731c867db404b9d286bb14bc28cbbef64fde Mon Sep 17 00:00:00 2001 From: Stefan Bischof Date: Fri, 13 Nov 2026 19:09:33 +0100 Subject: [PATCH] Deploy: snapshots through the Maven deploy plugin, metadata once per module Since 12 November the snapshot repository of Central answers a burst of uploads with HTTP 429. For a snapshot, the central-publishing plugin uploads the files of a reactor one at a time in the hash order of their paths, each with its own round of metadata and checksums, and stops at the first refusal. A reactor the size of org.eclipse.daanse.sql is cut short at the same file on every run: the first files go up again and again, the rest never. A snapshot now goes without the deploy profile, through the Maven deploy plugin to the snapshotRepository of the parent pom: each module with its build, its metadata once, without signatures, sources and javadoc, and with SHA-1 checksums only, none of which the snapshot repository asks for. A release still goes through the deploy profile and the central-publishing plugin. Signed-off-by: Stefan Bischof --- .github/workflows/reuse_java_deploy.yml | 26 +++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/.github/workflows/reuse_java_deploy.yml b/.github/workflows/reuse_java_deploy.yml index a276598..8c019b4 100644 --- a/.github/workflows/reuse_java_deploy.yml +++ b/.github/workflows/reuse_java_deploy.yml @@ -45,10 +45,28 @@ jobs: # mvn-server-repository-origins (actions/setup-java#1282, release asked in # actions/setup-java#1284) and set # mvn-server-repository-origins: central:https://central.sonatype.com - run: >- - mvn -Pdeploy --no-transfer-progress --batch-mode -U deploy - -DskipTests -Dbnd.testing.skip=true -Dbnd.resolve.skip=true - -Dmaven.repository.credentialScope=id + # + # A release goes through the deploy profile and the central-publishing plugin, + # which bundles, signs and publishes it. A snapshot goes without that profile, + # through the Maven deploy plugin to the snapshotRepository of the parent pom: + # the central-publishing plugin uploads a snapshot file by file, each with its + # own round of metadata and checksums, and stops at the first refusal, so the + # rate limit of the snapshot repository (HTTP 429) cuts a large reactor short + # at the same file every time. The deploy plugin uploads the metadata once per + # module. A snapshot has no signatures, sources or javadoc, and only SHA-1 + # checksums; the snapshot repository asks for none of them. + run: | + version=$(mvn --batch-mode --no-transfer-progress --non-recursive -q \ + help:evaluate -Dexpression=project.version -DforceStdout) + echo "Deploying version ${version}" + args=(--no-transfer-progress --batch-mode -U deploy + -DskipTests -Dbnd.testing.skip=true -Dbnd.resolve.skip=true + -Dmaven.repository.credentialScope=id) + if [[ "${version}" == *-SNAPSHOT ]]; then + mvn "${args[@]}" -Daether.checksums.algorithms=SHA-1 + else + mvn -Pdeploy "${args[@]}" + fi env: MAVEN_USERNAME: ${{ secrets.CENTRAL_SONATYPE_TOKEN_USERNAME }} MAVEN_PASSWORD: ${{ secrets.CENTRAL_SONATYPE_TOKEN_PASSWORD }}