Skip to content

ci(maven): pin Maven 3.9 and skip an existing GitHub Packages upload - #1204

Merged
andiwand merged 2 commits into
mainfrom
ci/pin-maven-3.9
Oct 10, 2026
Merged

andiwand merged 2 commits into
mainfrom
ci/pin-maven-3.9

Conversation

@andiwand

@andiwand andiwand commented Oct 10, 2026 •

Copy link
Copy Markdown
Member

🤖 Generated with Claude Code

Problem

The maven workflow failed for v7.5.0 and v7.5.1. Maven Central does not have odr-core-java 7.5.0 or 7.5.1. The latest version on Maven Central is 7.4.0. The AAR (odr-core-android) is not affected, because it uses Gradle.

Sonatype rejected the bundle:

Deployment 418c5ec8-9c3b-4afc-a35d-a8993f2c9621 failed
 - Bundle has content that does NOT have a .pom file: app/opendocument/odr-core-java

Cause

The ubuntu-24.04 runner image 20261004.327 updates Maven from 3.9.16 to 3.10.0. v7.4.0 ran on 20260927.320 and passed.

Maven 3.10 stages app/opendocument/odr-core-java/maven-metadata-local.xml, and also _remote.repositories* files. central-publishing-maven-plugin 0.11.0 (the latest version) deletes only maven-metadata-central-staging.xml before it makes the bundle. So the metadata file stays in a directory without a .pom. I reproduced both layouts locally with Maven 3.10.0 and 3.9.16.

The rerun (attempt 2) failed for a second reason. Attempt 1 had already uploaded 7.5.1 to GitHub Packages, so the rerun got HTTP Status: 409 and stopped before the Central step.

Change

  • Add a Maven Wrapper (jni/mvnw, script only) that pins Maven 3.9.16 with a SHA-256 checksum. All three mvn calls in maven.yml use it.
  • The upload step for GitHub Packages skips the upload if the jar of that version is already there. The jar goes up after the pom, so an upload that stopped after the pom is not skipped. Then a rerun after a failed Central step can get to Central.

Recovery for 7.5.0 and 7.5.1

A rerun of the release runs uses the workflow file at the tag, so a rerun cannot use this fix. After this merges, dispatch maven.yml on main with version=7.5.1 (and 7.5.0 if we want it). jni/ is the same on main and at v7.5.1.

andiwand and others added 2 commits October 10, 2026 13:36
The ubuntu-24.04 image 20261004 updates Maven from 3.9.16 to 3.10.0.
Maven 3.10 stages a maven-metadata-local.xml next to the version
directory. central-publishing-maven-plugin 0.11.0 deletes only
maven-metadata-central-staging.xml, so the file stays in the bundle.
Central then rejects the bundle with "Bundle has content that does NOT
have a .pom file", and the v7.5.0 and v7.5.1 releases of odr-core-java
did not get to Maven Central.

A Maven Wrapper in jni/ pins Maven 3.9.16 with a checksum, and the
workflow uses it for all three builds.

The upload to GitHub Packages succeeds before the Central step runs. A
rerun then gets 409 from GitHub Packages and stops before Central. The
publish step now skips the upload if the pom of that version is already
on GitHub Packages.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LkhPXqd9UFL99dDDkMDKQN
The deploy uploads the pom before the jar. If an upload stops after the
pom, a check for the pom skips the jar on every rerun. A check for the
jar skips only an upload that completed.

Also tell jni/AGENTS.md to build through mvnw, and reflow the README
paragraph.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LkhPXqd9UFL99dDDkMDKQN
@andiwand
andiwand merged commit 49f6ead into main Oct 10, 2026
23 checks passed
@andiwand
andiwand deleted the ci/pin-maven-3.9 branch October 10, 2026 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant