You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by cl...@apache.org on 2015/07/29 23:22:17 UTC

[11/24] activemq-artemis git commit: Continuing work on ARTEMIS-178

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/clustered-queue/src/main/resources/activemq/server1/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-queue/src/main/resources/activemq/server1/artemis-roles.properties b/examples/jms/clustered-queue/src/main/resources/activemq/server1/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/clustered-queue/src/main/resources/activemq/server1/artemis-roles.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-## ---------------------------------------------------------------------------
-## Licensed to the Apache Software Foundation (ASF) under one or more
-## contributor license agreements.  See the NOTICE file distributed with
-## this work for additional information regarding copyright ownership.
-## The ASF licenses this file to You under the Apache License, Version 2.0
-## (the "License"); you may not use this file except in compliance with
-## the License.  You may obtain a copy of the License at
-##
-## http://www.apache.org/licenses/LICENSE-2.0
-##
-## Unless required by applicable law or agreed to in writing, software
-## distributed under the License is distributed on an "AS IS" BASIS,
-## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-## See the License for the specific language governing permissions and
-## limitations under the License.
-## ---------------------------------------------------------------------------
-guest=guest
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/clustered-queue/src/main/resources/activemq/server1/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-queue/src/main/resources/activemq/server1/artemis-users.properties b/examples/jms/clustered-queue/src/main/resources/activemq/server1/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/clustered-queue/src/main/resources/activemq/server1/artemis-users.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-## ---------------------------------------------------------------------------
-## Licensed to the Apache Software Foundation (ASF) under one or more
-## contributor license agreements.  See the NOTICE file distributed with
-## this work for additional information regarding copyright ownership.
-## The ASF licenses this file to You under the Apache License, Version 2.0
-## (the "License"); you may not use this file except in compliance with
-## the License.  You may obtain a copy of the License at
-##
-## http://www.apache.org/licenses/LICENSE-2.0
-##
-## Unless required by applicable law or agreed to in writing, software
-## distributed under the License is distributed on an "AS IS" BASIS,
-## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-## See the License for the specific language governing permissions and
-## limitations under the License.
-## ---------------------------------------------------------------------------
-guest=guest
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/clustered-standalone/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-standalone/pom.xml b/examples/jms/clustered-standalone/pom.xml
index 1f2249d..e37336f 100644
--- a/examples/jms/clustered-standalone/pom.xml
+++ b/examples/jms/clustered-standalone/pom.xml
@@ -37,11 +37,6 @@ under the License.
 
    <dependencies>
       <dependency>
-         <groupId>org.apache.activemq.examples.jms</groupId>
-         <artifactId>common</artifactId>
-         <version>${project.version}</version>
-      </dependency>
-      <dependency>
          <groupId>org.apache.geronimo.specs</groupId>
          <artifactId>geronimo-jms_2.0_spec</artifactId>
       </dependency>
@@ -57,7 +52,7 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>create</id>
+                        <id>create0</id>
                         <goals>
                            <goal>create</goal>
                         </goals>
@@ -67,25 +62,68 @@ under the License.
                         </configuration>
                      </execution>
                      <execution>
-                        <id>create2</id>
+                        <id>create1</id>
                         <goals>
                            <goal>create</goal>
                         </goals>
                         <configuration>
                            <instance>${basedir}/target/server1</instance>
                            <configuration>${basedir}/target/classes/activemq/server1</configuration>
-                           <portOffset>1</portOffset>
                         </configuration>
                      </execution>
                      <execution>
-                        <id>create3</id>
+                        <id>create2</id>
                         <goals>
                            <goal>create</goal>
                         </goals>
                         <configuration>
                            <instance>${basedir}/target/server2</instance>
                            <configuration>${basedir}/target/classes/activemq/server2</configuration>
-                           <portOffset>2</portOffset>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>start0</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
+                           <spawn>true</spawn>
+                           <location>${basedir}/target/server0</location>
+                           <testURI>tcp://localhost:61616</testURI>
+                           <args>
+                              <param>run</param>
+                           </args>
+                           <name>server0</name>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>start1</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
+                           <spawn>true</spawn>
+                           <location>${basedir}/target/server1</location>
+                           <testURI>tcp://localhost:61617</testURI>
+                           <args>
+                              <param>run</param>
+                           </args>
+                           <name>server1</name>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>start2</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
+                           <spawn>true</spawn>
+                           <location>${basedir}/target/server2</location>
+                           <testURI>tcp://localhost:61618</testURI>
+                           <args>
+                              <param>run</param>
+                           </args>
+                           <name>server2</name>
                         </configuration>
                      </execution>
                      <execution>
@@ -95,10 +133,41 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.ClusteredStandaloneExample</clientClass>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>stop0</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
+                           <location>${basedir}/target/server0</location>
+                           <args>
+                              <param>stop</param>
+                           </args>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>stop1</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
+                           <location>${basedir}/target/server1</location>
+                           <args>
+                              <param>stop</param>
+                           </args>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>stop2</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
+                           <location>${basedir}/target/server2</location>
                            <args>
-                              <param>${basedir}/target/server0</param>
-                              <param>${basedir}/target/server1</param>
-                              <param>${basedir}/target/server2</param>
+                              <param>stop</param>
                            </args>
                         </configuration>
                      </execution>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/clustered-standalone/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredStandaloneExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-standalone/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredStandaloneExample.java b/examples/jms/clustered-standalone/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredStandaloneExample.java
index 9437a8c..59427f8 100644
--- a/examples/jms/clustered-standalone/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredStandaloneExample.java
+++ b/examples/jms/clustered-standalone/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredStandaloneExample.java
@@ -26,17 +26,9 @@ import javax.jms.Topic;
 import javax.naming.InitialContext;
 import java.util.Hashtable;
 
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
-
-public class ClusteredStandaloneExample extends ActiveMQExample
+public class ClusteredStandaloneExample
 {
-   public static void main(final String[] args)
-   {
-      new ClusteredStandaloneExample().run(args);
-   }
-
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(final String[] args) throws Exception
    {
       Connection connection0 = null;
 
@@ -52,18 +44,18 @@ public class ClusteredStandaloneExample extends ActiveMQExample
       {
          Hashtable<String, Object> properties = new Hashtable<String, Object>();
          properties.put("java.naming.factory.initial", "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory");
-         properties.put("connectionFactory.ConnectionFactory", DEFAULT_TCP1);
+         properties.put("connectionFactory.ConnectionFactory", "tcp://localhost:61616");
          properties.put("topic.topic/exampleTopic", "exampleTopic");
          initialContext0 = new InitialContext(properties);
 
          properties = new Hashtable<String, Object>();
          properties.put("java.naming.factory.initial", "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory");
-         properties.put("connectionFactory.ConnectionFactory", DEFAULT_TCP2);
+         properties.put("connectionFactory.ConnectionFactory", "tcp://localhost:61617");
          initialContext1 = new InitialContext(properties);
 
          properties = new Hashtable<String, Object>();
          properties.put("java.naming.factory.initial", "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory");
-         properties.put("connectionFactory.ConnectionFactory", DEFAULT_TCP3);
+         properties.put("connectionFactory.ConnectionFactory", "tcp://localhost:61618");
          initialContext2 = new InitialContext(properties);
 
          // First we demonstrate a distributed topic.
@@ -125,7 +117,7 @@ public class ClusteredStandaloneExample extends ActiveMQExample
 
             if (message0 == null)
             {
-               return false;
+               throw new IllegalStateException();
             }
 
             // System.out.println("Received message " + message0.getText());
@@ -134,7 +126,7 @@ public class ClusteredStandaloneExample extends ActiveMQExample
 
             if (message1 == null)
             {
-               return false;
+               throw new IllegalStateException();
             }
 
             // System.out.println("Received message " + message1.getText());
@@ -143,7 +135,7 @@ public class ClusteredStandaloneExample extends ActiveMQExample
 
             if (message2 == null)
             {
-               return false;
+               throw new IllegalStateException();
             }
 
             System.out.println("Received message " + message2.getText());
@@ -156,8 +148,6 @@ public class ClusteredStandaloneExample extends ActiveMQExample
          messageConsumer1.close();
 
          messageConsumer2.close();
-
-         return true;
       }
       finally
       {
@@ -188,5 +178,4 @@ public class ClusteredStandaloneExample extends ActiveMQExample
          }
       }
    }
