Skip to content

Commit 6423874

Browse files
manusaclaude
andauthored
fix(ci): deploy BOMs separately in snapshot workflow
The central-publishing-maven-plugin deploys each module individually for SNAPSHOTs. When BOMs deploy in the same reactor, they may fetch metadata for recently deployed artifacts and hit a server-side inconsistency window between maven-metadata.xml and its checksum file, causing checksum validation failures. Splitting the deploy into two invocations avoids this race condition. Co-Authored-By: Claude Opus 4.6 <[email protected]> Signed-off-by: Marc Nuri <[email protected]>
1 parent 9c786af commit 6423874

2 files changed

Lines changed: 23 additions & 5 deletions

File tree

.github/workflows/release-snapshots.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,5 +60,12 @@ jobs:
6060
run: ./mvnw ${MAVEN_ARGS} clean install -pl bom-generator-plugin
6161
- name: Generate BOM
6262
run: ./mvnw ${MAVEN_ARGS} -Pbom clean validate
63+
# BOMs are deployed separately to avoid SNAPSHOT metadata checksum errors.
64+
# The central-publishing-maven-plugin deploys each module individually for SNAPSHOTs.
65+
# If BOMs deploy in the same reactor, they may fetch metadata for artifacts that were
66+
# just deployed, hitting a brief server-side inconsistency window between the
67+
# maven-metadata.xml and its checksum file.
6368
- name: Build and release Java modules
64-
run: ./mvnw ${MAVEN_ARGS} ${RELEASE_MAVEN_ARGS} deploy
69+
run: ./mvnw ${MAVEN_ARGS} ${RELEASE_MAVEN_ARGS} deploy -pl '!target/classes/kubernetes-client-bom,!target/classes/kubernetes-client-bom-with-deps'
70+
- name: Deploy BOMs
71+
run: ./mvnw ${MAVEN_ARGS} ${RELEASE_MAVEN_ARGS} deploy -pl target/classes/kubernetes-client-bom,target/classes/kubernetes-client-bom-with-deps

bom-generator-plugin/README.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,17 +127,28 @@ Examples:
127127
## Example Workflow
128128

129129
```bash
130-
# Generate BOMs (single command, no separate plugin invocation needed)
131-
mvn clean install -Pbom
130+
# 1. Install the plugin first (it's not published to any repository)
131+
mvn clean install -pl bom-generator-plugin
132+
133+
# 2. Generate BOMs (runs at the validate phase)
134+
mvn -Pbom clean validate
132135

133136
# The BOMs are generated in:
134137
# - target/classes/kubernetes-client-bom/pom.xml
135138
# - target/classes/kubernetes-client-bom-with-deps/pom.xml
136139

137-
# Release with updated BOMs
138-
mvn clean install -Prelease
140+
# 3. Release with generated BOMs (the -Prelease profile adds them as reactor modules)
141+
mvn -Prelease deploy
139142
```
140143

144+
### SNAPSHOT deployment
145+
146+
For SNAPSHOT deployments, the `central-publishing-maven-plugin` deploys each module
147+
individually (unlike releases, which are bundled). BOMs must be deployed in a separate
148+
Maven invocation to avoid checksum validation errors caused by the server-side metadata
149+
inconsistency window for recently deployed SNAPSHOT artifacts. See the
150+
`release-snapshots.yaml` workflow for the exact commands.
151+
141152
## Generated BOM Content
142153

143154
Each generated BOM includes:

0 commit comments

Comments
 (0)