[AURON #2460] Add --mvn, --goal and -- passthrough to auron-build.sh - #2462
Draft
ShreyeshArangath wants to merge 1 commit into
Draft
[AURON #2460] Add --mvn, --goal and -- passthrough to auron-build.sh#2462ShreyeshArangath wants to merge 1 commit into
ShreyeshArangath wants to merge 1 commit into
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Fixes #2460.
Three small additions that make
auron-build.shusable as a build step inside another script, and on machines without network access:--mvn <PATH>builds with an already installed Maven instead ofbuild/mvn, which downloads Maven and so fails in an offline or airgapped build. It accepts either a path or a command onPATH, and errors if it resolves to neither.--goal <GOAL>sets the Maven goal. It defaults toinstall, so nothing changes for existing callers, but a caller that only wants artifacts can runpackageand 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-Dhandling viaMVN_D_ARGS, but-P,-Band long options such as--no-transfer-progressare still either swallowed by thebreakin the-*handler or rejected as an unknown option. The--arm sits alongside the existing-Dhandling 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:
The goal is
packagerather thaninstall, and-P,-Band the long option all arrive intact.Also checked:
--goalthe command line still saysclean install, so existing callers are unaffected.-DskipBuildNativeplaced among the options still lands inMVN_D_ARGSas before, so auron-build.sh fails to parse options after -D arguments #2227 behaviour is preserved.--mvnresolves a bare command name offPATHas well as an explicit path.--mvn /nope/mvnexits 1 withERROR: --mvn '/nope/mvn' is not an executable or a command on PATH.--goalwith no argument exits 1 with a message naming the expected values.--bogusis still rejected, so the new--arm does not weaken that check.