-
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/clustered-standalone/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-standalone/src/main/resources/activemq/server0/artemis-roles.properties b/examples/jms/clustered-standalone/src/main/resources/activemq/server0/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/clustered-standalone/src/main/resources/activemq/server0/artemis-roles.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-## ---------------------------------------------------------------------------
-## Licensed to the Apache Software Foundation (ASF) under one or more
-## contributor license agreements.  See the NOTICE file distributed with
-## this work for additional information regarding copyright ownership.
-## The ASF licenses this file to You under the Apache License, Version 2.0
-## (the "License"); you may not use this file except in compliance with
-## the License.  You may obtain a copy of the License at
-##
-## http://www.apache.org/licenses/LICENSE-2.0
-##
-## Unless required by applicable law or agreed to in writing, software
-## distributed under the License is distributed on an "AS IS" BASIS,
-## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-## See the License for the specific language governing permissions and
-## limitations under the License.
-## ---------------------------------------------------------------------------
-guest=guest
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/clustered-standalone/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-standalone/src/main/resources/activemq/server0/artemis-users.properties b/examples/jms/clustered-standalone/src/main/resources/activemq/server0/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/clustered-standalone/src/main/resources/activemq/server0/artemis-users.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-## ---------------------------------------------------------------------------
-## Licensed to the Apache Software Foundation (ASF) under one or more
-## contributor license agreements.  See the NOTICE file distributed with
-## this work for additional information regarding copyright ownership.
-## The ASF licenses this file to You under the Apache License, Version 2.0
-## (the "License"); you may not use this file except in compliance with
-## the License.  You may obtain a copy of the License at
-##
-## http://www.apache.org/licenses/LICENSE-2.0
-##
-## Unless required by applicable law or agreed to in writing, software
-## distributed under the License is distributed on an "AS IS" BASIS,
-## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-## See the License for the specific language governing permissions and
-## limitations under the License.
-## ---------------------------------------------------------------------------
-guest=guest
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/clustered-standalone/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-standalone/src/main/resources/activemq/server0/broker.xml b/examples/jms/clustered-standalone/src/main/resources/activemq/server0/broker.xml
index 16f5002..55675d0 100644
--- a/examples/jms/clustered-standalone/src/main/resources/activemq/server0/broker.xml
+++ b/examples/jms/clustered-standalone/src/main/resources/activemq/server0/broker.xml
@@ -29,14 +29,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
+      <bindings-directory>${data.dir:./data}/bindings</bindings-directory>
 
-      <bindings-directory>target/server0/data/messaging/bindings</bindings-directory>
+      <journal-directory>${data.dir:./data}/journal</journal-directory>
 
-      <journal-directory>target/server0/data/messaging/journal</journal-directory>
+      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
 
-      <large-messages-directory>target/server0/data/messaging/largemessages</large-messages-directory>
-
-      <paging-directory>target/server0/data/messaging/paging</paging-directory>
+      <paging-directory>${data.dir:./data}/paging</paging-directory>
       <!-- Connectors -->
 
       <connectors>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/clustered-standalone/src/main/resources/activemq/server1/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-standalone/src/main/resources/activemq/server1/artemis-roles.properties b/examples/jms/clustered-standalone/src/main/resources/activemq/server1/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/clustered-standalone/src/main/resources/activemq/server1/artemis-roles.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-## ---------------------------------------------------------------------------
-## Licensed to the Apache Software Foundation (ASF) under one or more
-## contributor license agreements.  See the NOTICE file distributed with
-## this work for additional information regarding copyright ownership.
-## The ASF licenses this file to You under the Apache License, Version 2.0
-## (the "License"); you may not use this file except in compliance with
-## the License.  You may obtain a copy of the License at
-##
-## http://www.apache.org/licenses/LICENSE-2.0
-##
-## Unless required by applicable law or agreed to in writing, software
-## distributed under the License is distributed on an "AS IS" BASIS,
-## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-## See the License for the specific language governing permissions and
-## limitations under the License.
-## ---------------------------------------------------------------------------
-guest=guest
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/clustered-standalone/src/main/resources/activemq/server1/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-standalone/src/main/resources/activemq/server1/artemis-users.properties b/examples/jms/clustered-standalone/src/main/resources/activemq/server1/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/clustered-standalone/src/main/resources/activemq/server1/artemis-users.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-## ---------------------------------------------------------------------------
-## Licensed to the Apache Software Foundation (ASF) under one or more
-## contributor license agreements.  See the NOTICE file distributed with
-## this work for additional information regarding copyright ownership.
-## The ASF licenses this file to You under the Apache License, Version 2.0
-## (the "License"); you may not use this file except in compliance with
-## the License.  You may obtain a copy of the License at
-##
-## http://www.apache.org/licenses/LICENSE-2.0
-##
-## Unless required by applicable law or agreed to in writing, software
-## distributed under the License is distributed on an "AS IS" BASIS,
-## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-## See the License for the specific language governing permissions and
-## limitations under the License.
-## ---------------------------------------------------------------------------
-guest=guest
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/clustered-standalone/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-standalone/src/main/resources/activemq/server1/broker.xml b/examples/jms/clustered-standalone/src/main/resources/activemq/server1/broker.xml
index 33f9cf4..78b0f2f 100644
--- a/examples/jms/clustered-standalone/src/main/resources/activemq/server1/broker.xml
+++ b/examples/jms/clustered-standalone/src/main/resources/activemq/server1/broker.xml
@@ -29,14 +29,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
+      <bindings-directory>${data.dir:./data}/bindings</bindings-directory>
 
