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); }