Skip to content

Commit e18bf76

Browse files
manusaclaude
andauthored
fix(ci): use lax checksums in MAVEN_ARGS for snapshot workflow
Maven's CLI parses -C and -c with if/else-if, so -C always wins when both are present. The previous fix appended -c to the deploy command but it was silently ignored because -C was already in MAVEN_ARGS. Move -c into MAVEN_ARGS directly, replacing -C, so lax checksums apply to the entire snapshot build including the deploy phase. Co-Authored-By: Claude Opus 4.6 <[email protected]>
1 parent aff7b67 commit e18bf76

2 files changed

Lines changed: 10 additions & 8 deletions

File tree

.github/workflows/release-snapshots.yaml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,12 @@ on:
2727
- cron: '0 2 * * *' # Every day at 2am
2828

2929
env:
30-
MAVEN_ARGS: -B -C -V -ntp -Dhttp.keepAlive=false -e ${{ github.event.inputs.additional_args }}
30+
# Uses -c (lax checksums) instead of -C (strict checksums) used in the release workflow.
31+
# Maven's CLI uses if/else-if for -C/-c, so -C always wins when both are present.
32+
# Remote SNAPSHOT metadata on the Sonatype server can have persistent checksum
33+
# inconsistencies (maven-metadata.xml vs its .sha1 file). Strict checksums make
34+
# these fatal during deploy; lax checksums warn and continue.
35+
MAVEN_ARGS: -B -c -V -ntp -Dhttp.keepAlive=false -e ${{ github.event.inputs.additional_args }}
3136
RELEASE_MAVEN_ARGS: -Prelease -Denforcer.skip=true
3237
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
3338
MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
@@ -60,9 +65,5 @@ jobs:
6065
run: ./mvnw ${MAVEN_ARGS} clean install -pl bom-generator-plugin
6166
- name: Generate BOM
6267
run: ./mvnw ${MAVEN_ARGS} -Pbom clean validate
63-
# Deploy uses -c (lax checksums) to override -C (strict) from MAVEN_ARGS.
64-
# Remote SNAPSHOT metadata on the Sonatype server can have persistent or transient
65-
# checksum inconsistencies (maven-metadata.xml vs its .sha1 file). Strict checksums
66-
# make these fatal; lax checksums warn and continue.
6768
- name: Build and release Java modules
68-
run: ./mvnw ${MAVEN_ARGS} ${RELEASE_MAVEN_ARGS} -c deploy
69+
run: ./mvnw ${MAVEN_ARGS} ${RELEASE_MAVEN_ARGS} deploy

bom-generator-plugin/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,9 @@ mvn -Prelease deploy
146146
For SNAPSHOT deployments, the `central-publishing-maven-plugin` deploys each module
147147
individually (unlike releases, which are bundled). Remote SNAPSHOT metadata on the
148148
Sonatype server can have checksum inconsistencies (`maven-metadata.xml` vs its `.sha1`
149-
file), so the deploy step must use lax checksums (`-c`) instead of strict (`-C`).
150-
See the `release-snapshots.yaml` workflow for the exact commands.
149+
file), so the snapshot workflow uses `-c` (lax checksums) instead of `-C` (strict).
150+
Note: Maven's CLI uses `if/else-if` for these flags, so `-C` always wins when both
151+
are present — they cannot be combined. See `release-snapshots.yaml` for details.
151152

152153
## Generated BOM Content
153154

0 commit comments

Comments
 (0)