-      <bindings-directory>target/server1/data/messaging/bindings</bindings-directory>
+      <journal-directory>${data.dir:./data}/journal</journal-directory>
 
-      <journal-directory>target/server1/data/messaging/journal</journal-directory>
+      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
 
-      <large-messages-directory>target/server1/data/messaging/largemessages</large-messages-directory>
-
-      <paging-directory>target/server1/data/messaging/paging</paging-directory>
+      <paging-directory>${data.dir:./data}/paging</paging-directory>
 
       <!-- Connectors -->
       <connectors>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/clustered-standalone/src/main/resources/activemq/server2/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-standalone/src/main/resources/activemq/server2/artemis-roles.properties b/examples/jms/clustered-standalone/src/main/resources/activemq/server2/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/clustered-standalone/src/main/resources/activemq/server2/artemis-roles.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-## ---------------------------------------------------------------------------
-## Licensed to the Apache Software Foundation (ASF) under one or more
-## contributor license agreements.  See the NOTICE file distributed with
-## this work for additional information regarding copyright ownership.
-## The ASF licenses this file to You under the Apache License, Version 2.0
-## (the "License"); you may not use this file except in compliance with
-## the License.  You may obtain a copy of the License at
-##
-## http://www.apache.org/licenses/LICENSE-2.0
-##
-## Unless required by applicable law or agreed to in writing, software
-## distributed under the License is distributed on an "AS IS" BASIS,
-## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-## See the License for the specific language governing permissions and
-## limitations under the License.
-## ---------------------------------------------------------------------------
-guest=guest
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/clustered-standalone/src/main/resources/activemq/server2/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-standalone/src/main/resources/activemq/server2/artemis-users.properties b/examples/jms/clustered-standalone/src/main/resources/activemq/server2/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/clustered-standalone/src/main/resources/activemq/server2/artemis-users.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-## ---------------------------------------------------------------------------
-## Licensed to the Apache Software Foundation (ASF) under one or more
-## contributor license agreements.  See the NOTICE file distributed with
-## this work for additional information regarding copyright ownership.
-## The ASF licenses this file to You under the Apache License, Version 2.0
-## (the "License"); you may not use this file except in compliance with
-## the License.  You may obtain a copy of the License at
-##
-## http://www.apache.org/licenses/LICENSE-2.0
-##
-## Unless required by applicable law or agreed to in writing, software
-## distributed under the License is distributed on an "AS IS" BASIS,
-## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-## See the License for the specific language governing permissions and
-## limitations under the License.
-## ---------------------------------------------------------------------------
-guest=guest
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/clustered-standalone/src/main/resources/activemq/server2/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-standalone/src/main/resources/activemq/server2/broker.xml b/examples/jms/clustered-standalone/src/main/resources/activemq/server2/broker.xml
index 3275f28..389914c 100644
--- a/examples/jms/clustered-standalone/src/main/resources/activemq/server2/broker.xml
+++ b/examples/jms/clustered-standalone/src/main/resources/activemq/server2/broker.xml
@@ -29,14 +29,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
+      <bindings-directory>${data.dir:./data}/bindings</bindings-directory>
 
-      <bindings-directory>target/server2/data/messaging/bindings</bindings-directory>
+      <journal-directory>${data.dir:./data}/journal</journal-directory>
 
-      <journal-directory>target/server2/data/messaging/journal</journal-directory>
+      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
 
-      <large-messages-directory>target/server2/data/messaging/largemessages</large-messages-directory>
-
-      <paging-directory>target/server2/data/messaging/paging</paging-directory>
+      <paging-directory>${data.dir:./data}/paging</paging-directory>
 
       <!-- Connectors -->
       <connectors>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/clustered-static-discovery/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-static-discovery/pom.xml b/examples/jms/clustered-static-discovery/pom.xml
index 597bdfb..98fcc90 100644
--- a/examples/jms/clustered-static-discovery/pom.xml
+++ b/examples/jms/clustered-static-discovery/pom.xml
@@ -37,8 +37,8 @@ under the License.
 
    <dependencies>
       <dependency>
-         <groupId>org.apache.activemq.examples.jms</groupId>
-         <artifactId>common</artifactId>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-cli</artifactId>
          <version>${project.version}</version>
       </dependency>
       <dependency>
@@ -57,7 +57,7 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>create</id>
+                        <id>create0</id>
                         <goals>
                            <goal>create</goal>
                         </goals>
@@ -67,36 +67,93 @@ under the License.
                         </configuration>
                      </execution>
                      <execution>
-                        <id>create2</id>
+                        <id>create1</id>
                         <goals>
                            <goal>create</goal>
                         </goals>
                         <configuration>
                            <instance>${basedir}/target/server1</instance>
                            <configuration>${basedir}/target/classes/activemq/server1</configuration>
-                           <portOffset>1</portOffset>
                         </configuration>
                      </execution>
                      <execution>
-                        <id>create3</id>
+                        <id>create2</id>
                         <goals>
                            <goal>create</goal>
                         </goals>
                         <configuration>
                            <instance>${basedir}/target/server2</instance>
                            <configuration>${basedir}/target/classes/activemq/server2</configuration>
-                           <portOffset>2</portOffset>
                         </configuration>
                      </execution>
                      <execution>
-                        <id>create4</id>
+                        <id>create3</id>
                         <goals>
                            <goal>create</goal>
                         </goals>
                         <configuration>
                            <instance>${basedir}/target/server3</instance>
                            <configuration>${basedir}/target/classes/activemq/server3</configuration>
-                           <portOffset>3</portOffset>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>start0</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
+                           <spawn>true</spawn>
+                           <location>${basedir}/target/server0</location>
+                           <testURI>tcp://localhost:61616</testURI>
+                           <args>
+                              <param>run</param>
+                           </args>
+                           <name>server0</name>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>start1</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
+                           <spawn>true</spawn>
+                           <location>${basedir}/target/server1</location>
+                           <testURI>tcp://localhost:61617</testURI>
+                           <args>
+                              <param>run</param>
+                           </args>
+                           <name>server1</name>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>start2</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
+                           <spawn>true</spawn>
+                           <location>${basedir}/target/server2</location>
+                           <testURI>tcp://localhost:61618</testURI>
+                           <args>
+                              <param>run</param>
+                           </args>
+                           <name>server2</name>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>start3</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
+                           <spawn>true</spawn>
+                           <location>${basedir}/target/server3</location>
+                           <testURI>tcp://localhost:61619</testURI>
+                           <args>
+                              <param>run</param>
+                           </args>
+                           <name>server3</name>
                         </configuration>
                      </execution>
                      <execution>
@@ -106,11 +163,53 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.StaticClusteredQueueExample</clientClass>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>stop0</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
+                           <location>${basedir}/target/server0</location>
+                           <args>
+                              <param>stop</param>
+                           </args>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>stop1</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
+                           <location>${basedir}/target/server1</location>
+                           <args>
+                              <param>stop</param>
+                           </args>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>stop2</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
+                           <location>${basedir}/target/server2</location>
+                           <args>
+                              <param>stop</param>
+                           </args>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>stop3</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
+                           <location>${basedir}/target/server3</location>
                            <args>
