Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,15 @@ public interface MavenOptions extends Options {
@Nonnull
Optional<Boolean> failFast();

/**
* Requests that Maven print the reactor build order and exit, without executing the build.
*
* @return an {@link Optional} containing true if the reactor build order should be printed
* and the build skipped, false if not, or empty if not specified.
*/
@Nonnull
Optional<Boolean> printBuildOrder();

/**
* Indicates whether Maven should run all builds but defer error reporting to the end.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,14 @@ public Optional<Boolean> failFast() {
return Optional.empty();
}

@Override
public Optional<Boolean> printBuildOrder() {
if (commandLine.hasOption(CLIManager.PRINT_BUILD_ORDER)) {
return Optional.of(Boolean.TRUE);
}
return Optional.empty();
}

@Override
public Optional<Boolean> failAtEnd() {
if (commandLine.hasOption(CLIManager.FAIL_AT_END)) {
Expand Down Expand Up @@ -238,6 +246,7 @@ protected static class CLIManager extends CommonsCliOptions.CLIManager {
public static final String CHECKSUM_FAILURE_POLICY = "C";
public static final String CHECKSUM_WARNING_POLICY = "c";
public static final String FAIL_FAST = "ff";
public static final String PRINT_BUILD_ORDER = "pbo";
public static final String FAIL_AT_END = "fae";
public static final String FAIL_NEVER = "fn";
public static final String RESUME = "r";
Expand Down Expand Up @@ -360,6 +369,10 @@ protected void prepareOptions(org.apache.commons.cli.Options options) {
.desc(
"If set, Maven will load command line options from the specified file and merge with CLI specified ones.")
.get());
options.addOption(Option.builder(PRINT_BUILD_ORDER)
.longOpt("print-build-order")
.desc("Print the reactor build order and exit without building")
.get());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ public Optional<Boolean> failFast() {
return returnFirstPresentOrEmpty(MavenOptions::failFast);
}

@Override
public Optional<Boolean> printBuildOrder() {
return returnFirstPresentOrEmpty(MavenOptions::printBuildOrder);
}

@Override
public Optional<Boolean> failAtEnd() {
return returnFirstPresentOrEmpty(MavenOptions::failAtEnd);
Expand Down