From 3e6dcd05e138e9cc0c42933bc9244ae04d487eb1 Mon Sep 17 00:00:00 2001 From: Hiram Chirino Date: Wed, 6 Jan 2016 11:59:56 -0500 Subject: [PATCH] Support using the cli.Artemis to boot up a broker without using the boot.Artemis class. This is handy for when you want to start Artemis in an IDE where it's not in the distro packaging and the classpath is being managed by the IDE. It just needed to handle using the artemis.instance system prop. --- .../org/apache/activemq/artemis/cli/Artemis.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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 681a745aba..8cdf02f18c 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 @@ -40,10 +40,23 @@ import org.apache.activemq.artemis.cli.commands.tools.PrintData; import org.apache.activemq.artemis.cli.commands.tools.XmlDataExporter; import org.apache.activemq.artemis.cli.commands.tools.XmlDataImporter; +/** + * Artemis is the main CLI entry point for managing/running a broker. + * + * Want to start or debug a broker from an IDE? This is probably the best class to + * run. Make sure set the -Dartemis.instance=path/to/instance system property. + * You should also use the 'apache-artemis' module for the class path since that + * includes all artemis modules. + */ public class Artemis { public static void main(String... args) throws Exception { - execute(null, null, args); + String home = System.getProperty("artemis.home"); + File fileHome = home != null ? new File(home) : null; + String instance = System.getProperty("artemis.instance"); + File fileInstance = instance != null ? new File(instance) : null; + + execute(fileHome, fileInstance, args); } public static Object internalExecute(String... args) throws Exception {