-                              <param>${basedir}/target/server0</param>
-                              <param>${basedir}/target/server1</param>
-                              <param>${basedir}/target/server2</param>
-                              <param>${basedir}/target/server3</param>
+                              <param>stop</param>
                            </args>
                         </configuration>
                      </execution>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/clustered-static-discovery/src/main/java/org/apache/activemq/artemis/jms/example/StaticClusteredQueueExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-static-discovery/src/main/java/org/apache/activemq/artemis/jms/example/StaticClusteredQueueExample.java b/examples/jms/clustered-static-discovery/src/main/java/org/apache/activemq/artemis/jms/example/StaticClusteredQueueExample.java
index c7c9efb..4e0ac26 100644
--- a/examples/jms/clustered-static-discovery/src/main/java/org/apache/activemq/artemis/jms/example/StaticClusteredQueueExample.java
+++ b/examples/jms/clustered-static-discovery/src/main/java/org/apache/activemq/artemis/jms/example/StaticClusteredQueueExample.java
@@ -16,6 +16,8 @@
  */
 package org.apache.activemq.artemis.jms.example;
 
+import org.apache.activemq.artemis.util.ServerUtil;
+
 import javax.jms.Connection;
 import javax.jms.ConnectionFactory;
 import javax.jms.MessageConsumer;
@@ -26,21 +28,13 @@ import javax.jms.TextMessage;
 import javax.naming.InitialContext;
 import java.util.Hashtable;
 
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
-
 /**
  * A simple example that demonstrates server side load-balancing of messages between the queue instances on different
  * nodes of the cluster. The cluster is created from a static list of nodes.
  */
-public class StaticClusteredQueueExample extends ActiveMQExample
+public class StaticClusteredQueueExample
 {
-   public static void main(final String[] args)
-   {
-      new StaticClusteredQueueExample().run(args);
-   }
-
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(final String[] args) throws Exception
    {
       Connection initialConnection = null;
 
@@ -59,7 +53,7 @@ public class StaticClusteredQueueExample extends ActiveMQExample
          // Step 1. Get an initial context for looking up JNDI from server 3
          Hashtable<String, Object> properties = new Hashtable<String, Object>();
          properties.put("java.naming.factory.initial", "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory");
-         properties.put("connectionFactory.ConnectionFactory", DEFAULT_TCP4);
+         properties.put("connectionFactory.ConnectionFactory", "tcp://localhost:61619");
          properties.put("queue.queue/exampleQueue", "exampleQueue");
          ic0 = new InitialContext(properties);
 
@@ -139,14 +133,14 @@ public class StaticClusteredQueueExample extends ActiveMQExample
          // We note the messages have been distributed between servers in a round robin fashion
          // JMS Queues implement point-to-point message where each message is only ever consumed by a
          // maximum of one consumer
-         int con0Node = getServer(connection0);
-         int con1Node = getServer(connection1);
-         int con2Node = getServer(connection2);
-         int con3Node = getServer(connection3);
+         int con0Node = ServerUtil.getServer(connection0);
+         int con1Node = ServerUtil.getServer(connection1);
+         int con2Node = ServerUtil.getServer(connection2);
+         int con3Node = ServerUtil.getServer(connection3);
 
          if(con0Node + con1Node + con2Node + con3Node != 6)
          {
-            return false;
+            throw new IllegalStateException();
          }
          for (int i = 0; i < numMessages; i += 4)
          {
@@ -166,8 +160,6 @@ public class StaticClusteredQueueExample extends ActiveMQExample
 
             System.out.println("Got message: " + message3.getText() + " from node " + con3Node);
          }
-
-         return true;
       }
       finally
       {
@@ -204,5 +196,4 @@ public class StaticClusteredQueueExample extends ActiveMQExample
          }
       }
    }
-
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/clustered-static-discovery/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-static-discovery/src/main/resources/activemq/server0/artemis-roles.properties b/examples/jms/clustered-static-discovery/src/main/resources/activemq/server0/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/clustered-static-discovery/src/main/resources/activemq/server0/artemis-roles.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-## ---------------------------------------------------------------------------
-## Licensed to the Apache Software Foundation (ASF) under one or more
-## contributor license agreements.  See the NOTICE file distributed with
-## this work for additional information regarding copyright ownership.
-## The ASF licenses this file to You under the Apache License, Version 2.0
-## (the "License"); you may not use this file except in compliance with
-## the License.  You may obtain a copy of the License at
-##
-## http://www.apache.org/licenses/LICENSE-2.0
-##
-## Unless required by applicable law or agreed to in writing, software
-## distributed under the License is distributed on an "AS IS" BASIS,
-## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-## See the License for the specific language governing permissions and
-## limitations under the License.
-## ---------------------------------------------------------------------------
-guest=guest
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/clustered-static-discovery/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-static-discovery/src/main/resources/activemq/server0/artemis-users.properties b/examples/jms/clustered-static-discovery/src/main/resources/activemq/server0/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/clustered-static-discovery/src/main/resources/activemq/server0/artemis-users.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-## ---------------------------------------------------------------------------
-## Licensed to the Apache Software Foundation (ASF) under one or more
-## contributor license agreements.  See the NOTICE file distributed with
-## this work for additional information regarding copyright ownership.
-## The ASF licenses this file to You under the Apache License, Version 2.0
-## (the "License"); you may not use this file except in compliance with
-## the License.  You may obtain a copy of the License at
-##
-## http://www.apache.org/licenses/LICENSE-2.0
-##
-## Unless required by applicable law or agreed to in writing, software
-## distributed under the License is distributed on an "AS IS" BASIS,
-## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-## See the License for the specific language governing permissions and
-## limitations under the License.
-## ---------------------------------------------------------------------------
-guest=guest
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/clustered-static-discovery/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-static-discovery/src/main/resources/activemq/server0/broker.xml b/examples/jms/clustered-static-discovery/src/main/resources/activemq/server0/broker.xml
index e751729..30bee5d 100644
--- a/examples/jms/clustered-static-discovery/src/main/resources/activemq/server0/broker.xml
+++ b/examples/jms/clustered-static-discovery/src/main/resources/activemq/server0/broker.xml
@@ -29,14 +29,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
+      <bindings-directory>${data.dir:./data}/bindings</bindings-directory>
 
