Repository navigation
Pin Maven 3.9.16 via the Maven wrapper for CI and releases - #154
Conversation
ubuntu-latest moved to Maven 3.10.0, where central-publishing-maven-plugin
leaves maven-metadata files in the staging bundle and Central rejects it
("Bundle has content that does NOT have a .pom file"). This failed the
0.233 release. Upstream: mavenplugins/central-publishing-maven-plugin#79.
Reviewer's GuideThe PR makes Maven execution deterministic by adding a checksum-verified wrapper pinned to Maven 3.9.16, then updates CI and release workflows to invoke it so Central Portal publishing uses the known-good Maven version rather than the runner’s Maven 3.10.0. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
There was a problem hiding this comment.
Hey - I've found 2 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="mvnw" line_range="180" />
<code_context>
+
+# select .zip or .tar.gz
+if ! command -v unzip >/dev/null; then
+ distributionUrl="${distributionUrl%.zip}.tar.gz"
+ distributionUrlName="${distributionUrl##*/}"
+fi
</code_context>
<issue_to_address>
**Tarball checksum validation fails**
When the Unix host lacks `unzip` and the wrapper selects the `.tar.gz` fallback, `distributionSha256Sum` still contains the `.zip` digest, so checksum validation rejects the downloaded tarball and Maven never starts.
Use the `.tar.gz` archive’s matching checksum when selecting the tarball fallback.
</issue_to_address>
### Comment 2
<location path=".github/workflows/release.yml" line_range="89" />
<code_context>
git ls -5
cat ~/.m2/settings.xml
- mvn -V -B -U -e -T2C deploy \
+ ./mvnw -V -B -U -e -T2C deploy \
-DautoReleaseAfterClose=true \
-DkeepStagingRepositoryOnCloseRuleFailure=true \
</code_context>
<issue_to_address>
**Legacy builds bypass the pin**
When the Jenkins release pipeline or Travis build is used, jenkins’ release steps and the Travis build still invoke system `mvn`, so those paths do not use the wrapper’s Maven 3.9.16; Jenkins explicitly runs Maven 3.8.6, and Travis remains dependent on its runner’s Maven version.
Switch those remaining Maven invocations to `./mvnw`, or explicitly remove/decommission the legacy paths if they are no longer supported.
Also at `.github/workflows/maven.yml:33`.
</issue_to_address>|
|
||
| # select .zip or .tar.gz | ||
| if ! command -v unzip >/dev/null; then | ||
| distributionUrl="${distributionUrl%.zip}.tar.gz" |
There was a problem hiding this comment.
🟡 Medium · Tarball checksum validation fails
When the Unix host lacks unzip and the wrapper selects the .tar.gz fallback, distributionSha256Sum still contains the .zip digest, so checksum validation rejects the downloaded tarball and Maven never starts.
Use the .tar.gz archive’s matching checksum when selecting the tarball fallback.
Prompt for AI agents
In `mvnw` at line 180:
**Tarball checksum validation fails**
When the Unix host lacks `unzip` and the wrapper selects the `.tar.gz` fallback, `distributionSha256Sum` still contains the `.zip` digest, so checksum validation rejects the downloaded tarball and Maven never starts.
Use the `.tar.gz` archive’s matching checksum when selecting the tarball fallback.| git ls -5 | ||
| cat ~/.m2/settings.xml | ||
| mvn -V -B -U -e -T2C deploy \ | ||
| ./mvnw -V -B -U -e -T2C deploy \ |
There was a problem hiding this comment.
🟡 Medium · Legacy builds bypass the pin
When the Jenkins release pipeline or Travis build is used, jenkins’ release steps and the Travis build still invoke system mvn, so those paths do not use the wrapper’s Maven 3.9.16; Jenkins explicitly runs Maven 3.8.6, and Travis remains dependent on its runner’s Maven version.
Switch those remaining Maven invocations to ./mvnw, or explicitly remove/decommission the legacy paths if they are no longer supported.
Also at .github/workflows/maven.yml:33.
Prompt for AI agents
In `.github/workflows/release.yml` at line 89:
**Legacy builds bypass the pin**
When the Jenkins release pipeline or Travis build is used, jenkins’ release steps and the Travis build still invoke system `mvn`, so those paths do not use the wrapper’s Maven 3.9.16; Jenkins explicitly runs Maven 3.8.6, and Travis remains dependent on its runner’s Maven version.
Switch those remaining Maven invocations to `./mvnw`, or explicitly remove/decommission the legacy paths if they are no longer supported.
Also at `.github/workflows/maven.yml:33`.|
@imjalpreet @agrawalreetika Can you please review? |



Description
The 0.233 release (run) failed at the Central Portal validation step:
Root cause:
ubuntu-latestnow ships Maven 3.10.0 (the last good run, 0.232, used 3.9.16). Under 3.10,central-publishing-maven-pluginno longer deletes the per-artifactmaven-metadata-*.xmlfrom the staging directory before bundling (the 0.232 log has 44Pre Bundling - deletedlines, the 0.233 log has none), so Central rejects the bundle. Upstream: mavenplugins/central-publishing-maven-plugin#79.This adds a Maven wrapper pinned to 3.9.16 (with
distributionSha256Sum) and switchesrelease.ymlandmaven.ymlto./mvnw.Consistency with prestodb/presto
This mirrors how prestodb/presto already builds:
mvnw,mvnw.cmdand.mvn/wrapper/maven-wrapper.properties, pinned to Maven 3.9.12.presto-release-prepare.ymlandpresto-release-publish.yml, call./mvnwrather than the runner'smvn, which is why presto releases are unaffected by the runner's move to 3.10.0.Differences from presto: this uses the wrapper's
only-scripttype, so nomaven-wrapper.jarbinary is committed, and it pins 3.9.16, the version the last successful airlift release (0.232) ran with.Nothing from 0.233 reached Central, and the tag was never pushed, so the release can simply be re-run after this merges.
Test plan
./mvnw install.Apache Maven 3.9.16line in the-Voutput and thePre Bundling - deletedlines in the publish step.