From 4de929c3e1293afc9b5005f959e3b0a24483eec7 Mon Sep 17 00:00:00 2001 From: Clebert Suconic Date: Wed, 20 May 2015 16:58:53 -0400 Subject: [PATCH] option to remove the web server on the install --- .../activemq/artemis/cli/commands/Create.java | 26 +++++++++++++++++++ .../commands/etc/bootstrap-web-settings.txt | 4 +++ .../artemis/cli/commands/etc/bootstrap.xml | 5 +--- .../artemis/test/StreamClassPathTest.java | 1 + 4 files changed, 32 insertions(+), 4 deletions(-) create mode 100644 artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/bootstrap-web-settings.txt 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 9fae68b808..ca3602404d 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 @@ -80,6 +80,7 @@ public class Create extends InputAbstract public static final String ETC_CLUSTER_SECURITY_SETTINGS_TXT = "etc/cluster-security-settings.txt"; public static final String ETC_CLUSTER_SETTINGS_TXT = "etc/cluster-settings.txt"; public static final String ETC_CONNECTOR_SETTINGS_TXT = "etc/connector-settings.txt"; + public static final String ETC_BOOTSTRAP_WEB_SETTINGS_TXT = "etc/bootstrap-web-settings.txt"; @Arguments(description = "The instance directory to hold the broker's configuration and data", required = true) File directory; @@ -132,10 +133,23 @@ public class Create extends InputAbstract @Option(name = "--role", description = "The name for the role created (Default: amq)") String role; + @Option(name = "--no-web", description = "This will remove the web server definition from bootstrap.xml") + boolean noWeb; + boolean IS_WINDOWS; boolean IS_CYGWIN; + public boolean isNoWeb() + { + return noWeb; + } + + public void setNoWeb(boolean noWeb) + { + this.noWeb = noWeb; + } + public int getPortOffset() { return portOffset; @@ -500,6 +514,18 @@ public class Create extends InputAbstract filters.put("${bootstrap.guest}", ""); } + + if (noWeb) + { + filters.put("${bootstrap-web-settings}", ""); + } + else + { + filters.put("${bootstrap-web-settings}", applyFilters(readTextFile(ETC_BOOTSTRAP_WEB_SETTINGS_TXT), filters)); + } + + + write(ETC_BOOTSTRAP_XML, filters, false); write(ETC_BROKER_XML, filters, false); write(ETC_ARTEMIS_ROLES_PROPERTIES, filters, false); diff --git a/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/bootstrap-web-settings.txt b/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/bootstrap-web-settings.txt new file mode 100644 index 0000000000..790cda3104 --- /dev/null +++ b/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/bootstrap-web-settings.txt @@ -0,0 +1,4 @@ + + + + diff --git a/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/bootstrap.xml b/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/bootstrap.xml index b4164d8d20..be51734db5 100644 --- a/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/bootstrap.xml +++ b/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/bootstrap.xml @@ -25,10 +25,7 @@ - - - - +${bootstrap-web-settings} diff --git a/artemis-cli/src/test/java/org/apache/activemq/artemis/test/StreamClassPathTest.java b/artemis-cli/src/test/java/org/apache/activemq/artemis/test/StreamClassPathTest.java index c9f7771e5f..8a6764cc62 100644 --- a/artemis-cli/src/test/java/org/apache/activemq/artemis/test/StreamClassPathTest.java +++ b/artemis-cli/src/test/java/org/apache/activemq/artemis/test/StreamClassPathTest.java @@ -48,6 +48,7 @@ public class StreamClassPathTest openStream(Create.ETC_CLUSTER_SECURITY_SETTINGS_TXT); openStream(Create.ETC_CLUSTER_SETTINGS_TXT); openStream(Create.ETC_CONNECTOR_SETTINGS_TXT); + openStream(Create.ETC_BOOTSTRAP_WEB_SETTINGS_TXT); }