-      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
+      <journal-directory>${data.dir:./data}/journal</journal-directory>
 
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
+      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
 
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
-
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
+      <paging-directory>${data.dir:./data}/paging</paging-directory>
 
       <!-- Connectors -->
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/clustered-static-discovery/src/main/resources/activemq/server1/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-static-discovery/src/main/resources/activemq/server1/artemis-roles.properties b/examples/jms/clustered-static-discovery/src/main/resources/activemq/server1/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/clustered-static-discovery/src/main/resources/activemq/server1/artemis-roles.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-## ---------------------------------------------------------------------------
-## Licensed to the Apache Software Foundation (ASF) under one or more
-## contributor license agreements.  See the NOTICE file distributed with
-## this work for additional information regarding copyright ownership.
-## The ASF licenses this file to You under the Apache License, Version 2.0
-## (the "License"); you may not use this file except in compliance with
-## the License.  You may obtain a copy of the License at
-##
-## http://www.apache.org/licenses/LICENSE-2.0
-##
-## Unless required by applicable law or agreed to in writing, software
-## distributed under the License is distributed on an "AS IS" BASIS,
-## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-## See the License for the specific language governing permissions and
-## limitations under the License.
-## ---------------------------------------------------------------------------
-guest=guest
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/clustered-static-discovery/src/main/resources/activemq/server1/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-static-discovery/src/main/resources/activemq/server1/artemis-users.properties b/examples/jms/clustered-static-discovery/src/main/resources/activemq/server1/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/clustered-static-discovery/src/main/resources/activemq/server1/artemis-users.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-## ---------------------------------------------------------------------------
-## Licensed to the Apache Software Foundation (ASF) under one or more
-## contributor license agreements.  See the NOTICE file distributed with
-## this work for additional information regarding copyright ownership.
-## The ASF licenses this file to You under the Apache License, Version 2.0
-## (the "License"); you may not use this file except in compliance with
-## the License.  You may obtain a copy of the License at
-##
-## http://www.apache.org/licenses/LICENSE-2.0
-##
-## Unless required by applicable law or agreed to in writing, software
-## distributed under the License is distributed on an "AS IS" BASIS,
-## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-## See the License for the specific language governing permissions and
-## limitations under the License.
-## ---------------------------------------------------------------------------
-guest=guest
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/clustered-static-discovery/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-static-discovery/src/main/resources/activemq/server1/broker.xml b/examples/jms/clustered-static-discovery/src/main/resources/activemq/server1/broker.xml
index 8e48890..f2f2565 100644
--- a/examples/jms/clustered-static-discovery/src/main/resources/activemq/server1/broker.xml
+++ b/examples/jms/clustered-static-discovery/src/main/resources/activemq/server1/broker.xml
@@ -29,14 +29,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
+      <bindings-directory>${data.dir:./data}/bindings</bindings-directory>
 
-      <bindings-directory>${data.dir}/server1/data/messaging/bindings</bindings-directory>
+      <journal-directory>${data.dir:./data}/journal</journal-directory>
 
-      <journal-directory>${data.dir}/server1/data/messaging/journal</journal-directory>
+      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
 
-      <large-messages-directory>${data.dir}/server1/data/messaging/largemessages</large-messages-directory>
-
-      <paging-directory>${data.dir}/server1/data/messaging/paging</paging-directory>
+      <paging-directory>${data.dir:./data}/paging</paging-directory>
 
       <!-- Connectors -->
       <connectors>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/clustered-static-discovery/src/main/resources/activemq/server2/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-static-discovery/src/main/resources/activemq/server2/artemis-roles.properties b/examples/jms/clustered-static-discovery/src/main/resources/activemq/server2/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/clustered-static-discovery/src/main/resources/activemq/server2/artemis-roles.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-## ---------------------------------------------------------------------------
-## Licensed to the Apache Software Foundation (ASF) under one or more
-## contributor license agreements.  See the NOTICE file distributed with
-## this work for additional information regarding copyright ownership.
-## The ASF licenses this file to You under the Apache License, Version 2.0
-## (the "License"); you may not use this file except in compliance with
-## the License.  You may obtain a copy of the License at
-##
-## http://www.apache.org/licenses/LICENSE-2.0
-##
-## Unless required by applicable law or agreed to in writing, software
-## distributed under the License is distributed on an "AS IS" BASIS,
-## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-## See the License for the specific language governing permissions and
-## limitations under the License.
-## ---------------------------------------------------------------------------
-guest=guest
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/clustered-static-discovery/src/main/resources/activemq/server2/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-static-discovery/src/main/resources/activemq/server2/artemis-users.properties b/examples/jms/clustered-static-discovery/src/main/resources/activemq/server2/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/clustered-static-discovery/src/main/resources/activemq/server2/artemis-users.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-## ---------------------------------------------------------------------------
-## Licensed to the Apache Software Foundation (ASF) under one or more
-## contributor license agreements.  See the NOTICE file distributed with
-## this work for additional information regarding copyright ownership.
-## The ASF licenses this file to You under the Apache License, Version 2.0
-## (the "License"); you may not use this file except in compliance with
-## the License.  You may obtain a copy of the License at
-##
-## http://www.apache.org/licenses/LICENSE-2.0
-##
-## Unless required by applicable law or agreed to in writing, software
-## distributed under the License is distributed on an "AS IS" BASIS,
-## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-## See the License for the specific language governing permissions and
-## limitations under the License.
-## ---------------------------------------------------------------------------
-guest=guest
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/clustered-static-discovery/src/main/resources/activemq/server2/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-static-discovery/src/main/resources/activemq/server2/broker.xml b/examples/jms/clustered-static-discovery/src/main/resources/activemq/server2/broker.xml
index 9321799..e9e5f08 100644
--- a/examples/jms/clustered-static-discovery/src/main/resources/activemq/server2/broker.xml
+++ b/examples/jms/clustered-static-discovery/src/main/resources/activemq/server2/broker.xml
@@ -26,14 +26,13 @@
 
    <core xmlns="urn:activemq:core">
 
+      <bindings-directory>${data.dir:./data}/bindings</bindings-directory>
 
-      <bindings-directory>${data.dir}/server2/data/messaging/bindings</bindings-directory>
+      <journal-directory>${data.dir:./data}/journal</journal-directory>
 
-      <journal-directory>${data.dir}/server2/data/messaging/journal</journal-directory>
+      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
 
-      <large-messages-directory>${data.dir}/server2/data/messaging/largemessages</large-messages-directory>
-
-      <paging-directory>${data.dir}/server2/data/messaging/paging</paging-directory>
+      <paging-directory>${data.dir:./data}/paging</paging-directory>
 
       <!-- Connectors -->
       <connectors>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/clustered-static-discovery/src/main/resources/activemq/server3/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-static-discovery/src/main/resources/activemq/server3/artemis-roles.properties b/examples/jms/clustered-static-discovery/src/main/resources/activemq/server3/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/clustered-static-discovery/src/main/resources/activemq/server3/artemis-roles.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-## ---------------------------------------------------------------------------
