From 93e90789fef356a667a40a55159ff5414e0fa804 Mon Sep 17 00:00:00 2001 From: Steven Hawkins Date: Tue, 23 Jan 2024 11:56:34 -0500 Subject: [PATCH] fix: auto-build not needed for build (#26099) closes #26075 Signed-off-by: Steve Hawkins --- .../main/java/org/keycloak/quarkus/runtime/cli/Picocli.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/Picocli.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/Picocli.java index 68b5b0cd0f6c..081920b4b523 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/Picocli.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/Picocli.java @@ -166,6 +166,7 @@ private static boolean shouldSkipRebuild(List cliArgs, String currentCom return cliArgs.contains("--help") || cliArgs.contains("-h") || cliArgs.contains("--help-all") + || currentCommandName.equals(Build.NAME) || currentCommandName.equals(ShowConfig.NAME) || currentCommandName.equals(Tools.NAME); } @@ -217,13 +218,14 @@ private static int runReAugmentation(List cliArgs, CommandLine cmd) { List configArgsList = new ArrayList<>(cliArgs); - configArgsList.replaceAll(arg -> replaceCommandWithBuild(getCurrentCommandSpec(cliArgs, cmd.getCommandSpec()).getCommandName(), arg)); + String commandName = getCurrentCommandSpec(cliArgs, cmd.getCommandSpec()).getCommandName(); + configArgsList.replaceAll(arg -> replaceCommandWithBuild(commandName, arg)); configArgsList.removeIf(Picocli::isRuntimeOption); exitCode = cmd.execute(configArgsList.toArray(new String[0])); if(!isDevMode() && exitCode == cmd.getCommandSpec().exitCodeOnSuccess()) { - cmd.getOut().printf("Next time you run the server, just run:%n%n\t%s %s %s %s%n%n", Environment.getCommand(), getCurrentCommandSpec(cliArgs, cmd.getCommandSpec()).getCommandName(), OPTIMIZED_BUILD_OPTION_LONG, String.join(" ", getSanitizedRuntimeCliOptions())); + cmd.getOut().printf("Next time you run the server, just run:%n%n\t%s %s %s %s%n%n", Environment.getCommand(), commandName, OPTIMIZED_BUILD_OPTION_LONG, String.join(" ", getSanitizedRuntimeCliOptions())); } return exitCode;