Skip to content

[AURON #2460] Add --mvn, --goal and -- passthrough to auron-build.sh - #2462

Open
ShreyeshArangath wants to merge 2 commits into
apache:masterfrom
ShreyeshArangath:auron-2460-mvn-goal-passthrough
Open

[AURON #2460] Add --mvn, --goal and -- passthrough to auron-build.sh#2462
ShreyeshArangath wants to merge 2 commits into
apache:masterfrom
ShreyeshArangath:auron-2460-mvn-goal-passthrough

Conversation

@ShreyeshArangath

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Fixes #2460.

Three small additions that make auron-build.sh usable as a build step inside another script, and on machines without network access:

  • --mvn <PATH> builds with an already installed Maven instead of build/mvn, which downloads Maven and so fails in an offline or airgapped build. It accepts either a path or a command on PATH, and errors if it resolves to neither.
  • --goal <GOAL> sets the Maven goal. It defaults to install, so nothing changes for existing callers, but a caller that only wants artifacts can run package and leave the local repository alone.
  • -- ends option parsing, so everything after it reaches Maven unchanged. auron-build.sh fails to parse options after -D arguments #2227 fixed -D handling via MVN_D_ARGS, but -P, -B and long options such as --no-transfer-progress are still either swallowed by the break in the -* handler or rejected as an unknown option. The -- arm sits alongside the existing -D handling rather than replacing it, and is placed before the --* arm so it is not caught as an unknown option.

This is independent of #2461 and the two can merge in either order.

How was this patch tested?

Manually, with a stub Maven that echoes its arguments so the composed command line is visible.

All three together:

$ bash auron-build.sh --release --mvn /tmp/stubmvn --goal package \
    --sparkver 3.1 --scalaver 2.12 -- -Pceleborn-0.6 -B --no-transfer-progress
STUB_MVN_INVOKED_WITH: clean package -DskipTests -Prelease -Pspark-3.1 -Pscala-2.12 -Pceleborn-0.6 -B --no-transfer-progress

The goal is package rather than install, and -P, -B and the long option all arrive intact.

Also checked:

  • Without --goal the command line still says clean install, so existing callers are unaffected.
  • -DskipBuildNative placed among the options still lands in MVN_D_ARGS as before, so auron-build.sh fails to parse options after -D arguments #2227 behaviour is preserved.
  • --mvn resolves a bare command name off PATH as well as an explicit path.
  • --mvn /nope/mvn exits 1 with ERROR: --mvn '/nope/mvn' is not an executable or a command on PATH.
  • --goal with no argument exits 1 with a message naming the expected values.
  • An unknown long option such as --bogus is still rejected, so the new -- arm does not weaken that check.

…ld.sh

auron-build.sh always builds through build/mvn, which downloads Maven
and so fails in an offline or airgapped build, always runs the install
goal, and cannot forward Maven options other than -D. That makes it hard
to call from a wrapper script.

Add --mvn to build with an already installed Maven, accepting either a
path or a command on PATH. Add --goal, defaulting to install so existing
callers are unaffected, so a caller can run package and leave the local
repository alone. Accept -- as an end-of-options marker so options such
as -P, -B and --no-transfer-progress reach Maven, alongside the existing
-D handling from apache#2227.
@github-actions github-actions Bot added the build label Aug 10, 2026
@ShreyeshArangath
ShreyeshArangath marked this pull request as ready for review August 10, 2026 17:02
@slfan1989 slfan1989 self-assigned this Aug 12, 2026

@slfan1989 slfan1989 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the contribution! The overall approach looks good, but --mvn does not yet fully bypass the Maven wrapper, and passthrough arguments are dropped in Docker mode. Please see my inline comments.

Comment thread auron-build.sh Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

--mvn is intended to bypass build/mvn for offline or air-gapped builds, but project-version resolution still invokes ./build/mvn directly. Please use "$MVN_CMD" here as well; otherwise this step may still trigger the wrapper’s download path and fail offline.

Comment thread auron-build.sh Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The passthrough arguments remaining in "$@" are only forwarded by the local Maven invocation. Docker mode exports BUILD_ARGS alone, so arguments after -- are silently dropped. Please forward the passthrough arguments into the container as well, while preserving argument boundaries, or explicitly reject/document passthrough as unsupported in Docker mode.

…n, forward passthrough args in Docker

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@ShreyeshArangath

Copy link
Copy Markdown
Contributor Author

Thanks for the contribution! The overall approach looks good, but --mvn does not yet fully bypass the Maven wrapper, and passthrough arguments are dropped in Docker mode. Please see my inline comments.

Addressed! Thanks for the review, @slfan1989!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUILD] Allow auron-build.sh to build with an existing Maven and forward arbitrary Maven options

2 participants