-## Licensed to the Apache Software Foundation (ASF) under one or more
-## contributor license agreements.  See the NOTICE file distributed with
-## this work for additional information regarding copyright ownership.
-## The ASF licenses this file to You under the Apache License, Version 2.0
-## (the "License"); you may not use this file except in compliance with
-## the License.  You may obtain a copy of the License at
-##
-## http://www.apache.org/licenses/LICENSE-2.0
-##
-## Unless required by applicable law or agreed to in writing, software
-## distributed under the License is distributed on an "AS IS" BASIS,
-## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-## See the License for the specific language governing permissions and
-## limitations under the License.
-## ---------------------------------------------------------------------------
-guest=guest
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/clustered-static-discovery/src/main/resources/activemq/server3/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-static-discovery/src/main/resources/activemq/server3/artemis-users.properties b/examples/jms/clustered-static-discovery/src/main/resources/activemq/server3/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/clustered-static-discovery/src/main/resources/activemq/server3/artemis-users.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-## ---------------------------------------------------------------------------
-## Licensed to the Apache Software Foundation (ASF) under one or more
-## contributor license agreements.  See the NOTICE file distributed with
-## this work for additional information regarding copyright ownership.
-## The ASF licenses this file to You under the Apache License, Version 2.0
-## (the "License"); you may not use this file except in compliance with
-## the License.  You may obtain a copy of the License at
-##
-## http://www.apache.org/licenses/LICENSE-2.0
-##
-## Unless required by applicable law or agreed to in writing, software
-## distributed under the License is distributed on an "AS IS" BASIS,
-## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-## See the License for the specific language governing permissions and
-## limitations under the License.
-## ---------------------------------------------------------------------------
-guest=guest
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/clustered-static-discovery/src/main/resources/activemq/server3/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-static-discovery/src/main/resources/activemq/server3/broker.xml b/examples/jms/clustered-static-discovery/src/main/resources/activemq/server3/broker.xml
index c8879a4..0ebc2d0 100644
--- a/examples/jms/clustered-static-discovery/src/main/resources/activemq/server3/broker.xml
+++ b/examples/jms/clustered-static-discovery/src/main/resources/activemq/server3/broker.xml
@@ -26,14 +26,13 @@
 
    <core xmlns="urn:activemq:core">
 
+      <bindings-directory>${data.dir:./data}/bindings</bindings-directory>
 
-      <bindings-directory>${data.dir}/server3/data/messaging/bindings</bindings-directory>
+      <journal-directory>${data.dir:./data}/journal</journal-directory>
 
-      <journal-directory>${data.dir}/server3/data/messaging/journal</journal-directory>
+      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
 
-      <large-messages-directory>${data.dir}/server3/data/messaging/largemessages</large-messages-directory>
-
-      <paging-directory>${data.dir}/server3/data/messaging/paging</paging-directory>
+      <paging-directory>${data.dir:./data}/paging</paging-directory>
 
       <!-- Connectors -->
       <connectors>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/clustered-static-oneway/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-static-oneway/pom.xml b/examples/jms/clustered-static-oneway/pom.xml
index 1c44be4..991a624 100644
--- a/examples/jms/clustered-static-oneway/pom.xml
+++ b/examples/jms/clustered-static-oneway/pom.xml
@@ -37,8 +37,8 @@ under the License.
 
    <dependencies>
       <dependency>
-         <groupId>org.apache.activemq.examples.jms</groupId>
-         <artifactId>common</artifactId>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-cli</artifactId>
          <version>${project.version}</version>
       </dependency>
       <dependency>
@@ -57,7 +57,7 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>create</id>
+                        <id>create0</id>
                         <goals>
                            <goal>create</goal>
                         </goals>
@@ -67,7 +67,7 @@ under the License.
                         </configuration>
                      </execution>
                      <execution>
-                        <id>create2</id>
+                        <id>create1</id>
                         <goals>
                            <goal>create</goal>
                         </goals>
@@ -77,7 +77,7 @@ under the License.
                         </configuration>
                      </execution>
                      <execution>
-                        <id>create3</id>
+                        <id>create2</id>
                         <goals>
                            <goal>create</goal>
                         </goals>
@@ -87,16 +87,92 @@ under the License.
                         </configuration>
                      </execution>
                      <execution>
+                        <id>start0</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
+                           <spawn>true</spawn>
+                           <location>${basedir}/target/server0</location>
+                           <testURI>tcp://localhost:61616</testURI>
+                           <args>
+                              <param>run</param>
+                           </args>
+                           <name>server0</name>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>start1</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
+                           <spawn>true</spawn>
+                           <location>${basedir}/target/server1</location>
+                           <testURI>tcp://localhost:61617</testURI>
+                           <args>
+                              <param>run</param>
+                           </args>
+                           <name>server1</name>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>start2</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
+                           <spawn>true</spawn>
+                           <location>${basedir}/target/server2</location>
+                           <testURI>tcp://localhost:61618</testURI>
+                           <args>
+                              <param>run</param>
+                           </args>
+                           <name>server2</name>
+                        </configuration>
+                     </execution>
+                     <execution>
                         <id>runClient</id>
                         <goals>
                            <goal>runClient</goal>
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.ClusterStaticOnewayExample</clientClass>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>stop0</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
+                           <location>${basedir}/target/server0</location>
+                           <args>
+                              <param>stop</param>
+                           </args>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>stop1</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
+                           <location>${basedir}/target/server1</location>
+                           <args>
+                              <param>stop</param>
+                           </args>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>stop2</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
+                           <location>${basedir}/target/server2</location>
                            <args>
-                              <param>${basedir}/target/server0</param>
-                              <param>${basedir}/target/server1</param>
-                              <param>${basedir}/target/server2</param>
+                              <param>stop</param>
                            </args>
                         </configuration>
                      </execution>
@@ -113,5 +189,4 @@ under the License.
          </build>
       </profile>
    </profiles>
-
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/clustered-static-oneway/src/main/java/org/apache/activemq/artemis/jms/example/ClusterStaticOnewayExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-static-oneway/src/main/java/org/apache/activemq/artemis/jms/example/ClusterStaticOnewayExample.java b/examples/jms/clustered-static-oneway/src/main/java/org/apache/activemq/artemis/jms/example/ClusterStaticOnewayExample.java
index fd1f4e5..e061722 100644
--- a/examples/jms/clustered-static-oneway/src/main/java/org/apache/activemq/artemis/jms/example/ClusterStaticOnewayExample.java
+++ b/examples/jms/clustered-static-oneway/src/main/java/org/apache/activemq/artemis/jms/example/ClusterStaticOnewayExample.java
@@ -16,6 +16,8 @@
  */
 package org.apache.activemq.artemis.jms.example;
 
+import org.apache.activemq.artemis.util.ServerUtil;
+
 import javax.jms.Connection;
 import javax.jms.ConnectionFactory;
 import javax.jms.MessageConsumer;
@@ -26,21 +28,13 @@ import javax.jms.TextMessage;
 import javax.naming.InitialContext;
 import java.util.Hashtable;
 
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
-
 /**
  * A simple example that demonstrates server side load-balancing of messages between the queue instances on different
  * nodes of the cluster. The cluster is created from a static list of nodes.
  */
