fix(java): keep Maven coordinates in sync with release tags (#5151)

Fixes #4937

## Summary

The `v0.42.0-beta.21` release commit retained `0.42.0-beta.20` in both
Java POMs, so its Maven build produced coordinates for the previous
beta. The release bump used a Maven version hook whose final shell
commands could return success after Maven failed, allowing the tag to be
created with stale coordinates. [Issue
#4937](https://github.com/lancedb/lancedb/issues/4937)

Declare both Maven version fields in the shared version-bump
configuration and align the checked-in POMs with the current release
version. Preview and stable release bumps now apply the same version to
the parent POM and the core module's parent reference before tagging.
Package names, dependencies, and publication destinations are preserved.

## Verification

Tests: `/bin/sh -c 'PATH=/tmp/osscout-release-venv/bin:$PATH bash
ci/tests/test_bump_version.sh'`.
Result: PATH=/tmp/osscout-release-venv/bin:$PATH bash
ci/tests/test_bump_version.sh — base exit 1 with the tag/POM mismatch,
patched exit 0 with both preview and stable cases passing.
Result: python -m unittest discover -s ci/tests -v — base, 35 passed.
Result: /tmp/osscout-release-venv/bin/python -m unittest discover -s
ci/tests -v — patched, 35 passed.
Result: bash ci/tests/test_cli_installer.sh — passed.
Result: cd java && ./mvnw --batch-mode test -pl lancedb-core — base, 37
passed on JDK 25.
Result: cd java && JAVA_HOME=/usr/lib/jvm/temurin-17-jdk-amd64 ./mvnw
--batch-mode -Dspotless.skip=true clean test -pl lancedb-core — patched,
37 passed. Surefire XML reports are in
java/lancedb-core/target/surefire-reports/.
Result: osscout_base_work=$(mktemp -d) && git archive HEAD java | tar
-xf - -C "$osscout_base_work" && cd "$osscout_base_work/java" &&
JAVA_HOME=/tmp/osscout-jdk8 ./mvnw --batch-mode -DskipTests
-Dspotless.skip=true clean deploy -pl lancedb-core -am -P deploy-to-fury
-DaltDeploymentRepository=fury::file:///tmp/osscout-fury-base — base
build succeeded and emitted stale 0.42.0-beta.20 artifacts for the
0.42.0-beta.21 release sources.
Result: cd java && JAVA_HOME=/tmp/osscout-jdk8 ./mvnw --batch-mode
-DskipTests -Dspotless.skip=true clean deploy -pl lancedb-core -am -P
deploy-to-fury
-DaltDeploymentRepository=fury::file:///tmp/osscout-fury-deploy —
patched build succeeded and emitted both 0.42.0-beta.21 POMs and the
main, sources and Javadoc JARs.
Regression coverage: `ci/tests/test_bump_version.sh`.
<!-- oss-scout-job:job-d5fa2e08-6a6f-46ca-821c-d3a65d054055 -->

Signed-off-by: wangshun <96341168+xixi-box@users.noreply.github.com>
This commit is contained in:
wangshun
2026-11-23 14:12:57 +08:00
committed by GitHub
parent b5ec7d6af4
commit a0e65400a9
4 changed files with 104 additions and 28 deletions
+1 -1
View File
@@ -8,7 +8,7 @@
<parent>
<groupId>com.lancedb</groupId>
<artifactId>lancedb-parent</artifactId>
<version>0.42.0-beta.24</version>
<version>0.42.0-beta.25</version>
<relativePath>../pom.xml</relativePath>
</parent>