From 1ad37ea2b17daa2bdb90cd865761ad6b0b7e40e6 Mon Sep 17 00:00:00 2001 From: jbertram Date: Mon, 11 Jan 2016 20:16:33 -0600 Subject: [PATCH] ARTEMIS-336 don't hard-code instance path --- .../org/apache/activemq/artemis/cli/commands/Create.java | 6 ++++-- .../activemq/artemis/cli/commands/etc/artemis.profile | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java index 23e0fd1238..0a950412dd 100644 --- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java +++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java @@ -575,7 +575,6 @@ public class Create extends InputAbstract { new File(directory, ETC_LOGIN_CONFIG_WITHOUT_GUEST).renameTo(new File(directory, ETC_LOGIN_CONFIG)); } - filters.put("${login-config}", "-Djava.security.auth.login.config=" + path(directory, false) + "/etc/login.config"); write(ETC_ARTEMIS_ROLES_PROPERTIES, filters, false); if (IS_WINDOWS) { @@ -604,10 +603,13 @@ public class Create extends InputAbstract { performAutoTune(filters, aio, dataFolder); - write(ETC_BOOTSTRAP_XML, filters, false); write(ETC_BROKER_XML, filters, false); write(ETC_ARTEMIS_USERS_PROPERTIES, filters, false); + // we want this variable to remain unchanged so that it will use the value set in the profile + filters.remove("${artemis.instance}"); + write(ETC_BOOTSTRAP_XML, filters, false); + context.out.println(""); context.out.println("You can now start the broker by executing: "); context.out.println(""); diff --git a/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/artemis.profile b/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/artemis.profile index c6ceeef84f..f734691a45 100644 --- a/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/artemis.profile +++ b/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/artemis.profile @@ -16,6 +16,7 @@ # under the License. ARTEMIS_HOME='${artemis.home}' +ARTEMIS_INSTANCE='${artemis.instance}' # Cluster Properties: Used to pass arguments to ActiveMQ Artemis which can be referenced in broker.xml #ARTEMIS_CLUSTER_PROPS="-Dactivemq.remoting.default.port=61617 -Dactivemq.remoting.amqp.port=5673 -Dactivemq.remoting.stomp.port=61614 -Dactivemq.remoting.hornetq.port=5446" @@ -23,7 +24,7 @@ ARTEMIS_HOME='${artemis.home}' # Java Opts -JAVA_ARGS="-XX:+UseParallelGC -XX:+AggressiveOpts -XX:+UseFastAccessorMethods -Xms512M -Xmx1024M -Xbootclasspath/a:$ARTEMIS_HOME/lib/${logmanager} ${login-config} ${java-opts}" +JAVA_ARGS="-XX:+UseParallelGC -XX:+AggressiveOpts -XX:+UseFastAccessorMethods -Xms512M -Xmx1024M -Xbootclasspath/a:$ARTEMIS_HOME/lib/${logmanager} -Djava.security.auth.login.config=$ARTEMIS_INSTANCE/etc/login.config ${java-opts} -Dartemis.instance=$ARTEMIS_INSTANCE" # Debug args: Uncomment to enable debug