-public class ClusterStaticOnewayExample extends ActiveMQExample
+public class ClusterStaticOnewayExample
 {
-   public static void main(final String[] args)
-   {
-      new ClusterStaticOnewayExample().run(args);
-   }
-
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(final String[] args) throws Exception
    {
       Connection initialConnection = null;
 
@@ -51,13 +45,13 @@ public class ClusterStaticOnewayExample extends ActiveMQExample
       Connection connection2 = null;
 
       InitialContext ic0 = null;
-      Thread.sleep(5000);
+
       try
       {
          // Step 1. Get an initial context for looking up JNDI from server 0
          Hashtable<String, Object> properties = new Hashtable<String, Object>();
          properties.put("java.naming.factory.initial", "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory");
-         properties.put("connectionFactory.ConnectionFactory", DEFAULT_TCP1);
+         properties.put("connectionFactory.ConnectionFactory", "tcp://localhost:61616");
          properties.put("queue.queue/exampleQueue", "exampleQueue");
          ic0 = new InitialContext(properties);
 
@@ -106,9 +100,9 @@ public class ClusterStaticOnewayExample extends ActiveMQExample
 
          Thread.sleep(4000);
 
-         int con0Node = getServer(connection0);
-         int con1Node = getServer(connection1);
-         int con2Node = getServer(connection2);
+         int con0Node = ServerUtil.getServer(connection0);
+         int con1Node = ServerUtil.getServer(connection1);
+         int con2Node = ServerUtil.getServer(connection2);
 
          System.out.println("con0Node = " + con0Node);
          System.out.println("con1Node = " + con1Node);
@@ -116,11 +110,10 @@ public class ClusterStaticOnewayExample extends ActiveMQExample
 
          if(con0Node + con1Node + con2Node != 3)
          {
-            System.out.println("connections not load balanced");
-            return false;
+            throw new IllegalStateException("connections not load balanced");
          }
          // Step 13. We create a JMS MessageProducer object on server 0
-         Session sendSession = getServerConnection(0, connection0, connection1, connection2).createSession(false, Session.AUTO_ACKNOWLEDGE);
+         Session sendSession = ServerUtil.getServerConnection(0, connection0, connection1, connection2).createSession(false, Session.AUTO_ACKNOWLEDGE);
 
          MessageProducer producer = sendSession.createProducer(queue);
 
@@ -156,8 +149,6 @@ public class ClusterStaticOnewayExample extends ActiveMQExample
 
             System.out.println("Got message: " + message2.getText() + " from node " + con2Node);
          }
-
-         return true;
       }
       finally
       {
@@ -189,5 +180,4 @@ public class ClusterStaticOnewayExample extends ActiveMQExample
          }
       }
    }
-
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/clustered-static-oneway/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-static-oneway/src/main/resources/activemq/server0/artemis-roles.properties b/examples/jms/clustered-static-oneway/src/main/resources/activemq/server0/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/clustered-static-oneway/src/main/resources/activemq/server0/artemis-roles.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-## ---------------------------------------------------------------------------
-## Licensed to the Apache Software Foundation (ASF) under one or more
-## contributor license agreements.  See the NOTICE file distributed with
-## this work for additional information regarding copyright ownership.
-## The ASF licenses this file to You under the Apache License, Version 2.0
-## (the "License"); you may not use this file except in compliance with
-## the License.  You may obtain a copy of the License at
-##
-## http://www.apache.org/licenses/LICENSE-2.0
-##
-## Unless required by applicable law or agreed to in writing, software
-## distributed under the License is distributed on an "AS IS" BASIS,
-## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-## See the License for the specific language governing permissions and
-## limitations under the License.
-## ---------------------------------------------------------------------------
-guest=guest
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/clustered-static-oneway/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-static-oneway/src/main/resources/activemq/server0/artemis-users.properties b/examples/jms/clustered-static-oneway/src/main/resources/activemq/server0/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/clustered-static-oneway/src/main/resources/activemq/server0/artemis-users.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-## ---------------------------------------------------------------------------
-## Licensed to the Apache Software Foundation (ASF) under one or more
-## contributor license agreements.  See the NOTICE file distributed with
-## this work for additional information regarding copyright ownership.
-## The ASF licenses this file to You under the Apache License, Version 2.0
-## (the "License"); you may not use this file except in compliance with
-## the License.  You may obtain a copy of the License at
-##
-## http://www.apache.org/licenses/LICENSE-2.0
-##
-## Unless required by applicable law or agreed to in writing, software
-## distributed under the License is distributed on an "AS IS" BASIS,
-## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-## See the License for the specific language governing permissions and
-## limitations under the License.
-## ---------------------------------------------------------------------------
-guest=guest
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/clustered-static-oneway/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-static-oneway/src/main/resources/activemq/server0/broker.xml b/examples/jms/clustered-static-oneway/src/main/resources/activemq/server0/broker.xml
index cace0be..2d77bb1 100644
--- a/examples/jms/clustered-static-oneway/src/main/resources/activemq/server0/broker.xml
+++ b/examples/jms/clustered-static-oneway/src/main/resources/activemq/server0/broker.xml
@@ -26,14 +26,13 @@
 
    <core xmlns="urn:activemq:core">
 
+      <bindings-directory>${data.dir:./data}/bindings</bindings-directory>
 
-      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
+      <journal-directory>${data.dir:./data}/journal</journal-directory>
 
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
+      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
 
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
-
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
+      <paging-directory>${data.dir:./data}/paging</paging-directory>
 
       <!-- Connectors -->
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/clustered-static-oneway/src/main/resources/activemq/server1/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-static-oneway/src/main/resources/activemq/server1/artemis-roles.properties b/examples/jms/clustered-static-oneway/src/main/resources/activemq/server1/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/clustered-static-oneway/src/main/resources/activemq/server1/artemis-roles.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-## ---------------------------------------------------------------------------
-## Licensed to the Apache Software Foundation (ASF) under one or more
-## contributor license agreements.  See the NOTICE file distributed with
-## this work for additional information regarding copyright ownership.
-## The ASF licenses this file to You under the Apache License, Version 2.0
-## (the "License"); you may not use this file except in compliance with
-## the License.  You may obtain a copy of the License at
-##
-## http://www.apache.org/licenses/LICENSE-2.0
-##
-## Unless required by applicable law or agreed to in writing, software
-## distributed under the License is distributed on an "AS IS" BASIS,
-## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-## See the License for the specific language governing permissions and
-## limitations under the License.
-## ---------------------------------------------------------------------------
-guest=guest
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/clustered-static-oneway/src/main/resources/activemq/server1/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-static-oneway/src/main/resources/activemq/server1/artemis-users.properties b/examples/jms/clustered-static-oneway/src/main/resources/activemq/server1/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/clustered-static-oneway/src/main/resources/activemq/server1/artemis-users.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-## ---------------------------------------------------------------------------
-## Licensed to the Apache Software Foundation (ASF) under one or more
-## contributor license agreements.  See the NOTICE file distributed with
-## this work for additional information regarding copyright ownership.
-## The ASF licenses this file to You under the Apache License, Version 2.0
-## (the "License"); you may not use this file except in compliance with
-## the License.  You may obtain a copy of the License at
-##
-## http://www.apache.org/licenses/LICENSE-2.0
-##
-## Unless required by applicable law or agreed to in writing, software
-## distributed under the License is distributed on an "AS IS" BASIS,
-## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-## See the License for the specific language governing permissions and
-## limitations under the License.
-## ---------------------------------------------------------------------------
-guest=guest
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/clustered-static-oneway/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-static-oneway/src/main/resources/activemq/server1/broker.xml b/examples/jms/clustered-static-oneway/src/main/resources/activemq/server1/broker.xml
index d6918f6..9b5fdf8 100644
--- a/examples/jms/clustered-static-oneway/src/main/resources/activemq/server1/broker.xml
+++ b/examples/jms/clustered-static-oneway/src/main/resources/activemq/server1/broker.xml
@@ -26,14 +26,13 @@
 
    <core xmlns="urn:activemq:core">
 
+      <bindings-directory>${data.dir:./data}/bindings</bindings-directory>
 
-      <bindings-directory>${data.dir}/server1/data/messaging/bindings</bindings-directory>
+      <journal-directory>${data.dir:./data}/journal</journal-directory>
 
-      <journal-directory>${data.dir}/server1/data/messaging/journal</journal-directory>
+      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
 
-      <large-messages-directory>${data.dir}/server1/data/messaging/largemessages</large-messages-directory>
-
-      <paging-directory>${data.dir}/server1/data/messaging/paging</paging-directory>
+      <paging-directory>${data.dir:./data}/paging</paging-directory>
 
       <!-- Connectors -->
       <connectors>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/clustered-static-oneway/src/main/resources/activemq/server2/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-static-oneway/src/main/resources/activemq/server2/artemis-roles.properties b/examples/jms/clustered-static-oneway/src/main/resources/activemq/server2/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/clustered-static-oneway/src/main/resources/activemq/server2/artemis-roles.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-## ---------------------------------------------------------------------------
-## Licensed to the Apache Software Foundation (ASF) under one or more
-## contributor license agreements.  See the NOTICE file distributed with
-## this work for additional information regarding copyright ownership.
-## The ASF licenses this file to You under the Apache License, Version 2.0
-## (the "License"); you may not use this file except in compliance with
-## the License.  You may obtain a copy of the License at
-##
-## http://www.apache.org/licenses/LICENSE-2.0
-##
-## Unless required by applicable law or agreed to in writing, software
-## distributed under the License is distributed on an "AS IS" BASIS,
-## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-## See the License for the specific language governing permissions and
-## limitations under the License.
-## ---------------------------------------------------------------------------
-guest=guest
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/clustered-static-oneway/src/main/resources/activemq/server2/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-static-oneway/src/main/resources/activemq/server2/artemis-users.properties b/examples/jms/clustered-static-oneway/src/main/resources/activemq/server2/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/clustered-static-oneway/src/main/resources/activemq/server2/artemis-users.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-## ---------------------------------------------------------------------------
-## Licensed to the Apache Software Foundation (ASF) under one or more
-## contributor license agreements.  See the NOTICE file distributed with
-## this work for additional information regarding copyright ownership.
-## The ASF licenses this file to You under the Apache License, Version 2.0
-## (the "License"); you may not use this file except in compliance with
-## the License.  You may obtain a copy of the License at
-##
-## http://www.apache.org/licenses/LICENSE-2.0
-##
-## Unless required by applicable law or agreed to in writing, software
-## distributed under the License is distributed on an "AS IS" BASIS,
-## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-## See the License for the specific language governing permissions and
-## limitations under the License.
-## ---------------------------------------------------------------------------
-guest=guest
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/clustered-static-oneway/src/main/resources/activemq/server2/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-static-oneway/src/main/resources/activemq/server2/broker.xml b/examples/jms/clustered-static-oneway/src/main/resources/activemq/server2/broker.xml
index 9f2e15a..147a9b9 100644
--- a/examples/jms/clustered-static-oneway/src/main/resources/activemq/server2/broker.xml
+++ b/examples/jms/clustered-static-oneway/src/main/resources/activemq/server2/broker.xml
@@ -26,14 +26,13 @@
 
    <core xmlns="urn:activemq:core">
 
+      <bindings-directory>${data.dir:./data}/bindings</bindings-directory>
 
-      <bindings-directory>${data.dir}/server2/data/messaging/bindings</bindings-directory>
+      <journal-directory>${data.dir:./data}/journal</journal-directory>
 
-      <journal-directory>${data.dir}/server2/data/messaging/journal</journal-directory>
+      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
 
-      <large-messages-directory>${data.dir}/server2/data/messaging/largemessages</large-messages-directory>
-
-      <paging-directory>${data.dir}/server2/data/messaging/paging</paging-directory>
+      <paging-directory>${data.dir:./data}/paging</paging-directory>
 
       <!-- Connectors -->
       <connectors>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/clustered-topic/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-topic/pom.xml b/examples/jms/clustered-topic/pom.xml
index 63a7c2b..418d98f 100644
--- a/examples/jms/clustered-topic/pom.xml
+++ b/examples/jms/clustered-topic/pom.xml
@@ -37,11 +37,6 @@ under the License.
 
    <dependencies>
       <dependency>
-         <groupId>org.apache.activemq.examples.jms</groupId>
-         <artifactId>common</artifactId>
-         <version>${project.version}</version>
-      </dependency>
-      <dependency>
          <groupId>org.apache.geronimo.specs</groupId>
          <artifactId>geronimo-jms_2.0_spec</artifactId>
       </dependency>
@@ -57,7 +52,7 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>create</id>
+                        <id>create0</id>
                         <goals>
                            <goal>create</goal>
                         </goals>
@@ -67,7 +62,7 @@ under the License.
                         </configuration>
                      </execution>
                      <execution>
-                        <id>create2</id>
+                        <id>create1</id>
                         <goals>
                            <goal>create</goal>
                         </goals>
@@ -77,15 +72,65 @@ under the License.
                         </configuration>
                      </execution>
                      <execution>
+                        <id>start0</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
+                           <spawn>true</spawn>
+                           <location>${basedir}/target/server0</location>
+                           <testURI>tcp://localhost:61616</testURI>
+                           <args>
+                              <param>run</param>
+                           </args>
+                           <name>server0</name>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>start1</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
+                           <spawn>true</spawn>
+                           <location>${basedir}/target/server1</location>
+                           <testURI>tcp://localhost:61617</testURI>
+                           <args>
+                              <param>run</param>
+                           </args>
+                           <name>server1</name>
+                        </configuration>
+                     </execution>
+                     <execution>
                         <id>runClient</id>
                         <goals>
                            <goal>runClient</goal>
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.ClusteredTopicExample</clientClass>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>stop0</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
+                           <location>${basedir}/target/server0</location>
+                           <args>
+                              <param>stop</param>
+                           </args>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>stop1</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
+                           <location>${basedir}/target/server1</location>
                            <args>
-                              <param>${basedir}/target/server0</param>
-                              <param>${basedir}/target/server1</param>
+                              <param>stop</param>
                            </args>
                         </configuration>
                      </execution>