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 3def675219..764f82248b 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 class Artemis implements Runnable { 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 59c90563a3..a8f56fa7cd 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 class Run extends LockAbstract { Run.embedded = true; } + public static boolean getEmbedded() { + return Run.embedded; + } + private Broker server; @Override