Skip to content

HDDS-17838. Add Maven Wrapper - #12070

Merged
adoroszlai merged 10 commits into
apache:masterfrom
adoroszlai:HDDS-17838
Nov 18, 2026
Merged

adoroszlai merged 10 commits into
apache:masterfrom
adoroszlai:HDDS-17838

Conversation

@adoroszlai

@adoroszlai adoroszlai commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Maven repository downloaded with Maven 3.10 does not work with Maven 3.9, entries are downloaded again. Currently GitHub's Ubuntu 24.04 runner comes with Maven 3.10, while Ubuntu 26.04 includes. populate-cache runs on 24.04, so it produces a cache that is not usable by some other jobs that run on 26.04 (basic, acceptance).

This PR adds Maven Wrapper to Ozone to ensure the same Maven version independent of the environment. (Ratis already uses it.)

  • errorprone.bats used to fake the mvn command to test errorprone.sh. The latter is now split to two parts, and only the processing of output.log is tested.
  • New get_version helper function added to reduce duplicated mvn help:evaluate commands.
  • Run Fetch plugin dependencies before Get versions, which needs those plugins.

https://issues.apache.org/jira/browse/HDDS-17838

How was this patch tested?

populate-cache: https://github.com/adoroszlai/ozone/actions/runs/43956117342
CI: https://github.com/adoroszlai/ozone/actions/runs/43958031996

@adoroszlai adoroszlai added the build Pull request that modifies the build process label Nov 17, 2026
@adoroszlai adoroszlai self-assigned this Nov 17, 2026
@github-actions github-actions Bot added the CI label Nov 17, 2026

@chihsuan chihsuan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this! @adoroszlai

Left two inline comments. Also, should s3a-test.sh use the wrapper too? It still runs plain mvn.

mvn ${MAVEN_ARGS:-} --fail-never --show-version \

Comment thread .github/workflows/build-ratis.yml Outdated
echo "protobuf=$(mvn help:evaluate -N -q -DforceStdout -Dscan=false -Dexpression=shaded.protobuf.version)" >> $GITHUB_OUTPUT
echo "grpc=$(./mvnw help:evaluate -N -q -DforceStdout -Dscan=false -Dexpression=shaded.grpc.version)" >> $GITHUB_OUTPUT
echo "netty=$(./mvnw help:evaluate -N -q -DforceStdout -Dscan=false -Dexpression=shaded.netty.version)" >> $GITHUB_OUTPUT
echo "protobuf=$(./mvnw help:evaluate -N -q -DforceStdout -Dscan=false -Dexpression=shaded.protobuf.version)" >> $GITHUB_OUTPUT

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this runs in the ratis-thirdparty checkout. Should we keep mvn here, or every ratis-thirdparty we check out here have mvnw?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this runs in the ratis-thirdparty checkout.

Correct.

Should we keep mvn here, or every ratis-thirdparty we check out here have mvnw?

ratis-thirdparty had mvnw for few months, since 1.1.0. In practice, I think past versions are unlikely to be built here (although the workflow is not "smart", it re-builds releases as well).

Yes, keeping mvn would be safer, I can restore it.

@adoroszlai

Copy link
Copy Markdown
Contributor Author

should s3a-test.sh use the wrapper too? It still runs plain mvn.

s3a-test.sh executes mvn for Hadoop project, so we need to keep mvn here.

@chihsuan chihsuan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @adoroszlai LGTM

@adoroszlai
adoroszlai merged commit 977c3bb into apache:master Nov 18, 2026
5 checks passed
@adoroszlai

Copy link
Copy Markdown
Contributor Author

Thanks @chihsuan for the review.

@adoroszlai
adoroszlai deleted the HDDS-17838 branch November 18, 2026 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Pull request that modifies the build process CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants