diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/Artemis.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/Artemis.java index 3def675219a..764f82248b1 100644 --- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/Artemis.java +++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/Artemis.java @@ -111,7 +111,10 @@ public static void main(String... args) throws Exception { verifyManagementDTO(fileBrokerETC); - execute(true, true, true, fileHome, fileInstance, fileBrokerETC, args); + Object result = execute(true, true, true, fileHome, fileInstance, fileBrokerETC, args); + if (!Run.getEmbedded() && result instanceof Exception) { + System.exit(1); + } } diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Run.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Run.java index 59c90563a3c..a8f56fa7cdf 100644 --- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Run.java +++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Run.java @@ -70,6 +70,10 @@ public static void setEmbedded(boolean embedded) { Run.embedded = true; } + public static boolean getEmbedded() { + return Run.embedded; + } + private Broker server; @Override