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:07 UTC

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

Repository: activemq-artemis
Updated Branches:
  refs/heads/master c8d053ede -> 661f695ee


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/transactional/src/main/java/org/apache/activemq/artemis/jms/example/TransactionalExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/transactional/src/main/java/org/apache/activemq/artemis/jms/example/TransactionalExample.java b/examples/jms/transactional/src/main/java/org/apache/activemq/artemis/jms/example/TransactionalExample.java
index 56b21f5..794b76f 100644
--- a/examples/jms/transactional/src/main/java/org/apache/activemq/artemis/jms/example/TransactionalExample.java
+++ b/examples/jms/transactional/src/main/java/org/apache/activemq/artemis/jms/example/TransactionalExample.java
@@ -25,20 +25,12 @@ import javax.jms.Session;
 import javax.jms.TextMessage;
 import javax.naming.InitialContext;
 
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
-
 /**
  * A simple JMS example that sends and consume message transactionally.
  */
-public class TransactionalExample extends ActiveMQExample
+public class TransactionalExample
 {
-   public static void main(final String[] args)
-   {
-      new TransactionalExample().run(args);
-   }
-
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(final String[] args) throws Exception
    {
       Connection connection = null;
       InitialContext initialContext = null;
@@ -117,13 +109,11 @@ public class TransactionalExample extends ActiveMQExample
          if (receivedMessage != null)
          {
             // This was not supposed to happen
-            return false;
+            throw new IllegalStateException("Message is not null.");
          }
 
          System.out.println("Message received after receive commit: " + receivedMessage);
 
-         return true;
-
       }
       finally
       {
@@ -139,5 +129,4 @@ public class TransactionalExample extends ActiveMQExample
          }
       }
    }
-
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/transactional/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/transactional/src/main/resources/activemq/server0/artemis-roles.properties b/examples/jms/transactional/src/main/resources/activemq/server0/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/transactional/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/transactional/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/transactional/src/main/resources/activemq/server0/artemis-users.properties b/examples/jms/transactional/src/main/resources/activemq/server0/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/transactional/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/transactional/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/transactional/src/main/resources/activemq/server0/broker.xml b/examples/jms/transactional/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index 7690094..0000000
--- a/examples/jms/transactional/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,60 +0,0 @@
-<?xml version='1.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.
--->
-
-<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-               xmlns="urn:activemq"
-               xsi:schemaLocation="urn:activemq /schema/artemis-server.xsd">
-
-   <jms xmlns="urn:activemq:jms">
-      <!--the queue used by the example-->
-      <queue name="exampleQueue"/>
-   </jms>
-
-   <core xmlns="urn:activemq:core">
-
-      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
-
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
-
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
-
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
-      </acceptors>
-
-      <!-- Other config -->
-
-      <security-settings>
-         <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
-            <permission type="createDurableQueue" roles="guest"/>
-            <permission type="deleteDurableQueue" roles="guest"/>
-            <permission type="createNonDurableQueue" roles="guest"/>
-            <permission type="deleteNonDurableQueue" roles="guest"/>
-            <permission type="consume" roles="guest"/>
-            <permission type="send" roles="guest"/>
-         </security-setting>
-      </security-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/xa-heuristic/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/xa-heuristic/pom.xml b/examples/jms/xa-heuristic/pom.xml
index da401e3..ada7aaf 100644
--- a/examples/jms/xa-heuristic/pom.xml
+++ b/examples/jms/xa-heuristic/pom.xml
@@ -37,8 +37,13 @@ under the License.
 
    <dependencies>
       <dependency>
-         <groupId>org.apache.activemq.examples.jms</groupId>
-         <artifactId>common</artifactId>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-core-client</artifactId>
+         <version>${project.version}</version>
+      </dependency>
+      <dependency>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-commons</artifactId>
          <version>${project.version}</version>
       </dependency>
       <dependency>
@@ -62,20 +67,39 @@ under the License.
                            <goal>create</goal>
                         </goals>
                         <configuration>
-                           <instance>${basedir}/target/server0</instance>
-                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
                            <javaOptions>-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=3001 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false</javaOptions>
                         </configuration>
                      </execution>
                      <execution>
+                        <id>start</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
+                           <spawn>true</spawn>
+                           <testURI>tcp://localhost:61616</testURI>
+                           <args>
+                              <param>run</param>
+                           </args>
+                        </configuration>
+                     </execution>
+                     <execution>
                         <id>runClient</id>
                         <goals>
                            <goal>runClient</goal>
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.XAHeuristicExample</clientClass>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>stop</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
                            <args>
-                              <param>${basedir}/target/server0</param>
+                              <param>stop</param>
                            </args>
                         </configuration>
                      </execution>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/xa-heuristic/src/main/java/org/apache/activemq/artemis/jms/example/DummyXid.java
----------------------------------------------------------------------
diff --git a/examples/jms/xa-heuristic/src/main/java/org/apache/activemq/artemis/jms/example/DummyXid.java b/examples/jms/xa-heuristic/src/main/java/org/apache/activemq/artemis/jms/example/DummyXid.java
new file mode 100644
index 0000000..2b8a200
--- /dev/null
+++ b/examples/jms/xa-heuristic/src/main/java/org/apache/activemq/artemis/jms/example/DummyXid.java
@@ -0,0 +1,208 @@
+/*
+ * 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.
+ */
+package org.apache.activemq.artemis.jms.example;
+
+import javax.transaction.xa.Xid;
+
+import org.apache.activemq.artemis.utils.Base64;
+
+public class DummyXid implements Xid
+{
+   private static final long serialVersionUID = 407053232840068514L;
+
+   private final byte[] branchQualifier;
+
+   private final int formatId;
+
+   private final byte[] globalTransactionId;
+
+   private int hash;
+
+   private boolean hashCalculated;
+
+   // Static --------------------------------------------------------
+
+   public static String toBase64String(final Xid xid)
+   {
+      return Base64.encodeBytes(DummyXid.toByteArray(xid));
+   }
+
+   private static byte[] toByteArray(final Xid xid)
+   {
+      byte[] branchQualifier = xid.getBranchQualifier();
+      byte[] globalTransactionId = xid.getGlobalTransactionId();
+      int formatId = xid.getFormatId();
+
+      byte[] hashBytes = new byte[branchQualifier.length + globalTransactionId.length + 4];
+      System.arraycopy(branchQualifier, 0, hashBytes, 0, branchQualifier.length);
+      System.arraycopy(globalTransactionId, 0, hashBytes, branchQualifier.length, globalTransactionId.length);
+      byte[] intBytes = new byte[4];
+      for (int i = 0; i < 4; i++)
+      {
+         intBytes[i] = (byte)((formatId >> i * 8) % 0xFF);
+      }
+      System.arraycopy(intBytes, 0, hashBytes, branchQualifier.length + globalTransactionId.length, 4);
+      return hashBytes;
+   }
+
+   // Constructors --------------------------------------------------
+
+   /**
+    * Standard constructor
+    * @param branchQualifier
+    * @param formatId
+    * @param globalTransactionId
+    */
+   public DummyXid(final byte[] branchQualifier, final int formatId, final byte[] globalTransactionId)
+   {
+      this.branchQualifier = branchQualifier;
+      this.formatId = formatId;
+      this.globalTransactionId = globalTransactionId;
+   }
+
+   /**
+    * Copy constructor
+    * @param other
+    */
+   public DummyXid(final Xid other)
+   {
+      branchQualifier = copyBytes(other.getBranchQualifier());
+      formatId = other.getFormatId();
+      globalTransactionId = copyBytes(other.getGlobalTransactionId());
+   }
+
+   // Xid implementation ------------------------------------------------------------------
+
+   public byte[] getBranchQualifier()
+   {
+      return branchQualifier;
+   }
+
+   public int getFormatId()
+   {
+      return formatId;
+   }
+
+   public byte[] getGlobalTransactionId()
+   {
+      return globalTransactionId;
+   }
+
+   // Public -------------------------------------------------------------------------------
+
+   @Override
+   public int hashCode()
+   {
+      if (!hashCalculated)
+      {
+         calcHash();
+      }
+      return hash;
+   }
+
+   @Override
+   public boolean equals(final Object other)
+   {
+      if (this == other)
+      {
+         return true;
+      }
+      if (!(other instanceof Xid))
+      {
+         return false;
+      }
+      Xid xother = (Xid)other;
+      if (xother.getFormatId() != formatId)
+      {
+         return false;
+      }
+      if (xother.getBranchQualifier().length != branchQualifier.length)
+      {
+         return false;
+      }
+      if (xother.getGlobalTransactionId().length != globalTransactionId.length)
+      {
+         return false;
+      }
+      for (int i = 0; i < branchQualifier.length; i++)
+      {
+         byte[] otherBQ = xother.getBranchQualifier();
+         if (branchQualifier[i] != otherBQ[i])
+         {
+            return false;
+         }
+      }
+      for (int i = 0; i < globalTransactionId.length; i++)
+      {
+         byte[] otherGtx = xother.getGlobalTransactionId();
+         if (globalTransactionId[i] != otherGtx[i])
+         {
+            return false;
+         }
+      }
+      return true;
+   }
+
+   @Override
+   public String toString()
+   {
+      return "XidImpl (" + System.identityHashCode(this) +
+             " bq:" +
+             stringRep(branchQualifier) +
+             " formatID:" +
+             formatId +
+             " gtxid:" +
+             stringRep(globalTransactionId);
+   }
+
+   // Private -------------------------------------------------------------------------------
+
+   private String stringRep(final byte[] bytes)
+   {
+      StringBuilder buff = new StringBuilder();
+      for (int i = 0; i < bytes.length; i++)
+      {
+         byte b = bytes[i];
+
+         buff.append(b);
+
+         if (i != bytes.length - 1)
+         {
+            buff.append('.');
+         }
+      }
+
+      return buff.toString();
+   }
+
+   private void calcHash()
+   {
+      byte[] hashBytes = org.apache.activemq.artemis.jms.example.DummyXid.toByteArray(this);
+      String s = new String(hashBytes);
+      hash = s.hashCode();
+      hashCalculated = true;
+   }
+
+   private byte[] copyBytes(final byte[] other)
+   {
+      byte[] bytes = new byte[other.length];
+
+      System.arraycopy(other, 0, bytes, 0, other.length);
+
+      return bytes;
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/xa-heuristic/src/main/java/org/apache/activemq/artemis/jms/example/XAHeuristicExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/xa-heuristic/src/main/java/org/apache/activemq/artemis/jms/example/XAHeuristicExample.java b/examples/jms/xa-heuristic/src/main/java/org/apache/activemq/artemis/jms/example/XAHeuristicExample.java
index 09232e3..4da5c83 100644
--- a/examples/jms/xa-heuristic/src/main/java/org/apache/activemq/artemis/jms/example/XAHeuristicExample.java
+++ b/examples/jms/xa-heuristic/src/main/java/org/apache/activemq/artemis/jms/example/XAHeuristicExample.java
@@ -40,29 +40,19 @@ import java.util.ArrayList;
 import java.util.HashMap;
 
 import org.apache.activemq.artemis.api.core.management.ObjectNameBuilder;
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
-import org.apache.activemq.artemis.common.example.DummyXid;
 import org.apache.activemq.artemis.utils.UUIDGenerator;
 
 /**
  * A simple JMS example showing how to administer un-finished transactions.
  */
-public class XAHeuristicExample extends ActiveMQExample
+public class XAHeuristicExample
 {
-   private volatile boolean result = true;
-
-   private final ArrayList<String> receiveHolder = new ArrayList<String>();
-
    private static final String JMX_URL = "service:jmx:rmi:///jndi/rmi://localhost:3001/jmxrmi";
 
-   public static void main(final String[] args)
-   {
-      new XAHeuristicExample().run(args);
-   }
-
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(final String[] args) throws Exception
    {
+      Boolean result = true;
+      final ArrayList<String> receiveHolder = new ArrayList<String>();
       XAConnection connection = null;
       InitialContext initialContext = null;
       try
@@ -90,7 +80,7 @@ public class XAHeuristicExample extends ActiveMQExample
 
          // Step 8. Create a normal Message Consumer
          MessageConsumer normalConsumer = normalSession.createConsumer(queue);
-         normalConsumer.setMessageListener(new SimpleMessageListener());
+         normalConsumer.setMessageListener(new SimpleMessageListener(receiveHolder, result));
 
          // Step 9. Get the JMS Session
          Session session = xaSession.getSession();
@@ -104,8 +94,8 @@ public class XAHeuristicExample extends ActiveMQExample
 
          // Step 12. create a transaction
          Xid xid1 = new DummyXid("xa-example1".getBytes(StandardCharsets.ISO_8859_1), 1, UUIDGenerator.getInstance()
-                                                                           .generateStringUUID()
-                                                                           .getBytes());
+                 .generateStringUUID()
+                 .getBytes());
 
          // Step 13. Get the JMS XAResource
          XAResource xaRes = xaSession.getXAResource();
@@ -125,12 +115,12 @@ public class XAHeuristicExample extends ActiveMQExample
          xaRes.prepare(xid1);
 
          // Step 18. Check none should be received
-         checkNoMessageReceived();
+         checkNoMessageReceived(receiveHolder);
 
          // Step 19. Create another transaction.
          Xid xid2 = new DummyXid("xa-example2".getBytes(), 1, UUIDGenerator.getInstance()
-                                                                           .generateStringUUID()
-                                                                           .getBytes());
+                 .generateStringUUID()
+                 .getBytes());
 
          // Step 20. Begin the transaction work
          xaRes.start(xid2, XAResource.TMNOFLAGS);
@@ -147,7 +137,7 @@ public class XAHeuristicExample extends ActiveMQExample
          xaRes.prepare(xid2);
 
          // Step 24. Again, no messages should be received!
-         checkNoMessageReceived();
+         checkNoMessageReceived(receiveHolder);
 
          // Step 25. Create JMX Connector to connect to the server's MBeanServer
          JMXConnector connector = JMXConnectorFactory.connect(new JMXServiceURL(JMX_URL), new HashMap<String, String>());
@@ -180,7 +170,7 @@ public class XAHeuristicExample extends ActiveMQExample
          Thread.sleep(2000);
 
          // Step 30. Check the result, only the 'world' message received
-         checkMessageReceived("world");
+         checkMessageReceived("world", receiveHolder);
 
          // Step 31. Check the prepared transaction again, should have none.
          infos = (String[])mbsc.invoke(serverObject, "listPreparedTransactions", null, null);
@@ -188,8 +178,6 @@ public class XAHeuristicExample extends ActiveMQExample
 
          // Step 32. Close the JMX Connector
          connector.close();
-
-         return result;
       }
       finally
       {
@@ -205,48 +193,52 @@ public class XAHeuristicExample extends ActiveMQExample
       }
    }
 
-   private void checkMessageReceived(final String value)
+   private static void checkMessageReceived(final String value, ArrayList<String> receiveHolder)
    {
       if (receiveHolder.size() != 1)
       {
-         System.out.println("Number of messages received not correct ! -- " + receiveHolder.size());
-         result = false;
+         throw new IllegalStateException("Number of messages received not correct ! -- " + receiveHolder.size());
       }
       String msg = receiveHolder.get(0);
       if (!msg.equals(value))
       {
-         System.out.println("Received message [" + msg + "], but we expect [" + value + "]");
-         result = false;
+         throw new IllegalStateException("Received message [" + msg + "], but we expect [" + value + "]");
       }
       receiveHolder.clear();
    }
 
-   private void checkNoMessageReceived()
+   private static void checkNoMessageReceived(ArrayList<String> receiveHolder)
    {
       if (receiveHolder.size() > 0)
       {
-         System.out.println("Message received, wrong!");
-         result = false;
+         throw new IllegalStateException("Message received, wrong!");
       }
       receiveHolder.clear();
    }
+}
 
-   public class SimpleMessageListener implements MessageListener
+class SimpleMessageListener implements MessageListener
+{
+   ArrayList<String> receiveHolder;
+   Boolean result;
+
+   SimpleMessageListener(ArrayList<String> receiveHolder, Boolean result)
    {
-      public void onMessage(final Message message)
+      this.receiveHolder = receiveHolder;
+      this.result = result;
+   }
+
+   public void onMessage(final Message message)
+   {
+      try
       {
-         try
-         {
-            System.out.println("Message received: " + ((TextMessage)message).getText());
-            receiveHolder.add(((TextMessage)message).getText());
-         }
-         catch (JMSException e)
-         {
-            result = false;
-            e.printStackTrace();
-         }
+         System.out.println("Message received: " + ((TextMessage)message).getText());
+         receiveHolder.add(((TextMessage)message).getText());
+      }
+      catch (JMSException e)
+      {
+         result = false;
+         e.printStackTrace();
       }
-
    }
-
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/xa-heuristic/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/xa-heuristic/src/main/resources/activemq/server0/artemis-roles.properties b/examples/jms/xa-heuristic/src/main/resources/activemq/server0/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/xa-heuristic/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/xa-heuristic/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/xa-heuristic/src/main/resources/activemq/server0/artemis-users.properties b/examples/jms/xa-heuristic/src/main/resources/activemq/server0/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/xa-heuristic/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/xa-heuristic/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/xa-heuristic/src/main/resources/activemq/server0/broker.xml b/examples/jms/xa-heuristic/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index 7690094..0000000
--- a/examples/jms/xa-heuristic/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,60 +0,0 @@
-<?xml version='1.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.
--->
-
-<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-               xmlns="urn:activemq"
-               xsi:schemaLocation="urn:activemq /schema/artemis-server.xsd">
-
-   <jms xmlns="urn:activemq:jms">
-      <!--the queue used by the example-->
-      <queue name="exampleQueue"/>
-   </jms>
-
-   <core xmlns="urn:activemq:core">
-
-      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
-
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
-
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
-
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
-      </acceptors>
-
-      <!-- Other config -->
-
-      <security-settings>
-         <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
-            <permission type="createDurableQueue" roles="guest"/>
-            <permission type="deleteDurableQueue" roles="guest"/>
-            <permission type="createNonDurableQueue" roles="guest"/>
-            <permission type="deleteNonDurableQueue" roles="guest"/>
-            <permission type="consume" roles="guest"/>
-            <permission type="send" roles="guest"/>
-         </security-setting>
-      </security-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/xa-receive/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/xa-receive/pom.xml b/examples/jms/xa-receive/pom.xml
index 5fa068a..8336c5f 100644
--- a/examples/jms/xa-receive/pom.xml
+++ b/examples/jms/xa-receive/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-commons</artifactId>
          <version>${project.version}</version>
       </dependency>
       <dependency>
@@ -61,9 +61,18 @@ under the License.
                         <goals>
                            <goal>create</goal>
                         </goals>
+                     </execution>
+                     <execution>
+                        <id>start</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
                         <configuration>
-                           <instance>${basedir}/target/server0</instance>
-                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                           <spawn>true</spawn>
+                           <testURI>tcp://localhost:61616</testURI>
+                           <args>
+                              <param>run</param>
+                           </args>
                         </configuration>
                      </execution>
                      <execution>
@@ -72,9 +81,17 @@ under the License.
                            <goal>runClient</goal>
                         </goals>
                         <configuration>
-                           <clientClass>org.apache.activemq.artemis.jms.example.TransactionalExample</clientClass>
+                           <clientClass>org.apache.activemq.artemis.jms.example.XAReceiveExample</clientClass>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>stop</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
                            <args>
-                              <param>${basedir}/target/server0</param>
+                              <param>stop</param>
                            </args>
                         </configuration>
                      </execution>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/xa-receive/src/main/java/org/apache/activemq/artemis/jms/example/DummyXid.java
----------------------------------------------------------------------
diff --git a/examples/jms/xa-receive/src/main/java/org/apache/activemq/artemis/jms/example/DummyXid.java b/examples/jms/xa-receive/src/main/java/org/apache/activemq/artemis/jms/example/DummyXid.java
new file mode 100644
index 0000000..c8bf9cc
--- /dev/null
+++ b/examples/jms/xa-receive/src/main/java/org/apache/activemq/artemis/jms/example/DummyXid.java
@@ -0,0 +1,208 @@
+/*
+ * 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.
+ */
+package org.apache.activemq.artemis.jms.example;
+
+import org.apache.activemq.artemis.utils.Base64;
+
+import javax.transaction.xa.Xid;
+
+public class DummyXid implements Xid
+{
+   private static final long serialVersionUID = 407053232840068514L;
+
+   private final byte[] branchQualifier;
+
+   private final int formatId;
+
+   private final byte[] globalTransactionId;
+
+   private int hash;
+
+   private boolean hashCalculated;
+
+   // Static --------------------------------------------------------
+
+   public static String toBase64String(final Xid xid)
+   {
+      return Base64.encodeBytes(DummyXid.toByteArray(xid));
+   }
+
+   private static byte[] toByteArray(final Xid xid)
+   {
+      byte[] branchQualifier = xid.getBranchQualifier();
+      byte[] globalTransactionId = xid.getGlobalTransactionId();
+      int formatId = xid.getFormatId();
+
+      byte[] hashBytes = new byte[branchQualifier.length + globalTransactionId.length + 4];
+      System.arraycopy(branchQualifier, 0, hashBytes, 0, branchQualifier.length);
+      System.arraycopy(globalTransactionId, 0, hashBytes, branchQualifier.length, globalTransactionId.length);
+      byte[] intBytes = new byte[4];
+      for (int i = 0; i < 4; i++)
+      {
+         intBytes[i] = (byte)((formatId >> i * 8) % 0xFF);
+      }
+      System.arraycopy(intBytes, 0, hashBytes, branchQualifier.length + globalTransactionId.length, 4);
+      return hashBytes;
+   }
+
+   // Constructors --------------------------------------------------
+
+   /**
+    * Standard constructor
+    * @param branchQualifier
+    * @param formatId
+    * @param globalTransactionId
+    */
+   public DummyXid(final byte[] branchQualifier, final int formatId, final byte[] globalTransactionId)
+   {
+      this.branchQualifier = branchQualifier;
+      this.formatId = formatId;
+      this.globalTransactionId = globalTransactionId;
+   }
+
+   /**
+    * Copy constructor
+    * @param other
+    */
+   public DummyXid(final Xid other)
+   {
+      branchQualifier = copyBytes(other.getBranchQualifier());
+      formatId = other.getFormatId();
+      globalTransactionId = copyBytes(other.getGlobalTransactionId());
+   }
+
+   // Xid implementation ------------------------------------------------------------------
+
+   public byte[] getBranchQualifier()
+   {
+      return branchQualifier;
+   }
+
+   public int getFormatId()
+   {
+      return formatId;
+   }
+
+   public byte[] getGlobalTransactionId()
+   {
+      return globalTransactionId;
+   }
+
+   // Public -------------------------------------------------------------------------------
+
+   @Override
+   public int hashCode()
+   {
+      if (!hashCalculated)
+      {
+         calcHash();
+      }
+      return hash;
+   }
+
+   @Override
+   public boolean equals(final Object other)
+   {
+      if (this == other)
+      {
+         return true;
+      }
+      if (!(other instanceof Xid))
+      {
+         return false;
+      }
+      Xid xother = (Xid)other;
+      if (xother.getFormatId() != formatId)
+      {
+         return false;
+      }
+      if (xother.getBranchQualifier().length != branchQualifier.length)
+      {
+         return false;
+      }
+      if (xother.getGlobalTransactionId().length != globalTransactionId.length)
+      {
+         return false;
+      }
+      for (int i = 0; i < branchQualifier.length; i++)
+      {
+         byte[] otherBQ = xother.getBranchQualifier();
+         if (branchQualifier[i] != otherBQ[i])
+         {
+            return false;
+         }
+      }
+      for (int i = 0; i < globalTransactionId.length; i++)
+      {
+         byte[] otherGtx = xother.getGlobalTransactionId();
+         if (globalTransactionId[i] != otherGtx[i])
+         {
+            return false;
+         }
+      }
+      return true;
+   }
+
+   @Override
+   public String toString()
+   {
+      return "XidImpl (" + System.identityHashCode(this) +
+             " bq:" +
+             stringRep(branchQualifier) +
+             " formatID:" +
+             formatId +
+             " gtxid:" +
+             stringRep(globalTransactionId);
+   }
+
+   // Private -------------------------------------------------------------------------------
+
+   private String stringRep(final byte[] bytes)
+   {
+      StringBuilder buff = new StringBuilder();
+      for (int i = 0; i < bytes.length; i++)
+      {
+         byte b = bytes[i];
+
+         buff.append(b);
+
+         if (i != bytes.length - 1)
+         {
+            buff.append('.');
+         }
+      }
+
+      return buff.toString();
+   }
+
+   private void calcHash()
+   {
+      byte[] hashBytes = DummyXid.toByteArray(this);
+      String s = new String(hashBytes);
+      hash = s.hashCode();
+      hashCalculated = true;
+   }
+
+   private byte[] copyBytes(final byte[] other)
+   {
+      byte[] bytes = new byte[other.length];
+
+      System.arraycopy(other, 0, bytes, 0, other.length);
+
+      return bytes;
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/xa-receive/src/main/java/org/apache/activemq/artemis/jms/example/XAReceiveExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/xa-receive/src/main/java/org/apache/activemq/artemis/jms/example/XAReceiveExample.java b/examples/jms/xa-receive/src/main/java/org/apache/activemq/artemis/jms/example/XAReceiveExample.java
index 2671e54..6562cea 100644
--- a/examples/jms/xa-receive/src/main/java/org/apache/activemq/artemis/jms/example/XAReceiveExample.java
+++ b/examples/jms/xa-receive/src/main/java/org/apache/activemq/artemis/jms/example/XAReceiveExample.java
@@ -29,26 +29,14 @@ import javax.transaction.xa.XAResource;
 import javax.transaction.xa.Xid;
 import java.nio.charset.StandardCharsets;
 
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
-
-// Defined on xa-heuristic example, the maven dependency will take care of that
-import org.apache.activemq.artemis.common.example.DummyXid;
 import org.apache.activemq.artemis.utils.UUIDGenerator;
 
 /**
  * A simple JMS example showing the usage of XA support in JMS.
  */
-public class XAReceiveExample extends ActiveMQExample
+public class XAReceiveExample
 {
-   private volatile boolean result = true;
-
-   public static void main(final String[] args)
-   {
-      new XAReceiveExample().run(args);
-   }
-
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(final String[] args) throws Exception
    {
       XAConnection connection = null;
       InitialContext initialContext = null;
@@ -90,8 +78,8 @@ public class XAReceiveExample extends ActiveMQExample
 
          // Step 12. create a transaction
          Xid xid1 = new DummyXid("xa-example1".getBytes(StandardCharsets.US_ASCII), 1, UUIDGenerator.getInstance()
-                                                                           .generateStringUUID()
-                                                                           .getBytes());
+                 .generateStringUUID()
+                 .getBytes());
 
          // Step 13. Get the JMS XAResource
          XAResource xaRes = xaSession.getXAResource();
@@ -120,8 +108,8 @@ public class XAReceiveExample extends ActiveMQExample
 
          // Step 20. Create another transaction
          Xid xid2 = new DummyXid("xa-example2".getBytes(), 1, UUIDGenerator.getInstance()
-                                                                           .generateStringUUID()
-                                                                           .getBytes());
+                 .generateStringUUID()
+                 .getBytes());
 
          // Step 21. Start the transaction
          xaRes.start(xid2, XAResource.TMNOFLAGS);
@@ -149,10 +137,8 @@ public class XAReceiveExample extends ActiveMQExample
          }
          else
          {
-            result = false;
+            throw new IllegalStateException();
          }
-
-         return result;
       }
       finally
       {
@@ -167,5 +153,4 @@ public class XAReceiveExample extends ActiveMQExample
          }
       }
    }
-
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/xa-receive/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/xa-receive/src/main/resources/activemq/server0/artemis-roles.properties b/examples/jms/xa-receive/src/main/resources/activemq/server0/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/xa-receive/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/xa-receive/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/xa-receive/src/main/resources/activemq/server0/artemis-users.properties b/examples/jms/xa-receive/src/main/resources/activemq/server0/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/xa-receive/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/xa-receive/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/xa-receive/src/main/resources/activemq/server0/broker.xml b/examples/jms/xa-receive/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index 7690094..0000000
--- a/examples/jms/xa-receive/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,60 +0,0 @@
-<?xml version='1.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.
--->
-
-<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-               xmlns="urn:activemq"
-               xsi:schemaLocation="urn:activemq /schema/artemis-server.xsd">
-
-   <jms xmlns="urn:activemq:jms">
-      <!--the queue used by the example-->
-      <queue name="exampleQueue"/>
-   </jms>
-
-   <core xmlns="urn:activemq:core">
-
-      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
-
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
-
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
-
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
-      </acceptors>
-
-      <!-- Other config -->
-
-      <security-settings>
-         <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
-            <permission type="createDurableQueue" roles="guest"/>
-            <permission type="deleteDurableQueue" roles="guest"/>
-            <permission type="createNonDurableQueue" roles="guest"/>
-            <permission type="deleteNonDurableQueue" roles="guest"/>
-            <permission type="consume" roles="guest"/>
-            <permission type="send" roles="guest"/>
-         </security-setting>
-      </security-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/xa-send/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/xa-send/pom.xml b/examples/jms/xa-send/pom.xml
index 594bb44..3038202 100644
--- a/examples/jms/xa-send/pom.xml
+++ b/examples/jms/xa-send/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-commons</artifactId>
          <version>${project.version}</version>
       </dependency>
       <dependency>
@@ -57,17 +57,22 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
+                        <id>create</id>
+                        <goals>
+                           <goal>create</goal>
+                        </goals>
+                     </execution>
+                     <execution>
                         <id>start</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>cli</goal>
                         </goals>
                         <configuration>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                           </systemProperties>
+                           <spawn>true</spawn>
+                           <testURI>tcp://localhost:61616</testURI>
+                           <args>
+                              <param>run</param>
+                           </args>
                         </configuration>
                      </execution>
                      <execution>
@@ -82,8 +87,13 @@ under the License.
                      <execution>
                         <id>stop</id>
                         <goals>
-                           <goal>stop</goal>
+                           <goal>cli</goal>
                         </goals>
+                        <configuration>
+                           <args>
+                              <param>stop</param>
+                           </args>
+                        </configuration>
                      </execution>
                   </executions>
                   <dependencies>
@@ -92,45 +102,10 @@ under the License.
                         <artifactId>artemis-jms-xa-send-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                  </configuration>
                </plugin>
             </plugins>
          </build>
       </profile>
    </profiles>
-
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/xa-send/src/main/java/org/apache/activemq/artemis/jms/example/DummyXid.java
----------------------------------------------------------------------
diff --git a/examples/jms/xa-send/src/main/java/org/apache/activemq/artemis/jms/example/DummyXid.java b/examples/jms/xa-send/src/main/java/org/apache/activemq/artemis/jms/example/DummyXid.java
new file mode 100644
index 0000000..c8bf9cc
--- /dev/null
+++ b/examples/jms/xa-send/src/main/java/org/apache/activemq/artemis/jms/example/DummyXid.java
@@ -0,0 +1,208 @@
+/*
+ * 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.
+ */
+package org.apache.activemq.artemis.jms.example;
+
+import org.apache.activemq.artemis.utils.Base64;
+
+import javax.transaction.xa.Xid;
+
+public class DummyXid implements Xid
+{
+   private static final long serialVersionUID = 407053232840068514L;
+
+   private final byte[] branchQualifier;
+
+   private final int formatId;
+
+   private final byte[] globalTransactionId;
+
+   private int hash;
+
+   private boolean hashCalculated;
+
+   // Static --------------------------------------------------------
+
+   public static String toBase64String(final Xid xid)
+   {
+      return Base64.encodeBytes(DummyXid.toByteArray(xid));
+   }
+
+   private static byte[] toByteArray(final Xid xid)
+   {
+      byte[] branchQualifier = xid.getBranchQualifier();
+      byte[] globalTransactionId = xid.getGlobalTransactionId();
+      int formatId = xid.getFormatId();
+
+      byte[] hashBytes = new byte[branchQualifier.length + globalTransactionId.length + 4];
+      System.arraycopy(branchQualifier, 0, hashBytes, 0, branchQualifier.length);
+      System.arraycopy(globalTransactionId, 0, hashBytes, branchQualifier.length, globalTransactionId.length);
+      byte[] intBytes = new byte[4];
+      for (int i = 0; i < 4; i++)
+      {
+         intBytes[i] = (byte)((formatId >> i * 8) % 0xFF);
+      }
+      System.arraycopy(intBytes, 0, hashBytes, branchQualifier.length + globalTransactionId.length, 4);
+      return hashBytes;
+   }
+
+   // Constructors --------------------------------------------------
+
+   /**
+    * Standard constructor
+    * @param branchQualifier
+    * @param formatId
+    * @param globalTransactionId
+    */
+   public DummyXid(final byte[] branchQualifier, final int formatId, final byte[] globalTransactionId)
+   {
+      this.branchQualifier = branchQualifier;
+      this.formatId = formatId;
+      this.globalTransactionId = globalTransactionId;
+   }
+
+   /**
+    * Copy constructor
+    * @param other
+    */
+   public DummyXid(final Xid other)
+   {
+      branchQualifier = copyBytes(other.getBranchQualifier());
+      formatId = other.getFormatId();
+      globalTransactionId = copyBytes(other.getGlobalTransactionId());
+   }
+
+   // Xid implementation ------------------------------------------------------------------
+
+   public byte[] getBranchQualifier()
+   {
+      return branchQualifier;
+   }
+
+   public int getFormatId()
+   {
+      return formatId;
+   }
+
+   public byte[] getGlobalTransactionId()
+   {
+      return globalTransactionId;
+   }
+
+   // Public -------------------------------------------------------------------------------
+
+   @Override
+   public int hashCode()
+   {
+      if (!hashCalculated)
+      {
+         calcHash();
+      }
+      return hash;
+   }
+
+   @Override
+   public boolean equals(final Object other)
+   {
+      if (this == other)
+      {
+         return true;
+      }
+      if (!(other instanceof Xid))
+      {
+         return false;
+      }
+      Xid xother = (Xid)other;
+      if (xother.getFormatId() != formatId)
+      {
+         return false;
+      }
+      if (xother.getBranchQualifier().length != branchQualifier.length)
+      {
+         return false;
+      }
+      if (xother.getGlobalTransactionId().length != globalTransactionId.length)
+      {
+         return false;
+      }
+      for (int i = 0; i < branchQualifier.length; i++)
+      {
+         byte[] otherBQ = xother.getBranchQualifier();
+         if (branchQualifier[i] != otherBQ[i])
+         {
+            return false;
+         }
+      }
+      for (int i = 0; i < globalTransactionId.length; i++)
+      {
+         byte[] otherGtx = xother.getGlobalTransactionId();
+         if (globalTransactionId[i] != otherGtx[i])
+         {
+            return false;
+         }
+      }
+      return true;
+   }
+
+   @Override
+   public String toString()
+   {
+      return "XidImpl (" + System.identityHashCode(this) +
+             " bq:" +
+             stringRep(branchQualifier) +
+             " formatID:" +
+             formatId +
+             " gtxid:" +
+             stringRep(globalTransactionId);
+   }
+
+   // Private -------------------------------------------------------------------------------
+
+   private String stringRep(final byte[] bytes)
+   {
+      StringBuilder buff = new StringBuilder();
+      for (int i = 0; i < bytes.length; i++)
+      {
+         byte b = bytes[i];
+
+         buff.append(b);
+
+         if (i != bytes.length - 1)
+         {
+            buff.append('.');
+         }
+      }
+
+      return buff.toString();
+   }
+
+   private void calcHash()
+   {
+      byte[] hashBytes = DummyXid.toByteArray(this);
+      String s = new String(hashBytes);
+      hash = s.hashCode();
+      hashCalculated = true;
+   }
+
+   private byte[] copyBytes(final byte[] other)
+   {
+      byte[] bytes = new byte[other.length];
+
+      System.arraycopy(other, 0, bytes, 0, other.length);
+
+      return bytes;
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/xa-send/src/main/java/org/apache/activemq/artemis/jms/example/XASendExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/xa-send/src/main/java/org/apache/activemq/artemis/jms/example/XASendExample.java b/examples/jms/xa-send/src/main/java/org/apache/activemq/artemis/jms/example/XASendExample.java
index 447fbc4..43d6c21 100644
--- a/examples/jms/xa-send/src/main/java/org/apache/activemq/artemis/jms/example/XASendExample.java
+++ b/examples/jms/xa-send/src/main/java/org/apache/activemq/artemis/jms/example/XASendExample.java
@@ -32,28 +32,19 @@ import javax.transaction.xa.XAResource;
 import javax.transaction.xa.Xid;
 import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
+import java.util.concurrent.atomic.AtomicBoolean;
 
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
-import org.apache.activemq.artemis.common.example.DummyXid;
 import org.apache.activemq.artemis.utils.UUIDGenerator;
 
 /**
  * A simple JMS example showing the usage of XA support in JMS.
  */
-public class XASendExample extends ActiveMQExample
+public class XASendExample
 {
-   private volatile boolean result = true;
-
-   private final ArrayList<String> receiveHolder = new ArrayList<String>();
-
-   public static void main(final String[] args)
-   {
-      new XASendExample().run(args);
-   }
-
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(final String[] args) throws Exception
    {
+      AtomicBoolean result = new AtomicBoolean(true);
+      final ArrayList<String> receiveHolder = new ArrayList<String>();
       XAConnection connection = null;
       InitialContext initialContext = null;
       try
@@ -81,7 +72,7 @@ public class XASendExample extends ActiveMQExample
 
          // Step 8. Create a normal Message Consumer
          MessageConsumer normalConsumer = normalSession.createConsumer(queue);
-         normalConsumer.setMessageListener(new SimpleMessageListener());
+         normalConsumer.setMessageListener(new SimpleMessageListener(receiveHolder, result));
 
          // Step 9. Get the JMS Session
          Session session = xaSession.getSession();
@@ -95,8 +86,8 @@ public class XASendExample extends ActiveMQExample
 
          // Step 12. create a transaction
          Xid xid1 = new DummyXid("xa-example1".getBytes(StandardCharsets.UTF_8), 1, UUIDGenerator.getInstance()
-                                                                           .generateStringUUID()
-                                                                           .getBytes());
+                 .generateStringUUID()
+                 .getBytes());
 
          // Step 13. Get the JMS XAResource
          XAResource xaRes = xaSession.getXAResource();
@@ -111,7 +102,7 @@ public class XASendExample extends ActiveMQExample
          Thread.sleep(2000);
 
          // Step 16. Check the result, it should receive none!
-         checkNoMessageReceived();
+         checkNoMessageReceived(receiveHolder);
 
          // Step 17. Stop the work
          xaRes.end(xid1, XAResource.TMSUCCESS);
@@ -123,12 +114,12 @@ public class XASendExample extends ActiveMQExample
          xaRes.rollback(xid1);
 
          // Step 20. No messages should be received!
-         checkNoMessageReceived();
+         checkNoMessageReceived(receiveHolder);
 
          // Step 21. Create another transaction
          Xid xid2 = new DummyXid("xa-example2".getBytes(), 1, UUIDGenerator.getInstance()
-                                                                           .generateStringUUID()
-                                                                           .getBytes());
+                 .generateStringUUID()
+                 .getBytes());
 
          // Step 22. Start the transaction
          xaRes.start(xid2, XAResource.TMNOFLAGS);
@@ -144,7 +135,7 @@ public class XASendExample extends ActiveMQExample
          xaRes.prepare(xid2);
 
          // Step 26. No messages should be received at this moment
-         checkNoMessageReceived();
+         checkNoMessageReceived(receiveHolder);
 
          // Step 27. Commit!
          xaRes.commit(xid2, false);
@@ -152,9 +143,10 @@ public class XASendExample extends ActiveMQExample
          Thread.sleep(2000);
 
          // Step 28. Check the result, all message received
-         checkAllMessageReceived();
+         checkAllMessageReceived(receiveHolder);
 
-         return result;
+         if (!result.get())
+            throw new IllegalStateException();
       }
       finally
       {
@@ -170,42 +162,47 @@ public class XASendExample extends ActiveMQExample
       }
    }
 
-   private void checkAllMessageReceived()
+   private static void checkAllMessageReceived(ArrayList<String> receiveHolder)
    {
       if (receiveHolder.size() != 2)
       {
-         System.out.println("Number of messages received not correct ! -- " + receiveHolder.size());
-         result = false;
+         throw new IllegalStateException("Number of messages received not correct ! -- " + receiveHolder.size());
       }
       receiveHolder.clear();
    }
 
-   private void checkNoMessageReceived()
+   private static void checkNoMessageReceived(ArrayList<String> receiveHolder)
    {
       if (receiveHolder.size() > 0)
       {
-         System.out.println("Message received, wrong!");
-         result = false;
+         throw new IllegalStateException("Message received, wrong!");
       }
       receiveHolder.clear();
    }
+}
+
+class SimpleMessageListener implements MessageListener
+{
+   ArrayList<String> receiveHolder;
+   AtomicBoolean result;
+
+   public SimpleMessageListener(ArrayList<String> receiveHolder, AtomicBoolean result)
+   {
+      this.receiveHolder = receiveHolder;
+      this.result = result;
+   }
 
-   public class SimpleMessageListener implements MessageListener
+   public void onMessage(final Message message)
    {
-      public void onMessage(final Message message)
+      try
       {
-         try
-         {
-            System.out.println("Message received: " + message);
-            receiveHolder.add(((TextMessage)message).getText());
-         }
-         catch (JMSException e)
-         {
-            result = false;
-            e.printStackTrace();
-         }
+         System.out.println("Message received: " + message);
+         receiveHolder.add(((TextMessage)message).getText());
+      }
+      catch (JMSException e)
+      {
+         result.set(false);
+         e.printStackTrace();
       }
-
    }
-
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/xa-send/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/xa-send/src/main/resources/activemq/server0/artemis-roles.properties b/examples/jms/xa-send/src/main/resources/activemq/server0/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/xa-send/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/xa-send/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/xa-send/src/main/resources/activemq/server0/artemis-users.properties b/examples/jms/xa-send/src/main/resources/activemq/server0/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/xa-send/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/xa-send/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/xa-send/src/main/resources/activemq/server0/broker.xml b/examples/jms/xa-send/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index 7690094..0000000
--- a/examples/jms/xa-send/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,60 +0,0 @@
-<?xml version='1.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.
--->
-
-<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-               xmlns="urn:activemq"
-               xsi:schemaLocation="urn:activemq /schema/artemis-server.xsd">
-
-   <jms xmlns="urn:activemq:jms">
-      <!--the queue used by the example-->
-      <queue name="exampleQueue"/>
-   </jms>
-
-   <core xmlns="urn:activemq:core">
-
-      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
-
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
-
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
-
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
-      </acceptors>
-
-      <!-- Other config -->
-
-      <security-settings>
-         <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
-            <permission type="createDurableQueue" roles="guest"/>
-            <permission type="deleteDurableQueue" roles="guest"/>
-            <permission type="createNonDurableQueue" roles="guest"/>
-            <permission type="deleteNonDurableQueue" roles="guest"/>
-            <permission type="consume" roles="guest"/>
-            <permission type="send" roles="guest"/>
-         </security-setting>
-      </security-settings>
-
-   </core>
-</configuration>


[15/24] activemq-artemis git commit: ARTEMIS-178 Refactor examples to use CLI

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/scale-down/src/main/java/org/apache/activemq/artemis/jms/example/ScaleDownExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/scale-down/src/main/java/org/apache/activemq/artemis/jms/example/ScaleDownExample.java b/examples/jms/scale-down/src/main/java/org/apache/activemq/artemis/jms/example/ScaleDownExample.java
index 5ee9701..f370491 100644
--- a/examples/jms/scale-down/src/main/java/org/apache/activemq/artemis/jms/example/ScaleDownExample.java
+++ b/examples/jms/scale-down/src/main/java/org/apache/activemq/artemis/jms/example/ScaleDownExample.java
@@ -16,8 +16,6 @@
  */
 package org.apache.activemq.artemis.jms.example;
 
-import java.util.Hashtable;
-
 import javax.jms.Connection;
 import javax.jms.ConnectionFactory;
 import javax.jms.MessageConsumer;
@@ -26,6 +24,7 @@ import javax.jms.Queue;
 import javax.jms.Session;
 import javax.jms.TextMessage;
 import javax.naming.InitialContext;
+import java.util.Hashtable;
 
 import org.apache.activemq.artemis.common.example.ActiveMQExample;
 
@@ -56,13 +55,13 @@ public class ScaleDownExample extends ActiveMQExample
          // Step 1. Get an initial context for looking up JNDI for both servers
          Hashtable<String, Object> properties = new Hashtable<String, Object>();
          properties.put("java.naming.factory.initial", "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory");
-         properties.put("connectionFactory.ConnectionFactory", args[0] + "?ha=true&retryInterval=1000&retryIntervalMultiplier=1.0&reconnectAttempts=-1");
+         properties.put("connectionFactory.ConnectionFactory", DEFAULT_TCP1 + "?ha=true&retryInterval=1000&retryIntervalMultiplier=1.0&reconnectAttempts=-1");
          properties.put("queue.queue/exampleQueue", "exampleQueue");
          initialContext = new InitialContext(properties);
 
          properties = new Hashtable<String, Object>();
          properties.put("java.naming.factory.initial", "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory");
-         properties.put("connectionFactory.ConnectionFactory", args[1] + "?ha=true&retryInterval=1000&retryIntervalMultiplier=1.0&reconnectAttempts=-1");
+         properties.put("connectionFactory.ConnectionFactory", DEFAULT_TCP2 + "?ha=true&retryInterval=1000&retryIntervalMultiplier=1.0&reconnectAttempts=-1");
          initialContext1 = new InitialContext(properties);
 
          // Step 2. Look up the JMS resources from JNDI
@@ -97,6 +96,7 @@ public class ScaleDownExample extends ActiveMQExample
          // it has really crashed
          Thread.sleep(5000);
          killServer(1);
+         Thread.sleep(5000);
 
 
          // Step 8. start the connection ready to receive messages

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/scale-down/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/scale-down/src/main/resources/activemq/server0/broker.xml b/examples/jms/scale-down/src/main/resources/activemq/server0/broker.xml
index 33de64f..b2e1887 100644
--- a/examples/jms/scale-down/src/main/resources/activemq/server0/broker.xml
+++ b/examples/jms/scale-down/src/main/resources/activemq/server0/broker.xml
@@ -30,13 +30,13 @@ under the License.
    <core xmlns="urn:activemq:core">
 
 
-      <bindings-directory>target/server0/data/messaging/bindings</bindings-directory>
+      <bindings-directory>${data.dir:../data}/bindings</bindings-directory>
 
-      <journal-directory>target/server0/data/messaging/journal</journal-directory>
+      <journal-directory>${data.dir:../data}/journal</journal-directory>
 
-      <large-messages-directory>target/server0/data/messaging/largemessages</large-messages-directory>
+      <large-messages-directory>${data.dir:../data}/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/b3af4bb7/examples/jms/scale-down/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/scale-down/src/main/resources/activemq/server1/broker.xml b/examples/jms/scale-down/src/main/resources/activemq/server1/broker.xml
index 7602ef9..e198399 100644
--- a/examples/jms/scale-down/src/main/resources/activemq/server1/broker.xml
+++ b/examples/jms/scale-down/src/main/resources/activemq/server1/broker.xml
@@ -30,13 +30,13 @@ under the License.
    <core xmlns="urn:activemq:core">
 
 
-      <bindings-directory>target/server1/data/messaging/bindings</bindings-directory>
+      <bindings-directory>${data.dir:../data}/bindings</bindings-directory>
 
-      <journal-directory>target/server1/data/messaging/journal</journal-directory>
+      <journal-directory>${data.dir:../data}/journal</journal-directory>
 
-      <large-messages-directory>target/server1/data/messaging/largemessages</large-messages-directory>
+      <large-messages-directory>${data.dir:../data}/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/b3af4bb7/examples/jms/scheduled-message/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/scheduled-message/pom.xml b/examples/jms/scheduled-message/pom.xml
index cbd96ff..676e557 100644
--- a/examples/jms/scheduled-message/pom.xml
+++ b/examples/jms/scheduled-message/pom.xml
@@ -57,17 +57,13 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
                         </configuration>
                      </execution>
                      <execution>
@@ -77,14 +73,11 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.ScheduledMessageExample</clientClass>
+                           <args>
+                              <param>${basedir}/target/server0</param>
+                           </args>
                         </configuration>
                      </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                     </execution>
                   </executions>
                   <dependencies>
                      <dependency>
@@ -92,41 +85,7 @@ under the License.
                         <artifactId>artemis-jms-scheduled-message-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                  </configuration>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/security/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/security/pom.xml b/examples/jms/security/pom.xml
index 66388a5..88330b1 100644
--- a/examples/jms/security/pom.xml
+++ b/examples/jms/security/pom.xml
@@ -57,17 +57,13 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
                         </configuration>
                      </execution>
                      <execution>
@@ -77,14 +73,11 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.SecurityExample</clientClass>
+                           <args>
+                              <param>${basedir}/target/server0</param>
+                           </args>
                         </configuration>
                      </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                     </execution>
                   </executions>
                   <dependencies>
                      <dependency>
@@ -92,41 +85,7 @@ under the License.
                         <artifactId>artemis-jms-security-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                  </configuration>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/send-acknowledgements/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/send-acknowledgements/pom.xml b/examples/jms/send-acknowledgements/pom.xml
index 165e9a9..7aa59cf 100644
--- a/examples/jms/send-acknowledgements/pom.xml
+++ b/examples/jms/send-acknowledgements/pom.xml
@@ -57,17 +57,13 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
                         </configuration>
                      </execution>
                      <execution>
@@ -77,14 +73,11 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.SendAcknowledgementsExample</clientClass>
+                           <args>
+                              <param>${basedir}/target/server0</param>
+                           </args>
                         </configuration>
                      </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                     </execution>
                   </executions>
                   <dependencies>
                      <dependency>
@@ -92,41 +85,7 @@ under the License.
                         <artifactId>artemis-jms-send-acknowledgements-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                  </configuration>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/spring-integration/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/spring-integration/pom.xml b/examples/jms/spring-integration/pom.xml
index b021c57..25ae488 100644
--- a/examples/jms/spring-integration/pom.xml
+++ b/examples/jms/spring-integration/pom.xml
@@ -72,6 +72,9 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.SpringExample</clientClass>
+                           <args>
+                              <param>${basedir}/target/server0</param>
+                           </args>
                         </configuration>
                      </execution>
                   </executions>
@@ -81,41 +84,7 @@ under the License.
                         <artifactId>artemis-jms-spring-integration-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                  </configuration>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/ssl-enabled/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/ssl-enabled/pom.xml b/examples/jms/ssl-enabled/pom.xml
index 4c80eba..47989bf 100644
--- a/examples/jms/ssl-enabled/pom.xml
+++ b/examples/jms/ssl-enabled/pom.xml
@@ -57,17 +57,13 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
                         </configuration>
                      </execution>
                      <execution>
@@ -77,14 +73,11 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.SSLExample</clientClass>
+                           <args>
+                              <param>${basedir}/target/server0</param>
+                           </args>
                         </configuration>
                      </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                     </execution>
                   </executions>
                   <dependencies>
                      <dependency>
@@ -92,41 +85,7 @@ under the License.
                         <artifactId>artemis-jms-ssl-enabled-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                  </configuration>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/static-selector-jms/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/static-selector-jms/pom.xml b/examples/jms/static-selector-jms/pom.xml
index 5e2855d..750af00 100644
--- a/examples/jms/static-selector-jms/pom.xml
+++ b/examples/jms/static-selector-jms/pom.xml
@@ -57,17 +57,13 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
                         </configuration>
                      </execution>
                      <execution>
@@ -78,16 +74,10 @@ under the License.
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.StaticSelectorJMSExample</clientClass>
                            <args>
-                              <param>tcp://localhost:61616</param>
+                              <param>${basedir}/target/server0</param>
                            </args>
                         </configuration>
                      </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                     </execution>
                   </executions>
                   <dependencies>
                      <dependency>
@@ -95,41 +85,7 @@ under the License.
                         <artifactId>artemis-jms-static-selector-jms-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                  </configuration>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/static-selector/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/static-selector/pom.xml b/examples/jms/static-selector/pom.xml
index 19f8e80..cf08771 100644
--- a/examples/jms/static-selector/pom.xml
+++ b/examples/jms/static-selector/pom.xml
@@ -57,17 +57,13 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
                         </configuration>
                      </execution>
                      <execution>
@@ -77,14 +73,11 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.StaticSelectorExample</clientClass>
+                           <args>
+                              <param>${basedir}/target/server0</param>
+                           </args>
                         </configuration>
                      </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                     </execution>
                   </executions>
                   <dependencies>
                      <dependency>
@@ -92,41 +85,7 @@ under the License.
                         <artifactId>artemis-static-selector-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                  </configuration>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/stomp-websockets/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/stomp-websockets/pom.xml b/examples/jms/stomp-websockets/pom.xml
index 49710ca..d64b66d 100644
--- a/examples/jms/stomp-websockets/pom.xml
+++ b/examples/jms/stomp-websockets/pom.xml
@@ -57,12 +57,13 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start0</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
                         </configuration>
                      </execution>
                      <execution>
@@ -73,23 +74,8 @@ under the License.
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.StompWebSocketExample</clientClass>
                            <args>
-                              <param>tcp://localhost:61616</param>
+                              <param>${basedir}/target/server0</param>
                            </args>
-                           <systemProperties>
-                              <property>
-                                 <name>exampleConfigDir</name>
-                                 <value>${basedir}/target/classes/activemq</value>
-                              </property>
-                           </systemProperties>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop0</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
                         </configuration>
                      </execution>
                   </executions>
@@ -99,51 +85,7 @@ under the License.
                         <artifactId>artemis-jms-stomp-websockets-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-stomp-protocol</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <systemProperties>
-                        <property>
-                           <name>data.dir</name>
-                           <value>${basedir}/target/</value>
-                        </property>
-                     </systemProperties>
-                  </configuration>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/stomp/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/stomp/pom.xml b/examples/jms/stomp/pom.xml
index d7276f5..809e433 100644
--- a/examples/jms/stomp/pom.xml
+++ b/examples/jms/stomp/pom.xml
@@ -57,17 +57,13 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
                         </configuration>
                      </execution>
                      <execution>
@@ -77,14 +73,11 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.StompExample</clientClass>
+                           <args>
+                              <param>${basedir}/target/server0</param>
+                           </args>
                         </configuration>
                      </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                     </execution>
                   </executions>
                   <dependencies>
                      <dependency>
@@ -92,46 +85,7 @@ under the License.
                         <artifactId>artemis-jms-stomp-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-stomp-protocol</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                  </configuration>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/stomp1.1/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/stomp1.1/pom.xml b/examples/jms/stomp1.1/pom.xml
index 0ac5dbd..14e9a76 100644
--- a/examples/jms/stomp1.1/pom.xml
+++ b/examples/jms/stomp1.1/pom.xml
@@ -57,17 +57,13 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
                         </configuration>
                      </execution>
                      <execution>
@@ -77,14 +73,11 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.StompExample</clientClass>
+                           <args>
+                              <param>${basedir}/target/server0</param>
+                           </args>
                         </configuration>
                      </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                     </execution>
                   </executions>
                   <dependencies>
                      <dependency>
@@ -92,46 +85,7 @@ under the License.
                         <artifactId>artemis-jms-stomp1.1-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-stomp-protocol</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                  </configuration>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/stomp1.2/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/stomp1.2/pom.xml b/examples/jms/stomp1.2/pom.xml
index c2f8b36..c696d8b 100644
--- a/examples/jms/stomp1.2/pom.xml
+++ b/examples/jms/stomp1.2/pom.xml
@@ -57,17 +57,13 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
                         </configuration>
                      </execution>
                      <execution>
@@ -77,14 +73,11 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.StompExample</clientClass>
+                           <args>
+                              <param>${basedir}/target/server0</param>
+                           </args>
                         </configuration>
                      </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                     </execution>
                   </executions>
                   <dependencies>
                      <dependency>
@@ -92,46 +85,7 @@ under the License.
                         <artifactId>artemis-jms-stomp1.2-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-stomp-protocol</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                  </configuration>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/stop-server-failover/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/stop-server-failover/pom.xml b/examples/jms/stop-server-failover/pom.xml
index 04033af..e1ebe90 100644
--- a/examples/jms/stop-server-failover/pom.xml
+++ b/examples/jms/stop-server-failover/pom.xml
@@ -57,42 +57,25 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start0</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                              <property>
-                                 <name>udp-address</name>
-                                 <value>${udp-address}</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                           <javaOptions>-Dudp-address=${udp-address}</javaOptions>
                         </configuration>
                      </execution>
                      <execution>
-                        <id>start1</id>
+                        <id>create2</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
-                           <fork>true</fork>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                              <property>
-                                 <name>udp-address</name>
-                                 <value>${udp-address}</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server1</instance>
+                           <configuration>${basedir}/target/classes/activemq/server1</configuration>
+                           <javaOptions>-Dudp-address=${udp-address}</javaOptions>
                         </configuration>
                      </execution>
                      <execution>
@@ -103,33 +86,9 @@ under the License.
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.StopServerFailoverExample</clientClass>
                            <args>
-                              <param>tcp://localhost:61616</param>
-                              <param>tcp://localhost:61617</param>
+                              <param>${basedir}/target/server0</param>
+                              <param>${basedir}/target/server1</param>
                            </args>
-                           <systemProperties>
-                              <property>
-                                 <name>exampleConfigDir</name>
-                                 <value>${basedir}/target/classes/activemq</value>
-                              </property>
-                           </systemProperties>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop0</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop1</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
                         </configuration>
                      </execution>
                   </executions>
@@ -139,46 +98,7 @@ under the License.
                         <artifactId>artemis-jms-stop-server-failover-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <systemProperties>
-                        <property>
-                           <name>data.dir</name>
-                           <value>${basedir}/target/</value>
-                        </property>
-                     </systemProperties>
-                  </configuration>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/symmetric-cluster/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/symmetric-cluster/pom.xml b/examples/jms/symmetric-cluster/pom.xml
index 6da292c..a7d35f7 100644
--- a/examples/jms/symmetric-cluster/pom.xml
+++ b/examples/jms/symmetric-cluster/pom.xml
@@ -57,124 +57,72 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start0</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                              <property>
-                                 <name>udp-address</name>
-                                 <value>${udp-address}</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                           <javaOptions>-Dudp-address=${udp-address}</javaOptions>
                         </configuration>
                      </execution>
                      <execution>
-                        <id>start1</id>
+                        <id>create1</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
-                           <fork>true</fork>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                              <property>
-                                 <name>udp-address</name>
-                                 <value>${udp-address}</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server1</instance>
+                           <configuration>${basedir}/target/classes/activemq/server1</configuration>
+                           <javaOptions>-Dudp-address=${udp-address}</javaOptions>
                         </configuration>
                      </execution>
                      <execution>
-                        <id>start2</id>
+                        <id>create2</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server2</configurationDir>
-                           <fork>true</fork>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                              <property>
-                                 <name>udp-address</name>
-                                 <value>${udp-address}</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server2</instance>
+                           <configuration>${basedir}/target/classes/activemq/server2</configuration>
+                           <javaOptions>-Dudp-address=${udp-address}</javaOptions>
                         </configuration>
                      </execution>
                      <execution>
-                        <id>start3</id>
+                        <id>create3</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server3</configurationDir>
-                           <fork>true</fork>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                              <property>
-                                 <name>udp-address</name>
-                                 <value>${udp-address}</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server3</instance>
+                           <configuration>${basedir}/target/classes/activemq/server3</configuration>
+                           <javaOptions>-Dudp-address=${udp-address}</javaOptions>
                         </configuration>
                      </execution>
                      <execution>
-                        <id>start4</id>
+                        <id>create4</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server4</configurationDir>
-                           <fork>true</fork>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                              <property>
-                                 <name>udp-address</name>
-                                 <value>${udp-address}</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server4</instance>
+                           <configuration>${basedir}/target/classes/activemq/server4</configuration>
+                           <javaOptions>-Dudp-address=${udp-address}</javaOptions>
                         </configuration>
                      </execution>
                      <execution>
-                        <id>start5</id>
+                        <id>create5</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server5</configurationDir>
-                           <fork>true</fork>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                              <property>
-                                 <name>udp-address</name>
-                                 <value>${udp-address}</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server5</instance>
+                           <configuration>${basedir}/target/classes/activemq/server5</configuration>
+                           <javaOptions>-Dudp-address=${udp-address}</javaOptions>
                         </configuration>
                      </execution>
+
                      <execution>
                         <id>runClient</id>
                         <goals>
@@ -183,73 +131,13 @@ under the License.
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.SymmetricClusterExample</clientClass>
                            <args>
-                              <param>tcp://localhost:61616</param>
-                              <param>tcp://localhost:61617</param>
-                              <param>tcp://localhost:61618</param>
-                              <param>tcp://localhost:61619</param>
-                              <param>tcp://localhost:61620</param>
-                              <param>tcp://localhost:5450</param>
+                              <param>${basedir}/target/server0</param>
+                              <param>${basedir}/target/server1</param>
+                              <param>${basedir}/target/server2</param>
+                              <param>${basedir}/target/server3</param>
+                              <param>${basedir}/target/server4</param>
+                              <param>${basedir}/target/server5</param>
                            </args>
-                           <systemProperties>
-                              <property>
-                                 <name>exampleConfigDir</name>
-                                 <value>${basedir}/target/classes/activemq</value>
-                              </property>
-                           </systemProperties>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop0</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop1</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop2</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server2</configurationDir>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop3</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server3</configurationDir>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop4</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server4</configurationDir>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop5</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server5</configurationDir>
                         </configuration>
                      </execution>
                   </executions>
@@ -259,46 +147,7 @@ under the License.
                         <artifactId>artemis-jms-symmetric-cluster-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <systemProperties>
-                        <property>
-                           <name>data.dir</name>
-                           <value>${basedir}/target/</value>
-                        </property>
-                     </systemProperties>
-                  </configuration>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/symmetric-cluster/src/main/java/org/apache/activemq/artemis/jms/example/SymmetricClusterExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/symmetric-cluster/src/main/java/org/apache/activemq/artemis/jms/example/SymmetricClusterExample.java b/examples/jms/symmetric-cluster/src/main/java/org/apache/activemq/artemis/jms/example/SymmetricClusterExample.java
index c17c5cd..24e75f0 100644
--- a/examples/jms/symmetric-cluster/src/main/java/org/apache/activemq/artemis/jms/example/SymmetricClusterExample.java
+++ b/examples/jms/symmetric-cluster/src/main/java/org/apache/activemq/artemis/jms/example/SymmetricClusterExample.java
@@ -232,12 +232,12 @@ public class SymmetricClusterExample extends ActiveMQExample
       {
          // Step 15. Be sure to close our resources!
 
-         closeConnection(connection0);
-         closeConnection(connection1);
-         closeConnection(connection2);
-         closeConnection(connection3);
-         closeConnection(connection4);
-         closeConnection(connection5);
+         connection0.close();
+         connection1.close();
+         connection2.close();
+         connection3.close();
+         connection4.close();
+         connection5.close();
       }
    }
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/temp-queue/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/temp-queue/pom.xml b/examples/jms/temp-queue/pom.xml
index 6f47781..b213088 100644
--- a/examples/jms/temp-queue/pom.xml
+++ b/examples/jms/temp-queue/pom.xml
@@ -57,17 +57,13 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
                         </configuration>
                      </execution>
                      <execution>
@@ -77,14 +73,11 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.TemporaryQueueExample</clientClass>
+                           <args>
+                              <param>${basedir}/target/server0</param>
+                           </args>
                         </configuration>
                      </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                     </execution>
                   </executions>
                   <dependencies>
                      <dependency>
@@ -92,41 +85,7 @@ under the License.
                         <artifactId>artemis-jms-temp-queue-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                  </configuration>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/topic-hierarchies/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/topic-hierarchies/pom.xml b/examples/jms/topic-hierarchies/pom.xml
index 388f63f..087570e 100644
--- a/examples/jms/topic-hierarchies/pom.xml
+++ b/examples/jms/topic-hierarchies/pom.xml
@@ -57,17 +57,13 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
                         </configuration>
                      </execution>
                      <execution>
@@ -77,14 +73,11 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.TopicHierarchyExample</clientClass>
+                           <args>
+                              <param>${basedir}/target/server0</param>
+                           </args>
                         </configuration>
                      </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                     </execution>
                   </executions>
                   <dependencies>
                      <dependency>
@@ -92,41 +85,7 @@ under the License.
                         <artifactId>artemis-jms-topic-hierarchies-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                  </configuration>
                </plugin>
             </plugins>
          </build>


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

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/queue-message-redistribution/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/queue-message-redistribution/pom.xml b/examples/jms/queue-message-redistribution/pom.xml
index c54657c..8100fcc 100644
--- a/examples/jms/queue-message-redistribution/pom.xml
+++ b/examples/jms/queue-message-redistribution/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.QueueMessageRedistributionExample</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>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/queue-message-redistribution/src/main/java/org/apache/activemq/artemis/jms/example/QueueMessageRedistributionExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/queue-message-redistribution/src/main/java/org/apache/activemq/artemis/jms/example/QueueMessageRedistributionExample.java b/examples/jms/queue-message-redistribution/src/main/java/org/apache/activemq/artemis/jms/example/QueueMessageRedistributionExample.java
index a1d0a8f..aec56b1 100644
--- a/examples/jms/queue-message-redistribution/src/main/java/org/apache/activemq/artemis/jms/example/QueueMessageRedistributionExample.java
+++ b/examples/jms/queue-message-redistribution/src/main/java/org/apache/activemq/artemis/jms/example/QueueMessageRedistributionExample.java
@@ -26,23 +26,15 @@ import javax.jms.TextMessage;
 import javax.naming.InitialContext;
 import java.util.Hashtable;
 
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
-
 /**
  * This example demonstrates a queue with the same name deployed on two nodes of a cluster.
  * Messages are initially round robin'd between both nodes of the cluster.
  * The consumer on one of the nodes is then closed, and we demonstrate that the "stranded" messages
  * are redistributed to the other node which has a consumer so they can be consumed.
  */
-public class QueueMessageRedistributionExample extends ActiveMQExample
+public class QueueMessageRedistributionExample
 {
-   public static void main(final String[] args)
-   {
-      new QueueMessageRedistributionExample().run(args);
-   }
-
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(final String[] args) throws Exception
    {
       Connection connection0 = null;
 
@@ -57,7 +49,7 @@ public class QueueMessageRedistributionExample extends ActiveMQExample
          // 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);
 
@@ -70,7 +62,7 @@ public class QueueMessageRedistributionExample extends ActiveMQExample
          // Step 4. Get an initial context for looking up JNDI from server 1
          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");
          ic1 = new InitialContext(properties);
 
          // Step 5. Look-up a JMS Connection Factory object from JNDI on server 1
@@ -158,8 +150,6 @@ public class QueueMessageRedistributionExample extends ActiveMQExample
 
          // Step 18. We ack the messages.
          message0.acknowledge();
-
-         return true;
       }
       finally
       {
@@ -186,5 +176,4 @@ public class QueueMessageRedistributionExample extends ActiveMQExample
          }
       }
    }
-
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/queue-message-redistribution/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/queue-message-redistribution/src/main/resources/activemq/server0/broker.xml b/examples/jms/queue-message-redistribution/src/main/resources/activemq/server0/broker.xml
index 2d771b0..70ff4d4 100644
--- a/examples/jms/queue-message-redistribution/src/main/resources/activemq/server0/broker.xml
+++ b/examples/jms/queue-message-redistribution/src/main/resources/activemq/server0/broker.xml
@@ -29,14 +29,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
+      <bindings-directory>./data/bindings</bindings-directory>
 
-      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
+      <journal-directory>./data/journal</journal-directory>
 
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
+      <large-messages-directory>./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/paging</paging-directory>
 
       <!-- Connectors -->
       <connectors>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/queue-message-redistribution/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/queue-message-redistribution/src/main/resources/activemq/server1/broker.xml b/examples/jms/queue-message-redistribution/src/main/resources/activemq/server1/broker.xml
index 870be49..6fc6f32 100644
--- a/examples/jms/queue-message-redistribution/src/main/resources/activemq/server1/broker.xml
+++ b/examples/jms/queue-message-redistribution/src/main/resources/activemq/server1/broker.xml
@@ -29,14 +29,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
+      <bindings-directory>./data/bindings</bindings-directory>
 
-      <bindings-directory>${data.dir}/server1/data/messaging/bindings</bindings-directory>
+      <journal-directory>./data/journal</journal-directory>
 
-      <journal-directory>${data.dir}/server1/data/messaging/journal</journal-directory>
+      <large-messages-directory>./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/paging</paging-directory>
 
       <!-- Connectors -->
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/queue-requestor/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/queue-requestor/pom.xml b/examples/jms/queue-requestor/pom.xml
index 893aef7..2b8e16f 100644
--- a/examples/jms/queue-requestor/pom.xml
+++ b/examples/jms/queue-requestor/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>
@@ -61,9 +56,18 @@ under the License.
                         <goals>
                            <goal>create</goal>
                         </goals>
+                     </execution>
+                     <execution>
+                        <id>start</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
                         <configuration>
-                           <instance>${basedir}/target/server0</instance>
-                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                           <spawn>true</spawn>
+                           <testURI>tcp://localhost:61616</testURI>
+                           <args>
+                              <param>run</param>
+                           </args>
                         </configuration>
                      </execution>
                      <execution>
@@ -73,8 +77,16 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.QueueRequestorExample</clientClass>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>stop</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
                            <args>
-                              <param>${basedir}/target/server0</param>
+                              <param>stop</param>
                            </args>
                         </configuration>
                      </execution>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/queue-requestor/src/main/java/org/apache/activemq/artemis/jms/example/QueueRequestorExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/queue-requestor/src/main/java/org/apache/activemq/artemis/jms/example/QueueRequestorExample.java b/examples/jms/queue-requestor/src/main/java/org/apache/activemq/artemis/jms/example/QueueRequestorExample.java
index b9ee4c7..b86ad9c 100644
--- a/examples/jms/queue-requestor/src/main/java/org/apache/activemq/artemis/jms/example/QueueRequestorExample.java
+++ b/examples/jms/queue-requestor/src/main/java/org/apache/activemq/artemis/jms/example/QueueRequestorExample.java
@@ -26,20 +26,12 @@ import javax.jms.Session;
 import javax.jms.TextMessage;
 import javax.naming.InitialContext;
 
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
-
 /**
  * A simple JMS example that shows how to use queues requestors.
  */
-public class QueueRequestorExample extends ActiveMQExample
+public class QueueRequestorExample
 {
-   public static void main(final String[] args)
-   {
-      new QueueRequestorExample().run(args);
-   }
-
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(final String[] args) throws Exception
    {
       QueueConnection connection = null;
       InitialContext initialContext = null;
@@ -85,8 +77,6 @@ public class QueueRequestorExample extends ActiveMQExample
 
          // Step 13. close the text reverser service
          reverserService.close();
-
-         return true;
       }
       finally
       {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/queue-selector/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/queue-selector/pom.xml b/examples/jms/queue-selector/pom.xml
index 8ccd41c..7f179f6 100644
--- a/examples/jms/queue-selector/pom.xml
+++ b/examples/jms/queue-selector/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>
@@ -61,9 +56,18 @@ under the License.
                         <goals>
                            <goal>create</goal>
                         </goals>
+                     </execution>
+                     <execution>
+                        <id>start</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
                         <configuration>
-                           <instance>${basedir}/target/server0</instance>
-                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                           <spawn>true</spawn>
+                           <testURI>tcp://localhost:61616</testURI>
+                           <args>
+                              <param>run</param>
+                           </args>
                         </configuration>
                      </execution>
                      <execution>
@@ -73,8 +77,16 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.QueueSelectorExample</clientClass>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>stop</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
                            <args>
-                              <param>${basedir}/target/server0</param>
+                              <param>stop</param>
                            </args>
                         </configuration>
                      </execution>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/queue-selector/src/main/java/org/apache/activemq/artemis/jms/example/QueueSelectorExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/queue-selector/src/main/java/org/apache/activemq/artemis/jms/example/QueueSelectorExample.java b/examples/jms/queue-selector/src/main/java/org/apache/activemq/artemis/jms/example/QueueSelectorExample.java
index 059fe89..4811257 100644
--- a/examples/jms/queue-selector/src/main/java/org/apache/activemq/artemis/jms/example/QueueSelectorExample.java
+++ b/examples/jms/queue-selector/src/main/java/org/apache/activemq/artemis/jms/example/QueueSelectorExample.java
@@ -27,24 +27,16 @@ import javax.jms.Queue;
 import javax.jms.Session;
 import javax.jms.TextMessage;
 import javax.naming.InitialContext;
-
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
+import java.util.concurrent.atomic.AtomicBoolean;
 
 /**
  * A simple JMS example that uses selectors with queue consumers.
  */
-public class QueueSelectorExample extends ActiveMQExample
+public class QueueSelectorExample
 {
-   private volatile boolean result = true;
-
-   public static void main(final String[] args)
-   {
-      new QueueSelectorExample().run(args);
-   }
-
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(final String[] args) throws Exception
    {
+      AtomicBoolean result = new AtomicBoolean(true);
       Connection connection = null;
       InitialContext initialContext = null;
       try
@@ -65,33 +57,36 @@ public class QueueSelectorExample extends ActiveMQExample
          connection.start();
 
          // Step 5. Create a JMS Session
-         Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+         Session senderSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
 
          // Step 6. Create a JMS Message Producer
-         MessageProducer producer = session.createProducer(queue);
+         MessageProducer producer = senderSession.createProducer(queue);
 
          // Step 8. Prepare two selectors
          String redSelector = "color='red'";
          String greenSelector = "color='green'";
 
          // Step 9. Create a JMS Message Consumer that receives 'red' messages
-         MessageConsumer redConsumer = session.createConsumer(queue, redSelector);
-         redConsumer.setMessageListener(new SimpleMessageListener("red"));
+         Session redSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+         MessageConsumer redConsumer = redSession.createConsumer(queue, redSelector);
+         redConsumer.setMessageListener(new SimpleMessageListener("red", result));
 
          // Step 10. Create a second JMS message consumer that receives 'green' messages
-         MessageConsumer greenConsumer = session.createConsumer(queue, greenSelector);
-         greenConsumer.setMessageListener(new SimpleMessageListener("green"));
+         Session greenSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+         MessageConsumer greenConsumer = greenSession.createConsumer(queue, greenSelector);
+         greenConsumer.setMessageListener(new SimpleMessageListener("green", result));
 
          // Step 11. Create another JMS message consumer that receives any messages.
-         MessageConsumer anyConsumer = session.createConsumer(queue);
-         anyConsumer.setMessageListener(new SimpleMessageListener("any"));
+         Session blankSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+         MessageConsumer anyConsumer = blankSession.createConsumer(queue);
+         anyConsumer.setMessageListener(new SimpleMessageListener("any", result));
 
          // Step 12. Create three messages, each has a color property
-         TextMessage redMessage = session.createTextMessage("Red");
+         TextMessage redMessage = senderSession.createTextMessage("Red");
          redMessage.setStringProperty("color", "red");
-         TextMessage greenMessage = session.createTextMessage("Green");
+         TextMessage greenMessage = senderSession.createTextMessage("Green");
          greenMessage.setStringProperty("color", "green");
-         TextMessage blueMessage = session.createTextMessage("Blue");
+         TextMessage blueMessage = senderSession.createTextMessage("Blue");
          blueMessage.setStringProperty("color", "blue");
 
          // Step 13. Send the Messages
@@ -104,7 +99,8 @@ public class QueueSelectorExample extends ActiveMQExample
 
          Thread.sleep(5000);
 
-         return result;
+         if (!result.get())
+            throw new IllegalStateException();
       }
       finally
       {
@@ -119,40 +115,39 @@ public class QueueSelectorExample extends ActiveMQExample
          }
       }
    }
+}
 
-   public class SimpleMessageListener implements MessageListener
-   {
-
-      private final String name;
+class SimpleMessageListener implements MessageListener
+{
+   private final String name;
+   private AtomicBoolean result;
 
-      public SimpleMessageListener(final String listener)
-      {
-         name = listener;
-      }
+   public SimpleMessageListener(final String listener, AtomicBoolean result)
+   {
+      name = listener;
+      this.result = result;
+   }
 
-      public void onMessage(final Message msg)
+   public void onMessage(final Message msg)
+   {
+      TextMessage textMessage = (TextMessage)msg;
+      try
       {
-         TextMessage textMessage = (TextMessage)msg;
-         try
-         {
-            String colorProp = msg.getStringProperty("color");
-            System.out.println("Receiver " + name +
-                               " receives message [" +
-                               textMessage.getText() +
-                               "] with color property: " +
-                               colorProp);
-            if (!colorProp.equals(name) && !name.equals("any"))
-            {
-               result = false;
-            }
-         }
-         catch (JMSException e)
+         String colorProp = msg.getStringProperty("color");
+         System.out.println("Receiver " + name +
+                                    " receives message [" +
+                                    textMessage.getText() +
+                                    "] with color property: " +
+                                    colorProp);
+         if (!colorProp.equals(name) && !name.equals("any"))
          {
-            e.printStackTrace();
-            result = false;
+            result.set(false);
          }
       }
-
+      catch (JMSException e)
+      {
+         e.printStackTrace();
+         result.set(false);
+      }
    }
-
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/queue-selector/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/queue-selector/src/main/resources/activemq/server0/artemis-roles.properties b/examples/jms/queue-selector/src/main/resources/activemq/server0/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/queue-selector/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/queue-selector/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/queue-selector/src/main/resources/activemq/server0/artemis-users.properties b/examples/jms/queue-selector/src/main/resources/activemq/server0/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/queue-selector/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/queue-selector/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/queue-selector/src/main/resources/activemq/server0/broker.xml b/examples/jms/queue-selector/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index 78f96f3..0000000
--- a/examples/jms/queue-selector/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,59 +0,0 @@
-<?xml version='1.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.
--->
-
-<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:activemq"
-               xsi:schemaLocation="urn:activemq /schema/artemis-server.xsd">
-
-   <jms xmlns="urn:activemq:jms">
-      <!--the queue used by the example-->
-      <queue name="exampleQueue"/>
-   </jms>
-
-   <core xmlns="urn:activemq:core">
-
-      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
-
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
-
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
-
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
-      </acceptors>
-
-      <!-- Other config -->
-
-      <security-settings>
-         <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
-            <permission type="createDurableQueue" roles="guest"/>
-            <permission type="deleteDurableQueue" roles="guest"/>
-            <permission type="createNonDurableQueue" roles="guest"/>
-            <permission type="deleteNonDurableQueue" roles="guest"/>
-            <permission type="consume" roles="guest"/>
-            <permission type="send" roles="guest"/>
-         </security-setting>
-      </security-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/queue/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/queue/pom.xml b/examples/jms/queue/pom.xml
index 9619a7f..fecaaf7 100644
--- a/examples/jms/queue/pom.xml
+++ b/examples/jms/queue/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>
@@ -61,9 +56,18 @@ under the License.
                         <goals>
                            <goal>create</goal>
                         </goals>
+                     </execution>
+                     <execution>
+                        <id>start</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
                         <configuration>
-                           <instance>${basedir}/target/server0</instance>
-                           <!-- this example only uses default configuration from the create -->
+                           <spawn>true</spawn>
+                           <testURI>tcp://localhost:61616</testURI>
+                           <args>
+                              <param>run</param>
+                           </args>
                         </configuration>
                      </execution>
                      <execution>
@@ -73,8 +77,16 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.QueueExample</clientClass>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>stop</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
                            <args>
-                              <param>${basedir}/target/server0</param>
+                              <param>stop</param>
                            </args>
                         </configuration>
                      </execution>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/queue/src/main/java/org/apache/activemq/artemis/jms/example/QueueExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/queue/src/main/java/org/apache/activemq/artemis/jms/example/QueueExample.java b/examples/jms/queue/src/main/java/org/apache/activemq/artemis/jms/example/QueueExample.java
index af9b728..5cbf0cd 100644
--- a/examples/jms/queue/src/main/java/org/apache/activemq/artemis/jms/example/QueueExample.java
+++ b/examples/jms/queue/src/main/java/org/apache/activemq/artemis/jms/example/QueueExample.java
@@ -25,20 +25,12 @@ import javax.jms.Session;
 import javax.jms.TextMessage;
 import javax.naming.InitialContext;
 
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
-
 /**
  * A simple JMS Queue example that creates a producer and consumer on a queue and sends then receives a message.
  */
-public class QueueExample extends ActiveMQExample
+public class QueueExample
 {
-   public static void main(final String[] args)
-   {
-      new QueueExample().run(args);
-   }
-
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(final String[] args) throws Exception
    {
       Connection connection = null;
       InitialContext initialContext = null;
@@ -80,8 +72,6 @@ public class QueueExample extends ActiveMQExample
          TextMessage messageReceived = (TextMessage)messageConsumer.receive(5000);
 
          System.out.println("Received message: " + messageReceived.getText());
-
-         return true;
       }
       finally
       {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/reattach-node/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/reattach-node/pom.xml b/examples/jms/reattach-node/pom.xml
index 76ae5d7..885adcf 100644
--- a/examples/jms/reattach-node/pom.xml
+++ b/examples/jms/reattach-node/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-jms-client</artifactId>
          <version>${project.version}</version>
       </dependency>
       <dependency>
@@ -67,14 +67,35 @@ under the License.
                         </configuration>
                      </execution>
                      <execution>
+                        <id>start</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
+                           <spawn>true</spawn>
+                           <testURI>tcp://localhost:61616</testURI>
+                           <args>
+                              <param>run</param>
+                           </args>
+                        </configuration>
+                     </execution>
+                     <execution>
                         <id>runClient</id>
                         <goals>
                            <goal>runClient</goal>
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.ReattachExample</clientClass>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>stop</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
                            <args>
-                              <param>${basedir}/target/server0</param>
+                              <param>stop</param>
                            </args>
                         </configuration>
                      </execution>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/reattach-node/src/main/java/org/apache/activemq/artemis/jms/example/ReattachExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/reattach-node/src/main/java/org/apache/activemq/artemis/jms/example/ReattachExample.java b/examples/jms/reattach-node/src/main/java/org/apache/activemq/artemis/jms/example/ReattachExample.java
index 34393d0..2b05090 100644
--- a/examples/jms/reattach-node/src/main/java/org/apache/activemq/artemis/jms/example/ReattachExample.java
+++ b/examples/jms/reattach-node/src/main/java/org/apache/activemq/artemis/jms/example/ReattachExample.java
@@ -30,22 +30,15 @@ import javax.naming.InitialContext;
 
 import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
 import org.apache.activemq.artemis.api.jms.management.JMSManagementHelper;
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
 
 /**
  * This examples demonstrates a connection created to a server. Failure of the network connection is then simulated
  *
  * The network is brought back up and the client reconnects and resumes transparently.
  */
-public class ReattachExample extends ActiveMQExample
+public class ReattachExample
 {
-   public static void main(final String[] args)
-   {
-      new ReattachExample().run(args);
-   }
-
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(final String[] args) throws Exception
    {
       Connection connection = null;
       InitialContext initialContext = null;
@@ -103,8 +96,6 @@ public class ReattachExample extends ActiveMQExample
          TextMessage messageReceived = (TextMessage)messageConsumer.receive(5000);
 
          System.out.println("Received message: " + messageReceived.getText());
-
-         return true;
       }
       finally
       {
@@ -121,12 +112,12 @@ public class ReattachExample extends ActiveMQExample
       }
    }
 
-   private void stopAcceptor() throws Exception
+   private static void stopAcceptor() throws Exception
    {
       stopStartAcceptor(true);
    }
 
-   private void startAcceptor() throws Exception
+   private static void startAcceptor() throws Exception
    {
       stopStartAcceptor(false);
    }
@@ -134,7 +125,7 @@ public class ReattachExample extends ActiveMQExample
    // To do this we send a management message to close the acceptor, we do this on a different
    // connection factory which uses a different remoting connection so we can still send messages
    // when the main connection has been stopped
-   private void stopStartAcceptor(final boolean stop) throws Exception
+   private static void stopStartAcceptor(final boolean stop) throws Exception
    {
       Hashtable<String, Object> properties = new Hashtable<String, Object>();
       properties.put("java.naming.factory.initial", "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory");

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/reattach-node/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/reattach-node/src/main/resources/activemq/server0/broker.xml b/examples/jms/reattach-node/src/main/resources/activemq/server0/broker.xml
index 0edc66a..20321a2 100644
--- a/examples/jms/reattach-node/src/main/resources/activemq/server0/broker.xml
+++ b/examples/jms/reattach-node/src/main/resources/activemq/server0/broker.xml
@@ -29,13 +29,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
+      <bindings-directory>${data.dir:./data}/bindings</bindings-directory>
 
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
+      <journal-directory>${data.dir:./data}/journal</journal-directory>
 
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
+      <large-messages-directory>${data.dir:./data}/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/replicated-failback-static/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/replicated-failback-static/pom.xml b/examples/jms/replicated-failback-static/pom.xml
index 9a9a2f7..2cd5072 100644
--- a/examples/jms/replicated-failback-static/pom.xml
+++ b/examples/jms/replicated-failback-static/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>
@@ -68,7 +68,7 @@ under the License.
                         </configuration>
                      </execution>
                      <execution>
-                        <id>create2</id>
+                        <id>create1</id>
                         <goals>
                            <goal>create</goal>
                         </goals>
@@ -104,5 +104,4 @@ under the License.
          </build>
       </profile>
    </profiles>
-
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/replicated-failback-static/src/main/java/org/apache/activemq/artemis/jms/example/ReplicatedFailbackStaticExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/replicated-failback-static/src/main/java/org/apache/activemq/artemis/jms/example/ReplicatedFailbackStaticExample.java b/examples/jms/replicated-failback-static/src/main/java/org/apache/activemq/artemis/jms/example/ReplicatedFailbackStaticExample.java
index 7618c40..2f22cb9 100644
--- a/examples/jms/replicated-failback-static/src/main/java/org/apache/activemq/artemis/jms/example/ReplicatedFailbackStaticExample.java
+++ b/examples/jms/replicated-failback-static/src/main/java/org/apache/activemq/artemis/jms/example/ReplicatedFailbackStaticExample.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.JMSException;
@@ -26,8 +28,6 @@ import javax.jms.Session;
 import javax.jms.TextMessage;
 import javax.naming.InitialContext;
 
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
-
 /**
  * Example of live and replicating backup pair.
  * <p>
@@ -35,15 +35,13 @@ import org.apache.activemq.artemis.common.example.ActiveMQExample;
  * <p>
  * Later the live server is restarted and takes back its position by asking the backup to stop ("fail-back").
  */
-public class ReplicatedFailbackStaticExample extends ActiveMQExample
+public class ReplicatedFailbackStaticExample
 {
-   public static void main(final String[] args)
-   {
-      new ReplicatedFailbackStaticExample().run(args);
-   }
+   private static Process server0;
+
+   private static Process server1;
 
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(final String[] args) throws Exception
    {
       final int numMessages = 30;
 
@@ -53,6 +51,9 @@ public class ReplicatedFailbackStaticExample extends ActiveMQExample
 
       try
       {
+         server0 = ServerUtil.startServer(args[0], ReplicatedFailbackStaticExample.class.getSimpleName() + "0", 0, 30000);
+         server1 = ServerUtil.startServer(args[1], ReplicatedFailbackStaticExample.class.getSimpleName() + "1", 1, 10000);
+
          // Step 1. Get an initial context for looking up JNDI from the server #1
          initialContext = new InitialContext();
 
@@ -97,10 +98,9 @@ public class ReplicatedFailbackStaticExample extends ActiveMQExample
             System.out.println("Got message: " + message0.getText());
          }
 
-         // Step 10. Crash server #1, the live server, and wait a little while to make sure
+         // Step 10. Crash server #0, the live server, and wait a little while to make sure
          // it has really crashed
-         Thread.sleep(5000);
-         killServer(0);
+         ServerUtil.killServer(server0);
 
          // Step 11. Acknowledging the 2nd half of the sent messages will fail as failover to the
          // backup server has occurred
@@ -121,9 +121,7 @@ public class ReplicatedFailbackStaticExample extends ActiveMQExample
          }
          message0.acknowledge();
 
-         reStartServer(0, 10000);
-
-         Thread.sleep(10000);
+         server0 = ServerUtil.startServer(args[0], ReplicatedFailbackStaticExample.class.getSimpleName() + "0", 0, 10000);
 
          // Step 11. Acknowledging the 2nd half of the sent messages will fail as failover to the
          // backup server has occurred
@@ -143,8 +141,6 @@ public class ReplicatedFailbackStaticExample extends ActiveMQExample
             System.out.printf("Got message: %s (redelivered?: %s)\n", message0.getText(), message0.getJMSRedelivered());
          }
          message0.acknowledge();
-
-         return true;
       }
       finally
       {
@@ -159,7 +155,9 @@ public class ReplicatedFailbackStaticExample extends ActiveMQExample
          {
             initialContext.close();
          }
+
+         ServerUtil.killServer(server0);
+         ServerUtil.killServer(server1);
       }
    }
-
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/replicated-failback-static/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/replicated-failback-static/src/main/resources/activemq/server0/artemis-roles.properties b/examples/jms/replicated-failback-static/src/main/resources/activemq/server0/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/replicated-failback-static/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/replicated-failback-static/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/replicated-failback-static/src/main/resources/activemq/server0/artemis-users.properties b/examples/jms/replicated-failback-static/src/main/resources/activemq/server0/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/replicated-failback-static/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/replicated-failback-static/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/replicated-failback-static/src/main/resources/activemq/server0/broker.xml b/examples/jms/replicated-failback-static/src/main/resources/activemq/server0/broker.xml
index 2bb3552..f59bdbc 100644
--- a/examples/jms/replicated-failback-static/src/main/resources/activemq/server0/broker.xml
+++ b/examples/jms/replicated-failback-static/src/main/resources/activemq/server0/broker.xml
@@ -29,13 +29,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
+      <bindings-directory>${data.dir:./data}/bindings</bindings-directory>
 
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
+      <journal-directory>${data.dir:./data}/journal</journal-directory>
 
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
+      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
+      <paging-directory>${data.dir:./data}/paging</paging-directory>
 
       <cluster-user>exampleUser</cluster-user>
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/replicated-failback-static/src/main/resources/activemq/server1/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/replicated-failback-static/src/main/resources/activemq/server1/artemis-roles.properties b/examples/jms/replicated-failback-static/src/main/resources/activemq/server1/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/replicated-failback-static/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/replicated-failback-static/src/main/resources/activemq/server1/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/replicated-failback-static/src/main/resources/activemq/server1/artemis-users.properties b/examples/jms/replicated-failback-static/src/main/resources/activemq/server1/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/replicated-failback-static/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/replicated-failback-static/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/replicated-failback-static/src/main/resources/activemq/server1/broker.xml b/examples/jms/replicated-failback-static/src/main/resources/activemq/server1/broker.xml
index 71e2e4e..9173c64 100644
--- a/examples/jms/replicated-failback-static/src/main/resources/activemq/server1/broker.xml
+++ b/examples/jms/replicated-failback-static/src/main/resources/activemq/server1/broker.xml
@@ -29,13 +29,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>${data.dir}/server1/data/messaging/bindings</bindings-directory>
+      <bindings-directory>${data.dir:./data}/bindings</bindings-directory>
 
-      <journal-directory>${data.dir}/server1/data/messaging/journal</journal-directory>
+      <journal-directory>${data.dir:./data}/journal</journal-directory>
 
-      <large-messages-directory>${data.dir}/server1/data/messaging/largemessages</large-messages-directory>
+      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir}/server1/data/messaging/paging</paging-directory>
+      <paging-directory>${data.dir:./data}/paging</paging-directory>
 
       <cluster-user>exampleUser</cluster-user>
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/replicated-failback/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/replicated-failback/pom.xml b/examples/jms/replicated-failback/pom.xml
index 7a27d38..d9c5150 100644
--- a/examples/jms/replicated-failback/pom.xml
+++ b/examples/jms/replicated-failback/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>
@@ -68,7 +68,7 @@ under the License.
                         </configuration>
                      </execution>
                      <execution>
-                        <id>create2</id>
+                        <id>create1</id>
                         <goals>
                            <goal>create</goal>
                         </goals>
@@ -104,5 +104,4 @@ under the License.
          </build>
       </profile>
    </profiles>
-
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/replicated-failback/src/main/java/org/apache/activemq/artemis/jms/example/ReplicatedFailbackExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/replicated-failback/src/main/java/org/apache/activemq/artemis/jms/example/ReplicatedFailbackExample.java b/examples/jms/replicated-failback/src/main/java/org/apache/activemq/artemis/jms/example/ReplicatedFailbackExample.java
index 02fcbaf..1cd933a 100644
--- a/examples/jms/replicated-failback/src/main/java/org/apache/activemq/artemis/jms/example/ReplicatedFailbackExample.java
+++ b/examples/jms/replicated-failback/src/main/java/org/apache/activemq/artemis/jms/example/ReplicatedFailbackExample.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.JMSException;
@@ -26,8 +28,6 @@ import javax.jms.Session;
 import javax.jms.TextMessage;
 import javax.naming.InitialContext;
 
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
-
 /**
  * Example of live and replicating backup pair.
  * <p>
@@ -35,21 +35,13 @@ import org.apache.activemq.artemis.common.example.ActiveMQExample;
  * <p>
  * Later the live server is restarted and takes back its position by asking the backup to stop ("fail-back").
  */
-public class ReplicatedFailbackExample extends ActiveMQExample
+public class ReplicatedFailbackExample
 {
-   public static void main(final String[] args)
-   {
-      new ReplicatedFailbackExample().run(args);
-   }
+   private static Process server0;
 
-   protected void startServers(String[] serversArgs) throws Exception
-   {
-      startServer(0, 60000);
-      startServer(1, 10000);
-   }
+   private static Process server1;
 
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(final String[] args) throws Exception
    {
       final int numMessages = 30;
 
@@ -59,6 +51,9 @@ public class ReplicatedFailbackExample extends ActiveMQExample
 
       try
       {
+         server0 = ServerUtil.startServer(args[0], ReplicatedFailbackExample.class.getSimpleName() + "0", 0, 30000);
+         server1 = ServerUtil.startServer(args[1], ReplicatedFailbackExample.class.getSimpleName() + "1", 1, 10000);
+
          // Step 1. Get an initial context for looking up JNDI from the server #1
          initialContext = new InitialContext();
 
@@ -103,10 +98,9 @@ public class ReplicatedFailbackExample extends ActiveMQExample
             System.out.println("Got message: " + message0.getText());
          }
 
-         // Step 10. Crash server #1, the live server, and wait a little while to make sure
+         // Step 10. Crash server #0, the live server, and wait a little while to make sure
          // it has really crashed
-         Thread.sleep(5000);
-         killServer(0);
+         ServerUtil.killServer(server0);
 
          // Step 11. Acknowledging the 2nd half of the sent messages will fail as failover to the
          // backup server has occurred
@@ -127,9 +121,7 @@ public class ReplicatedFailbackExample extends ActiveMQExample
          }
          message0.acknowledge();
 
-         reStartServer(0, 10000);
-
-         Thread.sleep(10000);
+         server0 = ServerUtil.startServer(args[0], ReplicatedFailbackExample.class.getSimpleName() + "0", 0, 10000);
 
          // Step 11. Acknowledging the 2nd half of the sent messages will fail as failover to the
          // backup server has occurred
@@ -149,8 +141,6 @@ public class ReplicatedFailbackExample extends ActiveMQExample
             System.out.printf("Got message: %s (redelivered?: %s)\n", message0.getText(), message0.getJMSRedelivered());
          }
          message0.acknowledge();
-
-         return true;
       }
       finally
       {
@@ -165,7 +155,9 @@ public class ReplicatedFailbackExample extends ActiveMQExample
          {
             initialContext.close();
          }
+
+         ServerUtil.killServer(server0);
+         ServerUtil.killServer(server1);
       }
    }
-
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/replicated-failback/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/replicated-failback/src/main/resources/activemq/server0/artemis-roles.properties b/examples/jms/replicated-failback/src/main/resources/activemq/server0/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/replicated-failback/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/replicated-failback/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/replicated-failback/src/main/resources/activemq/server0/artemis-users.properties b/examples/jms/replicated-failback/src/main/resources/activemq/server0/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/replicated-failback/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/replicated-failback/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/replicated-failback/src/main/resources/activemq/server0/broker.xml b/examples/jms/replicated-failback/src/main/resources/activemq/server0/broker.xml
index e762e2c..ab85a38 100644
--- a/examples/jms/replicated-failback/src/main/resources/activemq/server0/broker.xml
+++ b/examples/jms/replicated-failback/src/main/resources/activemq/server0/broker.xml
@@ -29,13 +29,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>${data.dir}/live/bindings</bindings-directory>
+      <bindings-directory>${data.dir:./data}/bindings</bindings-directory>
 
-      <journal-directory>${data.dir}/live/journal</journal-directory>
+      <journal-directory>${data.dir:./data}/journal</journal-directory>
 
-      <large-messages-directory>${data.dir}/live/largemessages</large-messages-directory>
+      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir}/live/paging</paging-directory>
+      <paging-directory>${data.dir:./data}/paging</paging-directory>
 
       <cluster-user>exampleUser</cluster-user>
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/replicated-failback/src/main/resources/activemq/server1/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/replicated-failback/src/main/resources/activemq/server1/artemis-roles.properties b/examples/jms/replicated-failback/src/main/resources/activemq/server1/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/replicated-failback/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/replicated-failback/src/main/resources/activemq/server1/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/replicated-failback/src/main/resources/activemq/server1/artemis-users.properties b/examples/jms/replicated-failback/src/main/resources/activemq/server1/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/replicated-failback/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/replicated-failback/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/replicated-failback/src/main/resources/activemq/server1/broker.xml b/examples/jms/replicated-failback/src/main/resources/activemq/server1/broker.xml
index af242b9..cfb7e33 100644
--- a/examples/jms/replicated-failback/src/main/resources/activemq/server1/broker.xml
+++ b/examples/jms/replicated-failback/src/main/resources/activemq/server1/broker.xml
@@ -29,13 +29,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>${data.dir}/bkp/bindings</bindings-directory>
+      <bindings-directory>${data.dir:./data}/bindings</bindings-directory>
 
-      <journal-directory>${data.dir}/bkp/journal</journal-directory>
+      <journal-directory>${data.dir:./data}/journal</journal-directory>
 
-      <large-messages-directory>${data.dir}/bkp/largemessages</large-messages-directory>
+      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir}/bkp/paging</paging-directory>
+      <paging-directory>${data.dir:./data}/paging</paging-directory>
 
       <cluster-user>exampleUser</cluster-user>
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/replicated-multiple-failover/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/replicated-multiple-failover/pom.xml b/examples/jms/replicated-multiple-failover/pom.xml
index 60ba4a6..d1af812 100644
--- a/examples/jms/replicated-multiple-failover/pom.xml
+++ b/examples/jms/replicated-multiple-failover/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>
@@ -68,7 +68,7 @@ under the License.
                         </configuration>
                      </execution>
                      <execution>
-                        <id>create2</id>
+                        <id>create1</id>
                         <goals>
                            <goal>create</goal>
                         </goals>
@@ -79,6 +79,17 @@ under the License.
                         </configuration>
                      </execution>
                      <execution>
+                        <id>create2</id>
+                        <goals>
+                           <goal>create</goal>
+                        </goals>
+                        <configuration>
+                           <instance>${basedir}/target/server2</instance>
+                           <configuration>${basedir}/target/classes/activemq/server2</configuration>
+                           <javaOptions>-Dudp-address=${udp-address}</javaOptions>
+                        </configuration>
+                     </execution>
+                     <execution>
                         <id>runClient</id>
                         <goals>
                            <goal>runClient</goal>
@@ -88,6 +99,7 @@ under the License.
                            <args>
                               <param>${basedir}/target/server0</param>
                               <param>${basedir}/target/server1</param>
+                              <param>${basedir}/target/server2</param>
                            </args>
                         </configuration>
                      </execution>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/replicated-multiple-failover/src/main/java/org/apache/activemq/artemis/jms/example/ReplicatedMultipleFailoverExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/replicated-multiple-failover/src/main/java/org/apache/activemq/artemis/jms/example/ReplicatedMultipleFailoverExample.java b/examples/jms/replicated-multiple-failover/src/main/java/org/apache/activemq/artemis/jms/example/ReplicatedMultipleFailoverExample.java
index 3885065..31dc492 100644
--- a/examples/jms/replicated-multiple-failover/src/main/java/org/apache/activemq/artemis/jms/example/ReplicatedMultipleFailoverExample.java
+++ b/examples/jms/replicated-multiple-failover/src/main/java/org/apache/activemq/artemis/jms/example/ReplicatedMultipleFailoverExample.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.JMSException;
@@ -26,17 +28,15 @@ import javax.jms.Session;
 import javax.jms.TextMessage;
 import javax.naming.InitialContext;
 
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
-
-public class ReplicatedMultipleFailoverExample extends ActiveMQExample
+public class ReplicatedMultipleFailoverExample
 {
-   public static void main(final String[] args)
-   {
-      new ReplicatedMultipleFailoverExample().run(args);
-   }
+   private static Process server0;
+
+   private static Process server1;
+
+   private static Process server2;
 
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(final String[] args) throws Exception
    {
       final int numMessages = 30;
 
@@ -46,6 +46,12 @@ public class ReplicatedMultipleFailoverExample extends ActiveMQExample
 
       try
       {
+         server0 = ServerUtil.startServer(args[0], ReplicatedMultipleFailoverExample.class.getSimpleName() + "0", 0, 5000);
+         server1 = ServerUtil.startServer(args[1], ReplicatedMultipleFailoverExample.class.getSimpleName() + "1", 1, 5000);
+         server2 = ServerUtil.startServer(args[2], ReplicatedMultipleFailoverExample.class.getSimpleName() + "2", 2, 5000);
+
+         Process[] processes = new Process[] {server0, server1, server2};
+
          // Step 1. Get an initial context for looking up JNDI from the server #1
          initialContext = new InitialContext();
 
@@ -90,10 +96,10 @@ public class ReplicatedMultipleFailoverExample extends ActiveMQExample
             System.out.println("Got message: " + message0.getText());
          }
 
-         // Step 10. Crash server #1, the live server, and wait a little while to make sure
+         // Step 10. Crash server #0, the live server, and wait a little while to make sure
          // it has really crashed
+         ServerUtil.killServer(server0);
          Thread.sleep(5000);
-         killServer(0);
 
          // Step 11. Acknowledging the 2nd half of the sent messages will fail as failover to the
          // backup server has occurred
@@ -114,8 +120,7 @@ public class ReplicatedMultipleFailoverExample extends ActiveMQExample
          }
          message0.acknowledge();
 
-         Thread.sleep(5000);
-         killServer(getServer(connection));
+         ServerUtil.killServer(processes[ServerUtil.getServer(connection)]);
 
          // Step 11. Acknowledging the 2nd half of the sent messages will fail as failover to the
          // backup server has occurred
@@ -135,8 +140,6 @@ public class ReplicatedMultipleFailoverExample extends ActiveMQExample
             System.out.printf("Got message: %s (redelivered?: %s)%n", message0.getText(), message0.getJMSRedelivered());
          }
          message0.acknowledge();
-
-         return true;
       }
       finally
       {
@@ -151,7 +154,10 @@ public class ReplicatedMultipleFailoverExample extends ActiveMQExample
          {
             initialContext.close();
          }
+
+         ServerUtil.killServer(server0);
+         ServerUtil.killServer(server1);
+         ServerUtil.killServer(server2);
       }
    }
-
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/replicated-multiple-failover/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/replicated-multiple-failover/src/main/resources/activemq/server0/artemis-roles.properties b/examples/jms/replicated-multiple-failover/src/main/resources/activemq/server0/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/replicated-multiple-failover/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/replicated-multiple-failover/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/replicated-multiple-failover/src/main/resources/activemq/server0/artemis-users.properties b/examples/jms/replicated-multiple-failover/src/main/resources/activemq/server0/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/replicated-multiple-failover/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/replicated-multiple-failover/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/replicated-multiple-failover/src/main/resources/activemq/server0/broker.xml b/examples/jms/replicated-multiple-failover/src/main/resources/activemq/server0/broker.xml
index eb47eb2..fb321c2 100644
--- a/examples/jms/replicated-multiple-failover/src/main/resources/activemq/server0/broker.xml
+++ b/examples/jms/replicated-multiple-failover/src/main/resources/activemq/server0/broker.xml
@@ -29,13 +29,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
+      <bindings-directory>${data.dir:./data}/bindings</bindings-directory>
 
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
+      <journal-directory>${data.dir:./data}/journal</journal-directory>
 
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
+      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
+      <paging-directory>${data.dir:./data}/paging</paging-directory>
 
       <ha-policy>
          <replication>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/replicated-multiple-failover/src/main/resources/activemq/server1/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/replicated-multiple-failover/src/main/resources/activemq/server1/artemis-roles.properties b/examples/jms/replicated-multiple-failover/src/main/resources/activemq/server1/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/replicated-multiple-failover/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/replicated-multiple-failover/src/main/resources/activemq/server1/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/replicated-multiple-failover/src/main/resources/activemq/server1/artemis-users.properties b/examples/jms/replicated-multiple-failover/src/main/resources/activemq/server1/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/replicated-multiple-failover/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/replicated-multiple-failover/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/replicated-multiple-failover/src/main/resources/activemq/server1/broker.xml b/examples/jms/replicated-multiple-failover/src/main/resources/activemq/server1/broker.xml
index 344bfbf..1cb959c 100644
--- a/examples/jms/replicated-multiple-failover/src/main/resources/activemq/server1/broker.xml
+++ b/examples/jms/replicated-multiple-failover/src/main/resources/activemq/server1/broker.xml
@@ -29,13 +29,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>${data.dir}/server1/data/messaging/bindings</bindings-directory>
+      <bindings-directory>${data.dir:./data}/bindings</bindings-directory>
 
-      <journal-directory>${data.dir}/server1/data/messaging/journal</journal-directory>
+      <journal-directory>${data.dir:./data}/journal</journal-directory>
 
-      <large-messages-directory>${data.dir}/server1/data/messaging/largemessages</large-messages-directory>
+      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir}/server1/data/messaging/paging</paging-directory>
+      <paging-directory>${data.dir:./data}/paging</paging-directory>
 
       <ha-policy>
          <replication>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/replicated-multiple-failover/src/main/resources/activemq/server2/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/replicated-multiple-failover/src/main/resources/activemq/server2/artemis-roles.properties b/examples/jms/replicated-multiple-failover/src/main/resources/activemq/server2/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/replicated-multiple-failover/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


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

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/clustered-topic/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredTopicExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-topic/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredTopicExample.java b/examples/jms/clustered-topic/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredTopicExample.java
index eae9366..31b3d41 100644
--- a/examples/jms/clustered-topic/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredTopicExample.java
+++ b/examples/jms/clustered-topic/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredTopicExample.java
@@ -26,21 +26,13 @@ import javax.jms.Topic;
 import javax.naming.InitialContext;
 import java.util.Hashtable;
 
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
-
 /**
  * A simple example that shows a JMS Topic clustered across two nodes of a cluster.
  * Messages are sent on one node and received by consumers on both nodes.
  */
-public class ClusteredTopicExample extends ActiveMQExample
+public class ClusteredTopicExample
 {
-   public static void main(final String[] args)
-   {
-      new ClusteredTopicExample().run(args);
-   }
-
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(final String[] args) throws Exception
    {
       Connection connection0 = null;
 
@@ -55,7 +47,7 @@ public class ClusteredTopicExample extends ActiveMQExample
          // 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("topic.topic/exampleTopic", "exampleTopic");
          ic0 = new InitialContext(properties);
 
@@ -68,7 +60,7 @@ public class ClusteredTopicExample extends ActiveMQExample
          // Step 4. Get an initial context for looking up JNDI from server 1
          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");
          ic1 = new InitialContext(properties);
 
          // Step 5. Look-up a JMS Connection Factory object from JNDI on server 1
@@ -128,8 +120,6 @@ public class ClusteredTopicExample extends ActiveMQExample
 
             System.out.println("Got message: " + message1.getText() + " from node 1");
          }
-
-         return true;
       }
       finally
       {
@@ -155,5 +145,4 @@ public class ClusteredTopicExample extends ActiveMQExample
          }
       }
    }
-
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/clustered-topic/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-topic/src/main/resources/activemq/server0/artemis-roles.properties b/examples/jms/clustered-topic/src/main/resources/activemq/server0/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/clustered-topic/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-topic/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-topic/src/main/resources/activemq/server0/artemis-users.properties b/examples/jms/clustered-topic/src/main/resources/activemq/server0/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/clustered-topic/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-topic/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-topic/src/main/resources/activemq/server0/broker.xml b/examples/jms/clustered-topic/src/main/resources/activemq/server0/broker.xml
index 604bcf8..452b412 100644
--- a/examples/jms/clustered-topic/src/main/resources/activemq/server0/broker.xml
+++ b/examples/jms/clustered-topic/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-topic/src/main/resources/activemq/server1/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-topic/src/main/resources/activemq/server1/artemis-roles.properties b/examples/jms/clustered-topic/src/main/resources/activemq/server1/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/clustered-topic/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-topic/src/main/resources/activemq/server1/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-topic/src/main/resources/activemq/server1/artemis-users.properties b/examples/jms/clustered-topic/src/main/resources/activemq/server1/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/clustered-topic/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-topic/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-topic/src/main/resources/activemq/server1/broker.xml b/examples/jms/clustered-topic/src/main/resources/activemq/server1/broker.xml
index 1f5f25d..c1a763b 100644
--- a/examples/jms/clustered-topic/src/main/resources/activemq/server1/broker.xml
+++ b/examples/jms/clustered-topic/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/colocated-failover-scale-down/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/colocated-failover-scale-down/pom.xml b/examples/jms/colocated-failover-scale-down/pom.xml
index a0778b0..ea1fb10 100644
--- a/examples/jms/colocated-failover-scale-down/pom.xml
+++ b/examples/jms/colocated-failover-scale-down/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>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/colocated-failover-scale-down/src/main/java/org/apache/activemq/artemis/jms/example/ColocatedFailoverScaleDownExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/colocated-failover-scale-down/src/main/java/org/apache/activemq/artemis/jms/example/ColocatedFailoverScaleDownExample.java b/examples/jms/colocated-failover-scale-down/src/main/java/org/apache/activemq/artemis/jms/example/ColocatedFailoverScaleDownExample.java
index 678fbf9..29f54c3 100644
--- a/examples/jms/colocated-failover-scale-down/src/main/java/org/apache/activemq/artemis/jms/example/ColocatedFailoverScaleDownExample.java
+++ b/examples/jms/colocated-failover-scale-down/src/main/java/org/apache/activemq/artemis/jms/example/ColocatedFailoverScaleDownExample.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;
@@ -24,23 +26,20 @@ import javax.jms.Queue;
 import javax.jms.Session;
 import javax.jms.TextMessage;
 import javax.naming.InitialContext;
+import java.lang.IllegalStateException;
 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.
  */
-public class ColocatedFailoverScaleDownExample extends ActiveMQExample
+public class ColocatedFailoverScaleDownExample
 {
-   public static void main(final String[] args) throws Exception
-   {
-      new ColocatedFailoverScaleDownExample().run(args);
-   }
+   private static Process server0;
+
+   private static Process server1;
 
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(final String[] args) throws Exception
    {
       final int numMessages = 30;
 
@@ -52,15 +51,18 @@ public class ColocatedFailoverScaleDownExample extends ActiveMQExample
 
       try
       {
+         server0 = ServerUtil.startServer(args[0], ColocatedFailoverScaleDownExample.class.getSimpleName() + "0", 0, 5000);
+         server1 = ServerUtil.startServer(args[1], ColocatedFailoverScaleDownExample.class.getSimpleName() + "1", 1, 5000);
+
          // Step 1. Get an initial context for looking up JNDI for both servers
          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_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_TCP1 + "?ha=true&retryInterval=1000&retryIntervalMultiplier=1.0&reconnectAttempts=-1");
+         properties.put("connectionFactory.ConnectionFactory", "tcp://localhost:61616?ha=true&retryInterval=1000&retryIntervalMultiplier=1.0&reconnectAttempts=-1");
          properties.put("queue.queue/exampleQueue", "exampleQueue");
          initialContext = new InitialContext(properties);
 
@@ -94,10 +96,9 @@ public class ColocatedFailoverScaleDownExample extends ActiveMQExample
 
          // Step 7. Crash server #0, the live server, and wait a little while to make sure
          // it has really crashed
-         killServer(0);
+         ServerUtil.killServer(server0);
          Thread.sleep(5000);
 
-
          // Step 8. start the connection ready to receive messages
          connection1.start();
 
@@ -111,11 +112,13 @@ public class ColocatedFailoverScaleDownExample extends ActiveMQExample
          for (int i = 0; i < numMessages * 2; i++)
          {
             message0 = (TextMessage)consumer.receive(5000);
+            if (message0 == null)
+            {
+               throw new IllegalStateException("Message not received!");
+            }
             System.out.println("Got message: " + message0.getText());
          }
          message0.acknowledge();
-
-         return true;
       }
       finally
       {
@@ -139,7 +142,9 @@ public class ColocatedFailoverScaleDownExample extends ActiveMQExample
          {
             initialContext1.close();
          }
+
+         ServerUtil.killServer(server0);
+         ServerUtil.killServer(server1);
       }
    }
-
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/colocated-failover-scale-down/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/colocated-failover-scale-down/src/main/resources/activemq/server0/artemis-roles.properties b/examples/jms/colocated-failover-scale-down/src/main/resources/activemq/server0/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/colocated-failover-scale-down/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/colocated-failover-scale-down/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/colocated-failover-scale-down/src/main/resources/activemq/server0/artemis-users.properties b/examples/jms/colocated-failover-scale-down/src/main/resources/activemq/server0/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/colocated-failover-scale-down/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/colocated-failover-scale-down/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/colocated-failover-scale-down/src/main/resources/activemq/server0/broker.xml b/examples/jms/colocated-failover-scale-down/src/main/resources/activemq/server0/broker.xml
index 8c68c8d..60201ca 100644
--- a/examples/jms/colocated-failover-scale-down/src/main/resources/activemq/server0/broker.xml
+++ b/examples/jms/colocated-failover-scale-down/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>../../server0/data/messaging/bindings</bindings-directory>
+      <journal-directory>${data.dir:../data}/journal</journal-directory>
 
-      <journal-directory>../../server0/data/messaging/journal</journal-directory>
+      <large-messages-directory>${data.dir:../data}/largemessages</large-messages-directory>
 
-      <large-messages-directory>../../server0/data/messaging/largemessages</large-messages-directory>
-
-      <paging-directory>../../server0/data/messaging/paging</paging-directory>
+      <paging-directory>${data.dir:../data}/paging</paging-directory>
       <!-- Connectors -->
 
       <connectors>
@@ -91,7 +90,9 @@ under the License.
                <backup-request-retry-interval>2000</backup-request-retry-interval>
                <max-backups>1</max-backups>
                <request-backup>true</request-backup>
-               <master/>
+               <master>
+                  <failover-on-shutdown>true</failover-on-shutdown>
+               </master>
                <slave>
                   <scale-down/>
                </slave>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/colocated-failover-scale-down/src/main/resources/activemq/server1/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/colocated-failover-scale-down/src/main/resources/activemq/server1/artemis-roles.properties b/examples/jms/colocated-failover-scale-down/src/main/resources/activemq/server1/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/colocated-failover-scale-down/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/colocated-failover-scale-down/src/main/resources/activemq/server1/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/colocated-failover-scale-down/src/main/resources/activemq/server1/artemis-users.properties b/examples/jms/colocated-failover-scale-down/src/main/resources/activemq/server1/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/colocated-failover-scale-down/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/colocated-failover-scale-down/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/colocated-failover-scale-down/src/main/resources/activemq/server1/broker.xml b/examples/jms/colocated-failover-scale-down/src/main/resources/activemq/server1/broker.xml
index 6ad15ef..7892fc1 100644
--- a/examples/jms/colocated-failover-scale-down/src/main/resources/activemq/server1/broker.xml
+++ b/examples/jms/colocated-failover-scale-down/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>../../server1/data/messaging/bindings</bindings-directory>
+      <journal-directory>${data.dir:../data}/journal</journal-directory>
 
-      <journal-directory>../../server1/data/messaging/journal</journal-directory>
+      <large-messages-directory>${data.dir:../data}/largemessages</large-messages-directory>
 
-      <large-messages-directory>../../server1/data/messaging/largemessages</large-messages-directory>
-
-      <paging-directory>../../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/colocated-failover/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/colocated-failover/pom.xml b/examples/jms/colocated-failover/pom.xml
index fb697b2..a501d38 100644
--- a/examples/jms/colocated-failover/pom.xml
+++ b/examples/jms/colocated-failover/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>
@@ -102,5 +102,4 @@ under the License.
          </build>
       </profile>
    </profiles>
-
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/colocated-failover/src/main/java/org/apache/activemq/artemis/jms/example/ColocatedFailoverExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/colocated-failover/src/main/java/org/apache/activemq/artemis/jms/example/ColocatedFailoverExample.java b/examples/jms/colocated-failover/src/main/java/org/apache/activemq/artemis/jms/example/ColocatedFailoverExample.java
index de823a4..ad62419 100644
--- a/examples/jms/colocated-failover/src/main/java/org/apache/activemq/artemis/jms/example/ColocatedFailoverExample.java
+++ b/examples/jms/colocated-failover/src/main/java/org/apache/activemq/artemis/jms/example/ColocatedFailoverExample.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;
@@ -24,23 +26,20 @@ import javax.jms.Queue;
 import javax.jms.Session;
 import javax.jms.TextMessage;
 import javax.naming.InitialContext;
+import java.lang.IllegalStateException;
 import java.util.Hashtable;
 
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
-
 /**
  * A simple example that demonstrates a colocated server
  *
  */
-public class ColocatedFailoverExample extends ActiveMQExample
+public class ColocatedFailoverExample
 {
-   public static void main(final String[] args) throws Exception
-   {
-      new ColocatedFailoverExample().run(args);
-   }
+   private static Process server0;
 
-   @Override
-   public boolean runExample() throws Exception
+   private static Process server1;
+
+   public static void main(final String[] args) throws Exception
    {
       final int numMessages = 30;
 
@@ -52,17 +51,20 @@ public class ColocatedFailoverExample extends ActiveMQExample
 
       try
       {
+         server0 = ServerUtil.startServer(args[0], ColocatedFailoverExample.class.getSimpleName() + "0", 0, 5000);
+         server1 = ServerUtil.startServer(args[1], ColocatedFailoverExample.class.getSimpleName() + "1", 1, 5000);
+
          // Step 1. Get an initial context for looking up JNDI for both servers
          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_TCP2);
-         initialContext1 = new InitialContext(properties);
+         properties.put("connectionFactory.ConnectionFactory", "tcp://localhost:61616?ha=true&retryInterval=1000&retryIntervalMultiplier=1.0&reconnectAttempts=-1");
+         properties.put("queue.queue/exampleQueue", "exampleQueue");
+         initialContext = 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_TCP1 + "?ha=true&retryInterval=1000&retryIntervalMultiplier=1.0&reconnectAttempts=-1");
-         properties.put("queue.queue/exampleQueue", "exampleQueue");
-         initialContext = new InitialContext(properties);
+         properties.put("connectionFactory.ConnectionFactory", "tcp://localhost:61617");
+         initialContext1 = new InitialContext(properties);
 
          // Step 2. Look up the JMS resources from JNDI
          Queue queue = (Queue)initialContext.lookup("queue/exampleQueue");
@@ -94,9 +96,7 @@ public class ColocatedFailoverExample extends ActiveMQExample
 
          // Step 7. Crash server #0, the live server, and wait a little while to make sure
          // it has really crashed
-         killServer(0);
-         Thread.sleep(5000);
-
+         ServerUtil.killServer(server0);
 
          // Step 8. start the connection ready to receive messages
          connection.start();
@@ -111,6 +111,10 @@ public class ColocatedFailoverExample extends ActiveMQExample
          for (int i = 0; i < numMessages; i++)
          {
             message0 = (TextMessage)consumer.receive(5000);
+            if (message0 == null)
+            {
+               throw new IllegalStateException("Message not received!");
+            }
             System.out.println("Got message: " + message0.getText());
          }
          message0.acknowledge();
@@ -124,8 +128,6 @@ public class ColocatedFailoverExample extends ActiveMQExample
             System.out.println("Got message: " + message0.getText());
          }
          message0.acknowledge();
-
-         return true;
       }
       finally
       {
@@ -149,7 +151,9 @@ public class ColocatedFailoverExample extends ActiveMQExample
          {
             initialContext1.close();
          }
+
+         ServerUtil.killServer(server0);
+         ServerUtil.killServer(server1);
       }
    }
-
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/colocated-failover/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/colocated-failover/src/main/resources/activemq/server0/artemis-roles.properties b/examples/jms/colocated-failover/src/main/resources/activemq/server0/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/colocated-failover/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/colocated-failover/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/colocated-failover/src/main/resources/activemq/server0/artemis-users.properties b/examples/jms/colocated-failover/src/main/resources/activemq/server0/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/colocated-failover/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/colocated-failover/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/colocated-failover/src/main/resources/activemq/server0/broker.xml b/examples/jms/colocated-failover/src/main/resources/activemq/server0/broker.xml
index 554d01f..b38d764 100644
--- a/examples/jms/colocated-failover/src/main/resources/activemq/server0/broker.xml
+++ b/examples/jms/colocated-failover/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>../../server0/data/messaging/bindings</bindings-directory>
+      <journal-directory>${data.dir:../data}/journal</journal-directory>
 
-      <journal-directory>../../server0/data/messaging/journal</journal-directory>
+      <large-messages-directory>${data.dir:../data}/largemessages</large-messages-directory>
 
-      <large-messages-directory>../../server0/data/messaging/largemessages</large-messages-directory>
-
-      <paging-directory>../../server0/data/messaging/paging</paging-directory>
+      <paging-directory>${data.dir:../data}/paging</paging-directory>
       <!-- Connectors -->
 
       <connectors>
@@ -87,7 +86,9 @@ under the License.
                <backup-request-retry-interval>2000</backup-request-retry-interval>
                <max-backups>1</max-backups>
                <request-backup>true</request-backup>
-               <master/>
+               <master>
+                  <failover-on-shutdown>true</failover-on-shutdown>
+               </master>
                <slave/>
             </colocated>
          </shared-store>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/colocated-failover/src/main/resources/activemq/server1/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/colocated-failover/src/main/resources/activemq/server1/artemis-roles.properties b/examples/jms/colocated-failover/src/main/resources/activemq/server1/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/colocated-failover/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/colocated-failover/src/main/resources/activemq/server1/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/colocated-failover/src/main/resources/activemq/server1/artemis-users.properties b/examples/jms/colocated-failover/src/main/resources/activemq/server1/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/colocated-failover/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/colocated-failover/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/colocated-failover/src/main/resources/activemq/server1/broker.xml b/examples/jms/colocated-failover/src/main/resources/activemq/server1/broker.xml
index 2fda160..f0dd088 100644
--- a/examples/jms/colocated-failover/src/main/resources/activemq/server1/broker.xml
+++ b/examples/jms/colocated-failover/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>../../server1/data/messaging/bindings</bindings-directory>
+      <journal-directory>${data.dir:../data}/journal</journal-directory>
 
-      <journal-directory>../../server1/data/messaging/journal</journal-directory>
+      <large-messages-directory>${data.dir:../data}/largemessages</large-messages-directory>
 
-      <large-messages-directory>../../server1/data/messaging/largemessages</large-messages-directory>
-
-      <paging-directory>../../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/common/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/common/pom.xml b/examples/jms/common/pom.xml
deleted file mode 100644
index 4681cac..0000000
--- a/examples/jms/common/pom.xml
+++ /dev/null
@@ -1,65 +0,0 @@
-<?xml version='1.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.
--->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-   <modelVersion>4.0.0</modelVersion>
-
-   <parent>
-      <groupId>org.apache.activemq.examples.jms</groupId>
-      <artifactId>jms-examples</artifactId>
-      <version>1.0.1-SNAPSHOT</version>
-   </parent>
-
-   <artifactId>common</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis Examples common</name>
-
-   <properties>
-      <activemq.basedir>${project.basedir}/../../..</activemq.basedir>
-   </properties>
-
-   <dependencies>
-      <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
-      </dependency>
-      <dependency>
-         <groupId>org.apache.activemq</groupId>
-         <artifactId>artemis-commons</artifactId>
-         <version>${project.version}</version>
-      </dependency>
-      <dependency>
-         <groupId>org.apache.activemq</groupId>
-         <artifactId>artemis-core-client</artifactId>
-         <version>${project.version}</version>
-      </dependency>
-      <dependency>
-         <groupId>org.apache.activemq</groupId>
-         <artifactId>artemis-jms-client</artifactId>
-         <version>${project.version}</version>
-      </dependency>
-      <dependency>
-         <groupId>io.netty</groupId>
-         <artifactId>netty-all</artifactId>
-         <version>${netty.version}</version>
-      </dependency>
-   </dependencies>
-
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/common/src/main/java/org/apache/activemq/artemis/common/example/ActiveMQExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/common/src/main/java/org/apache/activemq/artemis/common/example/ActiveMQExample.java b/examples/jms/common/src/main/java/org/apache/activemq/artemis/common/example/ActiveMQExample.java
deleted file mode 100644
index b3b791b..0000000
--- a/examples/jms/common/src/main/java/org/apache/activemq/artemis/common/example/ActiveMQExample.java
+++ /dev/null
@@ -1,274 +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.
- */
-package org.apache.activemq.artemis.common.example;
-
-import javax.jms.Connection;
-import java.util.HashMap;
-import java.util.logging.Logger;
-
-import org.apache.activemq.artemis.api.core.TransportConfiguration;
-import org.apache.activemq.artemis.api.core.client.ClientSession;
-import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
-import org.apache.activemq.artemis.api.jms.JMSFactoryType;
-import org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnectorFactory;
-import org.apache.activemq.artemis.jms.client.ActiveMQConnection;
-import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
-
-/**
- * This cass is a base class for all the tests where we have a few utilities to start and stop servers *
- */
-public abstract class ActiveMQExample
-{
-   protected static final Logger log = Logger.getLogger(ActiveMQExample.class.getName());
-   public static final int DEFAULT_PORT = 61616;
-
-   public static final String DEFAULT_TCP1 = "tcp://localhost:61616";
-   public static final String DEFAULT_TCP2 = "tcp://localhost:61617";
-   public static final String DEFAULT_TCP3 = "tcp://localhost:61618";
-   public static final String DEFAULT_TCP4 = "tcp://localhost:61619";
-
-   protected boolean failure = false;
-
-   protected String[] serversArgs;
-
-   protected Process[] processes;
-
-
-   // This is to make sure we stop the servers when the example is shutdown
-   // as we start the servers with the example
-   Thread hook;
-
-   public void run(String servers[])
-   {
-      try
-      {
-         setupServers(servers);
-         if (!runExample())
-         {
-            failure = true;
-         }
-      }
-      catch (Throwable throwable)
-      {
-         failure = true;
-         throwable.printStackTrace();
-      }
-      finally
-      {
-         try
-         {
-            stopAllServers();
-         }
-         catch (Throwable ignored)
-         {
-            ignored.printStackTrace();
-         }
-      }
-
-      reportResultAndExit();
-
-   }
-   public abstract boolean runExample() throws Exception;
-
-   public void close() throws Exception
-   {
-
-      if (hook != null)
-      {
-         Runtime.getRuntime().removeShutdownHook(hook);
-         hook = null;
-      }
-      stopAllServers();
-   }
-
-   /** This will start the servers */
-   private final ActiveMQExample setupServers(String[] serversArgs) throws Exception
-   {
-      hook = new Thread()
-      {
-         public void run()
-         {
-            try
-            {
-               System.out.println("Shutting down servers!!!");
-               System.out.flush();
-               ActiveMQExample.this.stopAllServers();
-            }
-            catch (Exception e)
-            {
-               e.printStackTrace();
-            }
-         }
-      };
-
-      Runtime.getRuntime().addShutdownHook(hook);
-      this.serversArgs = serversArgs;
-
-      if (serversArgs == null)
-      {
-         serversArgs = new String[0];
-      }
-
-      processes = new Process[serversArgs.length];
-      startServers(serversArgs);
-
-      return this;
-   }
-
-   protected void startServers(String[] serversArgs) throws Exception
-   {
-      for (int i = 0; i < serversArgs.length; i++)
-      {
-         startServer(i, 5000);
-      }
-   }
-
-   protected void stopAllServers() throws Exception
-   {
-      if (processes != null)
-      {
-         for (int i = 0; i < processes.length; i++)
-         {
-            killServer(i);
-         }
-      }
-   }
-
-   protected void killServer(final int id) throws Exception
-   {
-      if (id > processes.length)
-      {
-         System.out.println("**********************************");
-         System.out.println("Kill server " + id + " manually, will wait 5 seconds for that being done");
-         Thread.sleep(5000);
-      }
-
-      if (processes[id] != null)
-      {
-         System.out.println("**********************************");
-         System.out.println("Kill server " + id);
-         processes[id].destroyForcibly();
-         processes[id].waitFor();
-//         processes[id].destroy();
-         processes[id] = null;
-         Thread.sleep(1000);
-      }
-   }
-
-   protected void reStartServer(final int id, final long timeout) throws Exception
-   {
-      startServer(id, timeout);
-   }
-
-   protected void startServer(final int id, final long timeout) throws Exception
-   {
-      if (id > processes.length)
-      {
-         System.out.println("**********************************");
-         System.out.println("Start server " + id + " manually");
-         Thread.sleep(5000);
-      }
-      else
-      {
-         // if started before, will kill it
-         if (processes[id] != null)
-         {
-            killServer(id);
-         }
-      }
-
-      processes[id] = ExampleUtil.startServer(serversArgs[id], "Server_" + id);
-
-      if (timeout != 0)
-      {
-         waitForServerStart(id, timeout);
-      }
-      else
-      {
-         // just some time wait to wait server to form clusters.. etc
-         Thread.sleep(500);
-      }
-   }
-
-   protected void waitForServerStart(int id, long timeoutParameter) throws InterruptedException
-   {
-      // wait for restart
-      long timeout = System.currentTimeMillis() + timeoutParameter;
-      while (System.currentTimeMillis() < timeout)
-      {
-         try
-         {
-            HashMap<String, Object> params = new HashMap<String, Object>();
-            params.put("host", "localhost");
-            params.put("port", DEFAULT_PORT + id);
-            TransportConfiguration transportConfiguration = new TransportConfiguration(NettyConnectorFactory.class.getName(), params);
-            ActiveMQConnectionFactory cf = ActiveMQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, transportConfiguration);
-            cf.createConnection().close();
-            System.out.println("server " + id + " started");
-         }
-         catch (Exception e)
-         {
-            System.out.println("awaiting server " + id + " start at " + (DEFAULT_PORT + id));
-            Thread.sleep(500);
-            continue;
-         }
-         break;
-      }
-   }
-
-   protected int getServer(Connection connection)
-   {
-      ClientSession session = ((ActiveMQConnection) connection).getInitialSession();
-      TransportConfiguration transportConfiguration = session.getSessionFactory().getConnectorConfiguration();
-      String port = (String) transportConfiguration.getParams().get("port");
-      return Integer.valueOf(port) - DEFAULT_PORT;
-   }
-
-   protected Connection getServerConnection(int server, Connection... connections)
-   {
-      for (Connection connection : connections)
-      {
-         ClientSession session = ((ActiveMQConnection) connection).getInitialSession();
-         TransportConfiguration transportConfiguration = session.getSessionFactory().getConnectorConfiguration();
-         String port = (String) transportConfiguration.getParams().get("port");
-         if(Integer.valueOf(port) == server + 61616)
-         {
-            return connection;
-         }
-      }
-      return null;
-   }
-
-   private void reportResultAndExit()
-   {
-      if (failure)
-      {
-         System.err.println();
-         System.err.println("#####################");
-         System.err.println("###    FAILURE!   ###");
-         System.err.println("#####################");
-         throw new RuntimeException("failure in running example");
-      }
-      else
-      {
-         System.out.println();
-         System.out.println("#####################");
-         System.out.println("###    SUCCESS!   ###");
-         System.out.println("#####################");
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/common/src/main/java/org/apache/activemq/artemis/common/example/DummyXid.java
----------------------------------------------------------------------
diff --git a/examples/jms/common/src/main/java/org/apache/activemq/artemis/common/example/DummyXid.java b/examples/jms/common/src/main/java/org/apache/activemq/artemis/common/example/DummyXid.java
deleted file mode 100644
index 05e320f..0000000
--- a/examples/jms/common/src/main/java/org/apache/activemq/artemis/common/example/DummyXid.java
+++ /dev/null
@@ -1,208 +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.
- */
-package org.apache.activemq.artemis.common.example;
-
-import javax.transaction.xa.Xid;
-
-import org.apache.activemq.artemis.utils.Base64;
-
-public class DummyXid implements Xid
-{
-   private static final long serialVersionUID = 407053232840068514L;
-
-   private final byte[] branchQualifier;
-
-   private final int formatId;
-
-   private final byte[] globalTransactionId;
-
-   private int hash;
-
-   private boolean hashCalculated;
-
-   // Static --------------------------------------------------------
-
-   public static String toBase64String(final Xid xid)
-   {
-      return Base64.encodeBytes(DummyXid.toByteArray(xid));
-   }
-
-   private static byte[] toByteArray(final Xid xid)
-   {
-      byte[] branchQualifier = xid.getBranchQualifier();
-      byte[] globalTransactionId = xid.getGlobalTransactionId();
-      int formatId = xid.getFormatId();
-
-      byte[] hashBytes = new byte[branchQualifier.length + globalTransactionId.length + 4];
-      System.arraycopy(branchQualifier, 0, hashBytes, 0, branchQualifier.length);
-      System.arraycopy(globalTransactionId, 0, hashBytes, branchQualifier.length, globalTransactionId.length);
-      byte[] intBytes = new byte[4];
-      for (int i = 0; i < 4; i++)
-      {
-         intBytes[i] = (byte)((formatId >> i * 8) % 0xFF);
-      }
-      System.arraycopy(intBytes, 0, hashBytes, branchQualifier.length + globalTransactionId.length, 4);
-      return hashBytes;
-   }
-
-   // Constructors --------------------------------------------------
-
-   /**
-    * Standard constructor
-    * @param branchQualifier
-    * @param formatId
-    * @param globalTransactionId
-    */
-   public DummyXid(final byte[] branchQualifier, final int formatId, final byte[] globalTransactionId)
-   {
-      this.branchQualifier = branchQualifier;
-      this.formatId = formatId;
-      this.globalTransactionId = globalTransactionId;
-   }
-
-   /**
-    * Copy constructor
-    * @param other
-    */
-   public DummyXid(final Xid other)
-   {
-      branchQualifier = copyBytes(other.getBranchQualifier());
-      formatId = other.getFormatId();
-      globalTransactionId = copyBytes(other.getGlobalTransactionId());
-   }
-
-   // Xid implementation ------------------------------------------------------------------
-
-   public byte[] getBranchQualifier()
-   {
-      return branchQualifier;
-   }
-
-   public int getFormatId()
-   {
-      return formatId;
-   }
-
-   public byte[] getGlobalTransactionId()
-   {
-      return globalTransactionId;
-   }
-
-   // Public -------------------------------------------------------------------------------
-
-   @Override
-   public int hashCode()
-   {
-      if (!hashCalculated)
-      {
-         calcHash();
-      }
-      return hash;
-   }
-
-   @Override
-   public boolean equals(final Object other)
-   {
-      if (this == other)
-      {
-         return true;
-      }
-      if (!(other instanceof Xid))
-      {
-         return false;
-      }
-      Xid xother = (Xid)other;
-      if (xother.getFormatId() != formatId)
-      {
-         return false;
-      }
-      if (xother.getBranchQualifier().length != branchQualifier.length)
-      {
-         return false;
-      }
-      if (xother.getGlobalTransactionId().length != globalTransactionId.length)
-      {
-         return false;
-      }
-      for (int i = 0; i < branchQualifier.length; i++)
-      {
-         byte[] otherBQ = xother.getBranchQualifier();
-         if (branchQualifier[i] != otherBQ[i])
-         {
-            return false;
-         }
-      }
-      for (int i = 0; i < globalTransactionId.length; i++)
-      {
-         byte[] otherGtx = xother.getGlobalTransactionId();
-         if (globalTransactionId[i] != otherGtx[i])
-         {
-            return false;
-         }
-      }
-      return true;
-   }
-
-   @Override
-   public String toString()
-   {
-      return "XidImpl (" + System.identityHashCode(this) +
-             " bq:" +
-             stringRep(branchQualifier) +
-             " formatID:" +
-             formatId +
-             " gtxid:" +
-             stringRep(globalTransactionId);
-   }
-
-   // Private -------------------------------------------------------------------------------
-
-   private String stringRep(final byte[] bytes)
-   {
-      StringBuilder buff = new StringBuilder();
-      for (int i = 0; i < bytes.length; i++)
-      {
-         byte b = bytes[i];
-
-         buff.append(b);
-
-         if (i != bytes.length - 1)
-         {
-            buff.append('.');
-         }
-      }
-
-      return buff.toString();
-   }
-
-   private void calcHash()
-   {
-      byte[] hashBytes = DummyXid.toByteArray(this);
-      String s = new String(hashBytes);
-      hash = s.hashCode();
-      hashCalculated = true;
-   }
-
-   private byte[] copyBytes(final byte[] other)
-   {
-      byte[] bytes = new byte[other.length];
-
-      System.arraycopy(other, 0, bytes, 0, other.length);
-
-      return bytes;
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/common/src/main/java/org/apache/activemq/artemis/common/example/ExampleUtil.java
----------------------------------------------------------------------
diff --git a/examples/jms/common/src/main/java/org/apache/activemq/artemis/common/example/ExampleUtil.java b/examples/jms/common/src/main/java/org/apache/activemq/artemis/common/example/ExampleUtil.java
deleted file mode 100644
index b9bb25d..0000000
--- a/examples/jms/common/src/main/java/org/apache/activemq/artemis/common/example/ExampleUtil.java
+++ /dev/null
@@ -1,122 +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.
- */
-
-package org.apache.activemq.artemis.common.example;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-
-public class ExampleUtil
-{
-   public static Process startServer(String artemisInstance, String serverName) throws Exception
-   {
-      boolean IS_WINDOWS = System.getProperty("os.name").toLowerCase().trim().startsWith("win");
-
-      ProcessBuilder builder = null;
-      if (IS_WINDOWS)
-      {
-         builder = new ProcessBuilder("cmd", "/c", "artemis.cmd", "run");
-      }
-      else
-      {
-         builder = new ProcessBuilder("./artemis", "run");
-      }
-
-      builder.directory(new File(artemisInstance + "/bin"));
-
-      Process process = builder.start();
-
-      ProcessLogger outputLogger = new ProcessLogger(true,
-                                                     process.getInputStream(),
-                                                     serverName + "::Out",
-                                                     false);
-      outputLogger.start();
-
-      // Adding a reader to System.err, so the VM won't hang on a System.err.println as identified on this forum thread:
-      // http://www.jboss.org/index.html?module=bb&op=viewtopic&t=151815
-      ProcessLogger errorLogger = new ProcessLogger(true,
-                                                    process.getErrorStream(),
-                                                    serverName + "::Err",
-                                                    true);
-      errorLogger.start();
-
-      return process;
-   }
-
-
-   /**
-    * Redirect the input stream to a logger (as debug logs)
-    */
-   static class ProcessLogger extends Thread
-   {
-      private final InputStream is;
-
-      private final String logName;
-
-      private final boolean print;
-
-      private final boolean sendToErr;
-
-      boolean failed = false;
-
-      ProcessLogger(final boolean print,
-                    final InputStream is,
-                    final String logName,
-                    final boolean sendToErr) throws ClassNotFoundException
-      {
-         this.is = is;
-         this.print = print;
-         this.logName = logName;
-         this.sendToErr = sendToErr;
-         setDaemon(false);
-      }
-
-      @Override
-      public void run()
-      {
-         try
-         {
-            InputStreamReader isr = new InputStreamReader(is);
-            BufferedReader br = new BufferedReader(isr);
-            String line;
-            while ((line = br.readLine()) != null)
-            {
-               if (print)
-               {
-                  if (sendToErr)
-                  {
-                     System.err.println(logName + " err:" + line);
-                  }
-                  else
-                  {
-                     System.out.println(logName + " out:" + line);
-                  }
-               }
-            }
-         }
-         catch (IOException e)
-         {
-            // ok, stream closed
-         }
-
-      }
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/consumer-rate-limit/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/consumer-rate-limit/pom.xml b/examples/jms/consumer-rate-limit/pom.xml
index d262b3b..b6442a0 100644
--- a/examples/jms/consumer-rate-limit/pom.xml
+++ b/examples/jms/consumer-rate-limit/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>
@@ -61,9 +56,18 @@ under the License.
                         <goals>
                            <goal>create</goal>
                         </goals>
+                     </execution>
+                     <execution>
+                        <id>start</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
                         <configuration>
-                           <instance>${basedir}/target/server0</instance>
-                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                           <spawn>true</spawn>
+                           <testURI>tcp://localhost:61616</testURI>
+                           <args>
+                              <param>run</param>
+                           </args>
                         </configuration>
                      </execution>
                      <execution>
@@ -73,8 +77,16 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.ConsumerRateLimitExample</clientClass>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>stop</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
                            <args>
-                              <param>${basedir}/target/server0</param>
+                              <param>stop</param>
                            </args>
                         </configuration>
                      </execution>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/consumer-rate-limit/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/consumer-rate-limit/readme.html b/examples/jms/consumer-rate-limit/readme.html
index 2baefb3..6492b37 100644
--- a/examples/jms/consumer-rate-limit/readme.html
+++ b/examples/jms/consumer-rate-limit/readme.html
@@ -28,25 +28,15 @@ under the License.
      <h1>JMS Message Consumer Rate Limiting</h1>
 
      <p>With ActiveMQ Artemis you can specify a maximum consume rate at which a JMS MessageConsumer will consume messages.
-     This can be specified when creating or deploying the connection factory. See <code>activemq-jms.xml</code></p>
+     This can be specified when creating or configuring the connection factory. See <code>jndi.properties</code>.</p>
      <p>If this value is specified then ActiveMQ Artemis will ensure that messages are never consumed at a rate higher than
-     the specified rate. This is a form of consumer <i>throttling</i>.</p>     
+     the specified rate. This is a form of consumer <i>throttling</i>.</p>
      <h2>Example step-by-step</h2>
-     <p>In this example we specify a <code>consumer-max-rate</code> of <code>10</code> messages per second in the <code>activemq-jms.xml</code>
-     file when deploying the connection factory:</p>
+     <p>In this example we specify a <code>consumer-max-rate</code> of <code>10</code> messages per second in the <code>jndi.properties</code>
+     file when configuring the connection factory:</p>
      <pre class="prettyprint">
      <code>
-   &lt;connection-factory name="ConnectionFactory"&gt;
-      &lt;connector-ref connector-name="netty-connector"/&gt;
-      &lt;entries&gt;
-         &lt;entry name="ConnectionFactory"/&gt;       
-      &lt;/entries&gt;
-      
-      &lt;!-- We limit consumers created on this connection factory to consume messages at a maximum rate
-      of 10 messages per sec --&gt;
-      &lt;consumer-max-rate&gt;50&lt;/producer-max-rate&gt;
-      
-   &lt;/connection-factory&gt;
+connectionFactory.ConnectionFactory=tcp://localhost:61616?consumerMaxRate=10
      </code>
      </pre>
      <p>We then simply consume as many messages as we can in 10 seconds and note how many messages are actually consumed.</p>
@@ -89,32 +79,32 @@ under the License.
         <pre class="prettyprint">
            <code>MessageConsumer consumer = session.createConsumer(queue);</code>
         </pre>
-        
+
         <li>Start the connection</li>
-        
+
         <pre class="prettyprint">
            <code>
      connection.start();
            </code>
         </pre>
-           
+
 
         <li>Send a bunch of messages</li>
         <pre class="prettyprint">
            <code>
      final int numMessages = 150;
-         
+
      for (int i = 0; i < numMessages; i++)
      {
         TextMessage message = session.createTextMessage("This is text message: " + i);
 
         producer.send(message);
-     }           
+     }
            </code>
         </pre>
-        
+
         <li>Consume as many messages as we can in 10 seconds</li>
-        
+
         <pre class="prettyprint">
            <code>
    final long duration = 10000;
@@ -131,7 +121,7 @@ under the License.
       {
          return false;
       }
-      
+
       i++;
    }
 
@@ -141,19 +131,19 @@ under the License.
 
    System.out.println("We consumed " + i + " messages in " + (end - start) + " milliseconds");
 
-   System.out.println("Actual consume rate was " + rate + " messages per second");           
+   System.out.println("Actual consume rate was " + rate + " messages per second");
            </code>
         </pre>
-        
+
         <li>This should produce output something like:</li>
-        
+
         <pre class="prettyprint">
            <code>
     [java] Sent messages
     [java] Will now try and consume as many as we can in 10 seconds ...
     [java] We consumed 100 messages in 10001 milliseconds
     [java] Actual consume rate was 9.99900009999 messages per second
-                 
+
            </code>
         </pre>
 
@@ -167,7 +157,7 @@ under the License.
               {
                 initialContext.close();
               }
-              
+
               if (connection != null)
               {
                  connection.close();

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/consumer-rate-limit/src/main/java/org/apache/activemq/artemis/jms/example/ConsumerRateLimitExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/consumer-rate-limit/src/main/java/org/apache/activemq/artemis/jms/example/ConsumerRateLimitExample.java b/examples/jms/consumer-rate-limit/src/main/java/org/apache/activemq/artemis/jms/example/ConsumerRateLimitExample.java
index b239ebd..a8a66f9 100644
--- a/examples/jms/consumer-rate-limit/src/main/java/org/apache/activemq/artemis/jms/example/ConsumerRateLimitExample.java
+++ b/examples/jms/consumer-rate-limit/src/main/java/org/apache/activemq/artemis/jms/example/ConsumerRateLimitExample.java
@@ -24,22 +24,15 @@ import javax.jms.Queue;
 import javax.jms.Session;
 import javax.jms.TextMessage;
 import javax.naming.InitialContext;
-
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
+import java.lang.Exception;
 
 /**
  * This example demonstrates how a message consumer can be limited to consumer messages at a maximum rate
  * specified in messages per sec.
  */
-public class ConsumerRateLimitExample extends ActiveMQExample
+public class ConsumerRateLimitExample
 {
-   public static void main(final String[] args)
-   {
-      new ConsumerRateLimitExample().run(args);
-   }
-
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(final String[] args) throws Exception
    {
       Connection connection = null;
       InitialContext initialContext = null;
@@ -100,7 +93,7 @@ public class ConsumerRateLimitExample extends ActiveMQExample
 
             if (message == null)
             {
-               return false;
+               throw new RuntimeException("Message was null");
             }
 
             i++;
@@ -113,8 +106,6 @@ public class ConsumerRateLimitExample extends ActiveMQExample
          System.out.println("We consumed " + i + " messages in " + (end - start) + " milliseconds");
 
          System.out.println("Actual consume rate was " + rate + " messages per second");
-
-         return true;
       }
       finally
       {
@@ -130,5 +121,4 @@ public class ConsumerRateLimitExample extends ActiveMQExample
          }
       }
    }
-
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/consumer-rate-limit/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/consumer-rate-limit/src/main/resources/activemq/server0/artemis-roles.properties b/examples/jms/consumer-rate-limit/src/main/resources/activemq/server0/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/consumer-rate-limit/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/consumer-rate-limit/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/consumer-rate-limit/src/main/resources/activemq/server0/artemis-users.properties b/examples/jms/consumer-rate-limit/src/main/resources/activemq/server0/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/consumer-rate-limit/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/consumer-rate-limit/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/consumer-rate-limit/src/main/resources/activemq/server0/broker.xml b/examples/jms/consumer-rate-limit/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index 7690094..0000000
--- a/examples/jms/consumer-rate-limit/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,60 +0,0 @@
-<?xml version='1.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.
--->
-
-<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-               xmlns="urn:activemq"
-               xsi:schemaLocation="urn:activemq /schema/artemis-server.xsd">
-
-   <jms xmlns="urn:activemq:jms">
-      <!--the queue used by the example-->
-      <queue name="exampleQueue"/>
-   </jms>
-
-   <core xmlns="urn:activemq:core">
-
-      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
-
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
-
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
-
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
-      </acceptors>
-
-      <!-- Other config -->
-
-      <security-settings>
-         <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
-            <permission type="createDurableQueue" roles="guest"/>
-            <permission type="deleteDurableQueue" roles="guest"/>
-            <permission type="createNonDurableQueue" roles="guest"/>
-            <permission type="deleteNonDurableQueue" roles="guest"/>
-            <permission type="consume" roles="guest"/>
-            <permission type="send" roles="guest"/>
-         </security-setting>
-      </security-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/dead-letter/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/dead-letter/pom.xml b/examples/jms/dead-letter/pom.xml
index c383d9e..94f2c4c 100644
--- a/examples/jms/dead-letter/pom.xml
+++ b/examples/jms/dead-letter/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>
@@ -61,9 +56,18 @@ under the License.
                         <goals>
                            <goal>create</goal>
                         </goals>
+                     </execution>
+                     <execution>
+                        <id>start</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
                         <configuration>
-                           <instance>${basedir}/target/server0</instance>
-                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                           <spawn>true</spawn>
+                           <testURI>tcp://localhost:61616</testURI>
+                           <args>
+                              <param>run</param>
+                           </args>
                         </configuration>
                      </execution>
                      <execution>
@@ -73,8 +77,16 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.DeadLetterExample</clientClass>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>stop</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
                            <args>
-                              <param>${basedir}/target/server0</param>
+                              <param>stop</param>
                            </args>
                         </configuration>
                      </execution>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/dead-letter/src/main/java/org/apache/activemq/artemis/jms/example/DeadLetterExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/dead-letter/src/main/java/org/apache/activemq/artemis/jms/example/DeadLetterExample.java b/examples/jms/dead-letter/src/main/java/org/apache/activemq/artemis/jms/example/DeadLetterExample.java
index 974e5e4..fb976ab 100644
--- a/examples/jms/dead-letter/src/main/java/org/apache/activemq/artemis/jms/example/DeadLetterExample.java
+++ b/examples/jms/dead-letter/src/main/java/org/apache/activemq/artemis/jms/example/DeadLetterExample.java
@@ -25,20 +25,12 @@ import javax.jms.Session;
 import javax.jms.TextMessage;
 import javax.naming.InitialContext;
 
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
-
 /**
  * An example showing how messages are moved to dead letter destination when they are unsuccessfully delivered multiple times
  */
-public class DeadLetterExample extends ActiveMQExample
+public class DeadLetterExample
 {
-   public static void main(final String[] args)
-   {
-      new DeadLetterExample().run(args);
-   }
-
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(final String[] args) throws Exception
    {
       Connection connection = null;
       InitialContext initialContext = null;
@@ -115,8 +107,8 @@ public class DeadLetterExample extends ActiveMQExample
 
          // Step 20. The message sent to the queue was moved to the dead letter queue after 3 unsuccessful deliveries
          System.out.println("Received message from " + deadLetterQueue.getQueueName() +
-                            ": " +
-                            messageReceived.getText());
+                                    ": " +
+                                    messageReceived.getText());
 
          // The message received from the dead letter queue has the same content than the undelivered message but its
          // JMS headers
@@ -132,8 +124,6 @@ public class DeadLetterExample extends ActiveMQExample
 
          // Step 23. This time, we commit the session, the delivery from the dead letter queue is successful!
          session.commit();
-
-         return true;
       }
       finally
       {
@@ -148,5 +138,4 @@ public class DeadLetterExample extends ActiveMQExample
          }
       }
    }
-
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/dead-letter/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/dead-letter/src/main/resources/activemq/server0/broker.xml b/examples/jms/dead-letter/src/main/resources/activemq/server0/broker.xml
index 3180b7e..fdf88cc 100644
--- a/examples/jms/dead-letter/src/main/resources/activemq/server0/broker.xml
+++ b/examples/jms/dead-letter/src/main/resources/activemq/server0/broker.xml
@@ -32,13 +32,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
+      <bindings-directory>${data.dir:../data}/bindings</bindings-directory>
 
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
+      <journal-directory>${data.dir:../data}/journal</journal-directory>
 
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
+      <large-messages-directory>${data.dir:../data}/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
+      <paging-directory>${data.dir:../data}/paging</paging-directory>
 
       <!-- Acceptors -->
       <acceptors>


[16/24] activemq-artemis git commit: ARTEMIS-178 Refactor examples to use CLI

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/queue-message-redistribution/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/queue-message-redistribution/pom.xml b/examples/jms/queue-message-redistribution/pom.xml
index f8448d6..c54657c 100644
--- a/examples/jms/queue-message-redistribution/pom.xml
+++ b/examples/jms/queue-message-redistribution/pom.xml
@@ -57,42 +57,23 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start0</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                              <property>
-                                 <name>udp-address</name>
-                                 <value>${udp-address}</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
                         </configuration>
                      </execution>
                      <execution>
-                        <id>start1</id>
+                        <id>create2</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
-                           <fork>true</fork>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                              <property>
-                                 <name>udp-address</name>
-                                 <value>${udp-address}</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server1</instance>
+                           <configuration>${basedir}/target/classes/activemq/server1</configuration>
                         </configuration>
                      </execution>
                      <execution>
@@ -103,33 +84,9 @@ under the License.
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.QueueMessageRedistributionExample</clientClass>
                            <args>
-                              <param>tcp://localhost:61616</param>
-                              <param>tcp://localhost:61617</param>
+                              <param>${basedir}/target/server0</param>
+                              <param>${basedir}/target/server1</param>
                            </args>
-                           <systemProperties>
-                              <property>
-                                 <name>exampleConfigDir</name>
-                                 <value>${basedir}/target/classes/activemq</value>
-                              </property>
-                           </systemProperties>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop0</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop1</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
                         </configuration>
                      </execution>
                   </executions>
@@ -139,46 +96,7 @@ under the License.
                         <artifactId>artemis-jms-queue-message-redistribution-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <systemProperties>
-                        <property>
-                           <name>data.dir</name>
-                           <value>${basedir}/target/</value>
-                        </property>
-                     </systemProperties>
-                  </configuration>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/queue-message-redistribution/src/main/java/org/apache/activemq/artemis/jms/example/QueueMessageRedistributionExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/queue-message-redistribution/src/main/java/org/apache/activemq/artemis/jms/example/QueueMessageRedistributionExample.java b/examples/jms/queue-message-redistribution/src/main/java/org/apache/activemq/artemis/jms/example/QueueMessageRedistributionExample.java
index fc5ef2c..a1d0a8f 100644
--- a/examples/jms/queue-message-redistribution/src/main/java/org/apache/activemq/artemis/jms/example/QueueMessageRedistributionExample.java
+++ b/examples/jms/queue-message-redistribution/src/main/java/org/apache/activemq/artemis/jms/example/QueueMessageRedistributionExample.java
@@ -16,8 +16,6 @@
  */
 package org.apache.activemq.artemis.jms.example;
 
-import java.util.Hashtable;
-
 import javax.jms.Connection;
 import javax.jms.ConnectionFactory;
 import javax.jms.MessageConsumer;
@@ -26,6 +24,7 @@ import javax.jms.Queue;
 import javax.jms.Session;
 import javax.jms.TextMessage;
 import javax.naming.InitialContext;
+import java.util.Hashtable;
 
 import org.apache.activemq.artemis.common.example.ActiveMQExample;
 
@@ -58,7 +57,7 @@ public class QueueMessageRedistributionExample extends ActiveMQExample
          // 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", args[0]);
+         properties.put("connectionFactory.ConnectionFactory", DEFAULT_TCP1);
          properties.put("queue.queue/exampleQueue", "exampleQueue");
          ic0 = new InitialContext(properties);
 
@@ -71,7 +70,7 @@ public class QueueMessageRedistributionExample extends ActiveMQExample
          // Step 4. Get an initial context for looking up JNDI from server 1
          properties = new Hashtable<String, Object>();
          properties.put("java.naming.factory.initial", "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory");
-         properties.put("connectionFactory.ConnectionFactory", args[1]);
+         properties.put("connectionFactory.ConnectionFactory", DEFAULT_TCP2);
          ic1 = new InitialContext(properties);
 
          // Step 5. Look-up a JMS Connection Factory object from JNDI on server 1

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/queue-message-redistribution/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/queue-message-redistribution/src/main/resources/activemq/server0/artemis-roles.properties b/examples/jms/queue-message-redistribution/src/main/resources/activemq/server0/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/queue-message-redistribution/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/b3af4bb7/examples/jms/queue-message-redistribution/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/queue-message-redistribution/src/main/resources/activemq/server0/artemis-users.properties b/examples/jms/queue-message-redistribution/src/main/resources/activemq/server0/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/queue-message-redistribution/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/b3af4bb7/examples/jms/queue-message-redistribution/src/main/resources/activemq/server1/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/queue-message-redistribution/src/main/resources/activemq/server1/artemis-roles.properties b/examples/jms/queue-message-redistribution/src/main/resources/activemq/server1/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/queue-message-redistribution/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/b3af4bb7/examples/jms/queue-message-redistribution/src/main/resources/activemq/server1/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/queue-message-redistribution/src/main/resources/activemq/server1/artemis-users.properties b/examples/jms/queue-message-redistribution/src/main/resources/activemq/server1/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/queue-message-redistribution/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/b3af4bb7/examples/jms/queue-requestor/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/queue-requestor/pom.xml b/examples/jms/queue-requestor/pom.xml
index 9ab5b2d..893aef7 100644
--- a/examples/jms/queue-requestor/pom.xml
+++ b/examples/jms/queue-requestor/pom.xml
@@ -57,17 +57,13 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
                         </configuration>
                      </execution>
                      <execution>
@@ -77,14 +73,11 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.QueueRequestorExample</clientClass>
+                           <args>
+                              <param>${basedir}/target/server0</param>
+                           </args>
                         </configuration>
                      </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                     </execution>
                   </executions>
                   <dependencies>
                      <dependency>
@@ -92,41 +85,7 @@ under the License.
                         <artifactId>artemis-jms-queue-requestor-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                  </configuration>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/queue-selector/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/queue-selector/pom.xml b/examples/jms/queue-selector/pom.xml
index fb7bd90..8ccd41c 100644
--- a/examples/jms/queue-selector/pom.xml
+++ b/examples/jms/queue-selector/pom.xml
@@ -57,17 +57,13 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
                         </configuration>
                      </execution>
                      <execution>
@@ -77,14 +73,11 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.QueueSelectorExample</clientClass>
+                           <args>
+                              <param>${basedir}/target/server0</param>
+                           </args>
                         </configuration>
                      </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                     </execution>
                   </executions>
                   <dependencies>
                      <dependency>
@@ -92,41 +85,7 @@ under the License.
                         <artifactId>artemis-jms-queue-selector-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                  </configuration>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/queue/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/queue/pom.xml b/examples/jms/queue/pom.xml
index 23a1788..9619a7f 100644
--- a/examples/jms/queue/pom.xml
+++ b/examples/jms/queue/pom.xml
@@ -55,20 +55,15 @@ under the License.
                <plugin>
                   <groupId>org.apache.activemq</groupId>
                   <artifactId>artemis-maven-plugin</artifactId>
-                  <version>${project.version}</version>
                   <executions>
                      <execution>
-                        <id>start</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server0</instance>
+                           <!-- this example only uses default configuration from the create -->
                         </configuration>
                      </execution>
                      <execution>
@@ -78,14 +73,11 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.QueueExample</clientClass>
+                           <args>
+                              <param>${basedir}/target/server0</param>
+                           </args>
                         </configuration>
                      </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                     </execution>
                   </executions>
                   <dependencies>
                      <dependency>
@@ -93,41 +85,7 @@ under the License.
                         <artifactId>artemis-jms-queue-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                  </configuration>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/queue/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/queue/readme.html b/examples/jms/queue/readme.html
index 788f9b7..a80d973 100644
--- a/examples/jms/queue/readme.html
+++ b/examples/jms/queue/readme.html
@@ -30,6 +30,7 @@ under the License.
      <p>This example shows you how to send and receive a message to a JMS Queue using ActiveMQ Artemis.</p>
      <p>Queues are a standard part of JMS, please consult the JMS 1.1 specification for full details.</p>
      <p>A Queue is used to send messages point to point, from a producer to a consumer. The queue guarantees message ordering between these 2 points.</p>
+     <p>Notice this example is using pretty much a default stock configuration</p>
 
      <h2>Example step-by-step</h2>
      <p><i>To run the example, simply type <code>mvn verify -Pexample</code> from this directory</i></p>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/queue/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/queue/src/main/resources/activemq/server0/artemis-roles.properties b/examples/jms/queue/src/main/resources/activemq/server0/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/queue/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/b3af4bb7/examples/jms/queue/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/queue/src/main/resources/activemq/server0/artemis-users.properties b/examples/jms/queue/src/main/resources/activemq/server0/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/queue/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/b3af4bb7/examples/jms/queue/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/queue/src/main/resources/activemq/server0/broker.xml b/examples/jms/queue/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index 7690094..0000000
--- a/examples/jms/queue/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,60 +0,0 @@
-<?xml version='1.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.
--->
-
-<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-               xmlns="urn:activemq"
-               xsi:schemaLocation="urn:activemq /schema/artemis-server.xsd">
-
-   <jms xmlns="urn:activemq:jms">
-      <!--the queue used by the example-->
-      <queue name="exampleQueue"/>
-   </jms>
-
-   <core xmlns="urn:activemq:core">
-
-      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
-
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
-
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
-
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
-      </acceptors>
-
-      <!-- Other config -->
-
-      <security-settings>
-         <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
-            <permission type="createDurableQueue" roles="guest"/>
-            <permission type="deleteDurableQueue" roles="guest"/>
-            <permission type="createNonDurableQueue" roles="guest"/>
-            <permission type="deleteNonDurableQueue" roles="guest"/>
-            <permission type="consume" roles="guest"/>
-            <permission type="send" roles="guest"/>
-         </security-setting>
-      </security-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/reattach-node/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/reattach-node/pom.xml b/examples/jms/reattach-node/pom.xml
index 4cf1c93..76ae5d7 100644
--- a/examples/jms/reattach-node/pom.xml
+++ b/examples/jms/reattach-node/pom.xml
@@ -57,12 +57,13 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start0</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
                         </configuration>
                      </execution>
                      <execution>
@@ -72,21 +73,9 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.ReattachExample</clientClass>
-                           <systemProperties>
-                              <property>
-                                 <name>exampleConfigDir</name>
-                                 <value>${basedir}/target/classes/activemq</value>
-                              </property>
-                           </systemProperties>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop0</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
+                           <args>
+                              <param>${basedir}/target/server0</param>
+                           </args>
                         </configuration>
                      </execution>
                   </executions>
@@ -96,46 +85,7 @@ under the License.
                         <artifactId>artemis-jms-reattach-node-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <systemProperties>
-                        <property>
-                           <name>data.dir</name>
-                           <value>${basedir}/target/</value>
-                        </property>
-                     </systemProperties>
-                  </configuration>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/replicated-failback-static/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/replicated-failback-static/pom.xml b/examples/jms/replicated-failback-static/pom.xml
index 9b0a522..9a9a2f7 100644
--- a/examples/jms/replicated-failback-static/pom.xml
+++ b/examples/jms/replicated-failback-static/pom.xml
@@ -57,42 +57,25 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start0</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                              <property>
-                                 <name>udp-address</name>
-                                 <value>${udp-address}</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                           <javaOptions>-Dudp-address=${udp-address}</javaOptions>
                         </configuration>
                      </execution>
                      <execution>
-                        <id>start1</id>
+                        <id>create2</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
-                           <fork>true</fork>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                              <property>
-                                 <name>udp-address</name>
-                                 <value>${udp-address}</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server1</instance>
+                           <configuration>${basedir}/target/classes/activemq/server1</configuration>
+                           <javaOptions>-Dudp-address=${udp-address}</javaOptions>
                         </configuration>
                      </execution>
                      <execution>
@@ -102,30 +85,10 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.ReplicatedFailbackStaticExample</clientClass>
-                           <systemProperties>
-                              <property>
-                                 <name>exampleConfigDir</name>
-                                 <value>${basedir}/target/classes/activemq</value>
-                              </property>
-                           </systemProperties>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop0</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop1</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
+                           <args>
+                              <param>${basedir}/target/server0</param>
+                              <param>${basedir}/target/server1</param>
+                           </args>
                         </configuration>
                      </execution>
                   </executions>
@@ -135,46 +98,7 @@ under the License.
                         <artifactId>artemis-jms-replicated-failback-static-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <systemProperties>
-                        <property>
-                           <name>data.dir</name>
-                           <value>${basedir}/target/</value>
-                        </property>
-                     </systemProperties>
-                  </configuration>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/replicated-failback/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/replicated-failback/pom.xml b/examples/jms/replicated-failback/pom.xml
index 005ce53..7a27d38 100644
--- a/examples/jms/replicated-failback/pom.xml
+++ b/examples/jms/replicated-failback/pom.xml
@@ -57,42 +57,25 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start0</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                              <property>
-                                 <name>udp-address</name>
-                                 <value>${udp-address}</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                           <javaOptions>-Dudp-address=${udp-address}</javaOptions>
                         </configuration>
                      </execution>
                      <execution>
-                        <id>start1</id>
+                        <id>create2</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
-                           <fork>true</fork>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                              <property>
-                                 <name>udp-address</name>
-                                 <value>${udp-address}</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server1</instance>
+                           <configuration>${basedir}/target/classes/activemq/server1</configuration>
+                           <javaOptions>-Dudp-address=${udp-address}</javaOptions>
                         </configuration>
                      </execution>
                      <execution>
@@ -102,30 +85,10 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.ReplicatedFailbackExample</clientClass>
-                           <systemProperties>
-                              <property>
-                                 <name>exampleConfigDir</name>
-                                 <value>${basedir}/target/classes/activemq</value>
-                              </property>
-                           </systemProperties>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop0</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop1</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
+                           <args>
+                              <param>${basedir}/target/server0</param>
+                              <param>${basedir}/target/server1</param>
+                           </args>
                         </configuration>
                      </execution>
                   </executions>
@@ -135,46 +98,7 @@ under the License.
                         <artifactId>artemis-jms-replicated-failback-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <systemProperties>
-                        <property>
-                           <name>data.dir</name>
-                           <value>${basedir}/target/</value>
-                        </property>
-                     </systemProperties>
-                  </configuration>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/replicated-failback/src/main/java/org/apache/activemq/artemis/jms/example/ReplicatedFailbackExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/replicated-failback/src/main/java/org/apache/activemq/artemis/jms/example/ReplicatedFailbackExample.java b/examples/jms/replicated-failback/src/main/java/org/apache/activemq/artemis/jms/example/ReplicatedFailbackExample.java
index 6bf2b01..02fcbaf 100644
--- a/examples/jms/replicated-failback/src/main/java/org/apache/activemq/artemis/jms/example/ReplicatedFailbackExample.java
+++ b/examples/jms/replicated-failback/src/main/java/org/apache/activemq/artemis/jms/example/ReplicatedFailbackExample.java
@@ -42,6 +42,12 @@ public class ReplicatedFailbackExample extends ActiveMQExample
       new ReplicatedFailbackExample().run(args);
    }
 
+   protected void startServers(String[] serversArgs) throws Exception
+   {
+      startServer(0, 60000);
+      startServer(1, 10000);
+   }
+
    @Override
    public boolean runExample() throws Exception
    {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/replicated-failback/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/replicated-failback/src/main/resources/activemq/server0/broker.xml b/examples/jms/replicated-failback/src/main/resources/activemq/server0/broker.xml
index 8a93350..e762e2c 100644
--- a/examples/jms/replicated-failback/src/main/resources/activemq/server0/broker.xml
+++ b/examples/jms/replicated-failback/src/main/resources/activemq/server0/broker.xml
@@ -29,13 +29,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
+      <bindings-directory>${data.dir}/live/bindings</bindings-directory>
 
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
+      <journal-directory>${data.dir}/live/journal</journal-directory>
 
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
+      <large-messages-directory>${data.dir}/live/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
+      <paging-directory>${data.dir}/live/paging</paging-directory>
 
       <cluster-user>exampleUser</cluster-user>
 
@@ -72,7 +72,7 @@ under the License.
          <discovery-group name="dg-group1">
             <group-address>${udp-address:231.7.7.7}</group-address>
             <group-port>9876</group-port>
-            <refresh-timeout>60000</refresh-timeout>
+            <refresh-timeout>5000</refresh-timeout>
          </discovery-group>
       </discovery-groups>
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/replicated-failback/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/replicated-failback/src/main/resources/activemq/server1/broker.xml b/examples/jms/replicated-failback/src/main/resources/activemq/server1/broker.xml
index eec921f..af242b9 100644
--- a/examples/jms/replicated-failback/src/main/resources/activemq/server1/broker.xml
+++ b/examples/jms/replicated-failback/src/main/resources/activemq/server1/broker.xml
@@ -29,13 +29,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>${data.dir}/server1/data/messaging/bindings</bindings-directory>
+      <bindings-directory>${data.dir}/bkp/bindings</bindings-directory>
 
-      <journal-directory>${data.dir}/server1/data/messaging/journal</journal-directory>
+      <journal-directory>${data.dir}/bkp/journal</journal-directory>
 
-      <large-messages-directory>${data.dir}/server1/data/messaging/largemessages</large-messages-directory>
+      <large-messages-directory>${data.dir}/bkp/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir}/server1/data/messaging/paging</paging-directory>
+      <paging-directory>${data.dir}/bkp/paging</paging-directory>
 
       <cluster-user>exampleUser</cluster-user>
 
@@ -73,7 +73,7 @@ under the License.
          <discovery-group name="dg-group1">
             <group-address>${udp-address:231.7.7.7}</group-address>
             <group-port>9876</group-port>
-            <refresh-timeout>60000</refresh-timeout>
+            <refresh-timeout>5000</refresh-timeout>
          </discovery-group>
       </discovery-groups>
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/replicated-multiple-failover/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/replicated-multiple-failover/pom.xml b/examples/jms/replicated-multiple-failover/pom.xml
index 90ed9e9..60ba4a6 100644
--- a/examples/jms/replicated-multiple-failover/pom.xml
+++ b/examples/jms/replicated-multiple-failover/pom.xml
@@ -57,62 +57,25 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start0</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                              <property>
-                                 <name>udp-address</name>
-                                 <value>${udp-address}</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                           <javaOptions>-Dudp-address=${udp-address}</javaOptions>
                         </configuration>
                      </execution>
                      <execution>
-                        <id>start1</id>
+                        <id>create2</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
-                           <fork>true</fork>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                              <property>
-                                 <name>udp-address</name>
-                                 <value>${udp-address}</value>
-                              </property>
-                           </systemProperties>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>start2</id>
-                        <goals>
-                           <goal>start</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server2</configurationDir>
-                           <fork>true</fork>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                              <property>
-                                 <name>udp-address</name>
-                                 <value>${udp-address}</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server1</instance>
+                           <configuration>${basedir}/target/classes/activemq/server1</configuration>
+                           <javaOptions>-Dudp-address=${udp-address}</javaOptions>
                         </configuration>
                      </execution>
                      <execution>
@@ -122,39 +85,10 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.ReplicatedMultipleFailoverExample</clientClass>
-                           <systemProperties>
-                              <property>
-                                 <name>exampleConfigDir</name>
-                                 <value>${basedir}/target/classes/activemq</value>
-                              </property>
-                           </systemProperties>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop0</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop1</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop2</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server2</configurationDir>
+                           <args>
+                              <param>${basedir}/target/server0</param>
+                              <param>${basedir}/target/server1</param>
+                           </args>
                         </configuration>
                      </execution>
                   </executions>
@@ -164,46 +98,7 @@ under the License.
                         <artifactId>artemis-jms-replicated-multiple-failover-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <systemProperties>
-                        <property>
-                           <name>data.dir</name>
-                           <value>${basedir}/target/</value>
-                        </property>
-                     </systemProperties>
-                  </configuration>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/replicated-transaction-failover/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/replicated-transaction-failover/pom.xml b/examples/jms/replicated-transaction-failover/pom.xml
index f64eec3..b6def66 100644
--- a/examples/jms/replicated-transaction-failover/pom.xml
+++ b/examples/jms/replicated-transaction-failover/pom.xml
@@ -57,42 +57,25 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start0</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                              <property>
-                                 <name>udp-address</name>
-                                 <value>${udp-address}</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                           <javaOptions>-Dudp-address=${udp-address}</javaOptions>
                         </configuration>
                      </execution>
                      <execution>
-                        <id>start1</id>
+                        <id>create2</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                              <property>
-                                 <name>udp-address</name>
-                                 <value>${udp-address}</value>
-                              </property>
-                           </systemProperties>
-                           <fork>true</fork>
+                           <instance>${basedir}/target/server1</instance>
+                           <configuration>${basedir}/target/classes/activemq/server1</configuration>
+                           <javaOptions>-Dudp-address=${udp-address}</javaOptions>
                         </configuration>
                      </execution>
                      <execution>
@@ -102,30 +85,10 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.ReplicatedTransactionFailoverExample</clientClass>
-                           <systemProperties>
-                              <property>
-                                 <name>exampleConfigDir</name>
-                                 <value>${basedir}/target/classes/activemq</value>
-                              </property>
-                           </systemProperties>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop0</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop1</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
+                           <args>
+                              <param>${basedir}/target/server0</param>
+                              <param>${basedir}/target/server1</param>
+                           </args>
                         </configuration>
                      </execution>
                   </executions>
@@ -135,46 +98,7 @@ under the License.
                         <artifactId>artemis-jms-replicated-transaction-failover-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <systemProperties>
-                        <property>
-                           <name>data.dir</name>
-                           <value>${basedir}/target/</value>
-                        </property>
-                     </systemProperties>
-                  </configuration>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/request-reply/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/request-reply/pom.xml b/examples/jms/request-reply/pom.xml
index 9610f67..5880d9d 100644
--- a/examples/jms/request-reply/pom.xml
+++ b/examples/jms/request-reply/pom.xml
@@ -57,17 +57,13 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
                         </configuration>
                      </execution>
                      <execution>
@@ -77,14 +73,11 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.RequestReplyExample</clientClass>
+                           <args>
+                              <param>${basedir}/target/server0</param>
+                           </args>
                         </configuration>
                      </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                     </execution>
                   </executions>
                   <dependencies>
                      <dependency>
@@ -92,41 +85,7 @@ under the License.
                         <artifactId>artemis-jms-request-reply-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                  </configuration>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/scale-down/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/scale-down/pom.xml b/examples/jms/scale-down/pom.xml
index 3d8f617..5a1cd36 100644
--- a/examples/jms/scale-down/pom.xml
+++ b/examples/jms/scale-down/pom.xml
@@ -57,34 +57,25 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start0</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                           <systemProperties>
-                              <property>
-                                 <name>udp-address</name>
-                                 <value>${udp-address}</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                           <javaOptions>-Dudp-address=${udp-address}</javaOptions>
                         </configuration>
                      </execution>
                      <execution>
-                        <id>start1</id>
+                        <id>create2</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
-                           <fork>true</fork>
-                           <systemProperties>
-                              <property>
-                                 <name>udp-address</name>
-                                 <value>${udp-address}</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server1</instance>
+                           <configuration>${basedir}/target/classes/activemq/server1</configuration>
+                           <javaOptions>-Dudp-address=${udp-address}</javaOptions>
                         </configuration>
                      </execution>
                      <execution>
@@ -95,33 +86,9 @@ under the License.
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.ScaleDownExample</clientClass>
                            <args>
-                              <param>tcp://localhost:61616</param>
-                              <param>tcp://localhost:61617</param>
+                              <param>${basedir}/target/server0</param>
+                              <param>${basedir}/target/server1</param>
                            </args>
-                           <systemProperties>
-                              <property>
-                                 <name>exampleConfigDir</name>
-                                 <value>${basedir}/target/classes/activemq</value>
-                              </property>
-                           </systemProperties>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop0</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop1</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
                         </configuration>
                      </execution>
                   </executions>
@@ -131,40 +98,7 @@ under the License.
                         <artifactId>scale-down</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                  </configuration>
                </plugin>
             </plugins>
          </build>


[22/24] activemq-artemis git commit: ARTEMIS-178 Refactor examples to use CLI

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/server/ActiveMQBootstrap.java
----------------------------------------------------------------------
diff --git a/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/server/ActiveMQBootstrap.java b/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/server/ActiveMQBootstrap.java
deleted file mode 100644
index 35f38da..0000000
--- a/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/server/ActiveMQBootstrap.java
+++ /dev/null
@@ -1,270 +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.
- */
-package org.apache.activemq.artemis.server;
-
-import java.io.File;
-import java.lang.management.ManagementFactory;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Timer;
-import java.util.TimerTask;
-
-import org.apache.activemq.artemis.core.config.Configuration;
-import org.apache.activemq.artemis.core.config.FileDeploymentManager;
-import org.apache.activemq.artemis.core.config.HAPolicyConfiguration;
-import org.apache.activemq.artemis.core.config.impl.ConfigurationImpl;
-import org.apache.activemq.artemis.core.config.impl.FileConfiguration;
-import org.apache.activemq.artemis.core.config.impl.FileSecurityConfiguration;
-import org.apache.activemq.artemis.core.config.impl.SecurityConfiguration;
-import org.apache.activemq.artemis.core.server.ActiveMQServer;
-import org.apache.activemq.artemis.core.server.JournalType;
-import org.apache.activemq.artemis.core.server.NodeManager;
-import org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl;
-import org.apache.activemq.artemis.core.server.impl.InVMNodeManager;
-import org.apache.activemq.artemis.jms.server.JMSServerManager;
-import org.apache.activemq.artemis.jms.server.config.JMSConfiguration;
-import org.apache.activemq.artemis.jms.server.config.impl.JMSConfigurationImpl;
-import org.apache.activemq.artemis.jms.server.config.impl.FileJMSConfiguration;
-import org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl;
-import org.apache.activemq.artemis.maven.InVMNodeManagerServer;
-import org.apache.activemq.artemis.spi.core.security.ActiveMQSecurityManager;
-import org.apache.activemq.artemis.spi.core.security.ActiveMQSecurityManagerImpl;
-
-/**
- * This will bootstrap the HornetQ Server and also the naming server if required
- */
-public class ActiveMQBootstrap
-{
-   private final String configurationDir;
-
-   private final Boolean waitOnStart;
-
-   private final String nodeId;
-
-   private static Map<String, NodeManager> managerMap = new HashMap<String, NodeManager>();
-
-   private boolean spawned = false;
-
-   private ActiveMQServer server;
-
-   private Configuration configuration;
-
-   private JMSConfiguration jmsFileConfiguration;
-
-   private SecurityConfiguration securityConfiguration;
-
-   private JMSServerManager manager;
-
-   private ActiveMQSecurityManager securityManager;
-
-
-   public ActiveMQBootstrap(String configurationDir, Boolean waitOnStart, String nodeId, ActiveMQSecurityManager securityManager)
-   {
-      this.configurationDir = configurationDir;
-      this.waitOnStart = waitOnStart;
-      this.nodeId = nodeId;
-      this.securityManager = securityManager;
-   }
-
-   public ActiveMQBootstrap(String[] args)
-   {
-      this.configurationDir = args[0];
-      this.waitOnStart = Boolean.valueOf(args[1]);
-      this.nodeId = args[2];
-      spawned = true;
-   }
-
-   public void execute() throws Exception
-   {
-      try
-      {
-         if (configurationDir != null)
-         {
-            //extendPluginClasspath(configurationDir);
-            configuration = new FileConfiguration();
-            File file = new File(new File(configurationDir), "broker.xml");
-            jmsFileConfiguration = new FileJMSConfiguration();
-            FileDeploymentManager deploymentManager = new FileDeploymentManager(file.toURI().toString());
-            deploymentManager.addDeployable((FileConfiguration)configuration);
-            deploymentManager.addDeployable((FileJMSConfiguration) jmsFileConfiguration);
-
-            securityConfiguration = new FileSecurityConfiguration(new File(configurationDir, "artemis-users.properties").toURI().toString(),
-                                                                  new File(configurationDir, "artemis-roles.properties").toURI().toString(),
-                                                                  "guest",
-                                                                  false,
-                                                                  null);
-            ((FileSecurityConfiguration)securityConfiguration).start();
-            deploymentManager.readConfiguration();
-         }
-         else
-         {
-            configuration = new ConfigurationImpl();
-            configuration.setJournalType(JournalType.NIO);
-            jmsFileConfiguration = new JMSConfigurationImpl();
-            securityConfiguration = new SecurityConfiguration();
-         }
-
-         createServer(configuration, jmsFileConfiguration);
-
-         if (waitOnStart)
-         {
-            String dirName = System.getProperty("activemq.config.dir", ".");
-            final File file = new File(dirName + "/STOP_ME");
-            if (file.exists())
-            {
-               file.delete();
-            }
-
-            while (!file.exists())
-            {
-               Thread.sleep(500);
-            }
-
-            manager.stop();
-            file.delete();
-         }
-         else
-         {
-            String dirName = configurationDir != null ? configurationDir : ".";
-            final File stopFile = new File(dirName + "/STOP_ME");
-            if (stopFile.exists())
-            {
-               stopFile.delete();
-            }
-            final File killFile = new File(dirName + "/KILL_ME");
-            if (killFile.exists())
-            {
-               killFile.delete();
-            }
-            final File restartFile = new File(dirName + "/RESTART_ME");
-            if (restartFile.exists())
-            {
-               restartFile.delete();
-            }
-            final Timer timer = new Timer("ActiveMQ Artemis Server Shutdown Timer", false);
-            timer.scheduleAtFixedRate(new ServerStopTimerTask(stopFile, killFile, restartFile, timer), 500, 500);
-         }
-      }
-      catch (Exception e)
-      {
-         e.printStackTrace();
-         throw new Exception(e.getMessage());
-      }
-   }
-
-   private void createServer(Configuration configuration, JMSConfiguration jmsFileConfiguration) throws Exception
-   {
-      if (nodeId != null && !nodeId.equals("") && !nodeId.equals("null"))
-      {
-         InVMNodeManager nodeManager = (InVMNodeManager) managerMap.get(nodeId);
-         if (nodeManager == null)
-         {
-            boolean replicatedBackup = configuration.getHAPolicyConfiguration().getType() == HAPolicyConfiguration.TYPE.REPLICA;
-            nodeManager = new InVMNodeManager(replicatedBackup, configuration.getJournalLocation());
-            managerMap.put(nodeId, nodeManager);
-         }
-         server = new InVMNodeManagerServer(configuration, ManagementFactory.getPlatformMBeanServer(),
-                                            securityManager != null ? securityManager : new ActiveMQSecurityManagerImpl(securityConfiguration), nodeManager);
-      }
-      else
-      {
-         server = new ActiveMQServerImpl(configuration, ManagementFactory.getPlatformMBeanServer(),
-                                         securityManager != null ? securityManager : new ActiveMQSecurityManagerImpl(securityConfiguration));
-      }
-
-      manager = new JMSServerManagerImpl(server, jmsFileConfiguration);
-      manager.start();
-   }
-
-   private class ServerStopTimerTask extends TimerTask
-   {
-      private final File stopFile;
-      private final Timer timer;
-      private final File killFile;
-      private final File restartFile;
-
-      public ServerStopTimerTask(File stopFile, File killFile, File restartFile, Timer timer)
-      {
-         this.stopFile = stopFile;
-         this.killFile = killFile;
-         this.restartFile = restartFile;
-         this.timer = timer;
-      }
-
-      @Override
-      public void run()
-      {
-         if (stopFile.exists())
-         {
-            try
-            {
-               timer.cancel();
-            }
-            finally
-            {
-               try
-               {
-                  if (manager != null)
-                  {
-                     manager.stop();
-                     manager = null;
-                  }
-                  server = null;
-                  stopFile.delete();
-               }
-               catch (Exception e)
-               {
-                  e.printStackTrace();
-               }
-            }
-            if (spawned)
-            {
-               Runtime.getRuntime()
-                  .halt(666);
-            }
-         }
-         else if (killFile.exists())
-         {
-            try
-            {
-               manager.getActiveMQServer()
-                  .stop(true);
-               manager.stop();
-               manager = null;
-               server = null;
-               killFile.delete();
-            }
-            catch (Exception e)
-            {
-               e.printStackTrace();
-            }
-         }
-         else if (restartFile.exists())
-         {
-            try
-            {
-               createServer(configuration, jmsFileConfiguration);
-               restartFile.delete();
-            }
-            catch (Exception e)
-            {
-               e.printStackTrace();
-            }
-         }
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/server/SpawnedActiveMQBootstrap.java
----------------------------------------------------------------------
diff --git a/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/server/SpawnedActiveMQBootstrap.java b/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/server/SpawnedActiveMQBootstrap.java
deleted file mode 100644
index c7829d8..0000000
--- a/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/server/SpawnedActiveMQBootstrap.java
+++ /dev/null
@@ -1,38 +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.
- */
-package org.apache.activemq.artemis.server;
-
-/**
- *         This class will be spawned in a new vm and will call the bootstrap
- */
-public class SpawnedActiveMQBootstrap
-{
-   public static void main(final String[] args)
-   {
-      ActiveMQBootstrap bootstrap;
-      try
-      {
-         bootstrap = new ActiveMQBootstrap(args);
-         bootstrap.execute();
-         System.out.println("STARTED::");
-      }
-      catch (Throwable e)
-      {
-         System.out.println("FAILED::" + e.getMessage());
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/server/SpawnedVMSupport.java
----------------------------------------------------------------------
diff --git a/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/server/SpawnedVMSupport.java b/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/server/SpawnedVMSupport.java
deleted file mode 100644
index f67fa35..0000000
--- a/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/server/SpawnedVMSupport.java
+++ /dev/null
@@ -1,252 +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.
- */
-package org.apache.activemq.artemis.server;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-
-import org.apache.maven.artifact.Artifact;
-
-public class SpawnedVMSupport
-{
-   public static Process spawnVM(List<Artifact> arts,
-                                 final String logName,
-                                 final String className,
-                                 final Properties properties,
-                                 final boolean logOutput,
-                                 final String success,
-                                 final String failure,
-                                 final String workDir,
-                                 final String configDir,
-                                 boolean debug,
-                                 final String... args) throws Exception
-   {
-      StringBuffer sb = new StringBuffer();
-
-      sb.append("java")
-         .append(' ');
-      StringBuffer props = new StringBuffer();
-      if (properties != null)
-      {
-         for (Map.Entry<Object, Object> entry : properties.entrySet())
-         {
-            props.append("-D")
-               .append(entry.getKey())
-               .append("=")
-               .append(entry.getValue())
-               .append(" ");
-         }
-      }
-      String vmarg = props.toString();
-      String osName = System.getProperty("os.name");
-      osName = (osName != null) ? osName.toLowerCase() : "";
-      boolean isWindows = osName.contains("win");
-      if (isWindows)
-      {
-         vmarg = vmarg.replaceAll("/", "\\\\");
-      }
-      sb.append(vmarg)
-         .append(" ");
-      String pathSeparater = System.getProperty("path.separator");
-      StringBuilder classpath = new StringBuilder();
-      for (Artifact artifact : arts)
-      {
-         classpath.append(artifact.getFile()
-                             .getAbsolutePath())
-            .append(pathSeparater);
-      }
-      classpath.append(configDir)
-         .append(pathSeparater);
-
-      if (isWindows)
-      {
-         sb.append("-cp")
-            .append(" \"")
-            .append(classpath.toString())
-            .append("\" ");
-      }
-      else
-      {
-         sb.append("-cp")
-            .append(" ")
-            .append(classpath.toString())
-            .append(" ");
-      }
-
-      // FIXME - not good to assume path separator
-      String libPath = "-Djava.library.path=" + System.getProperty("java.library.path", "./native/bin");
-      if (isWindows)
-      {
-         libPath = libPath.replaceAll("/", "\\\\");
-         libPath = "\"" + libPath + "\"";
-      }
-      sb.append("-Djava.library.path=")
-         .append(libPath)
-         .append(" ");
-      if (debug)
-      {
-         sb.append("-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005 ");
-      }
-
-      sb.append(className)
-         .append(' ');
-
-      for (String arg : args)
-      {
-         sb.append(arg)
-            .append(' ');
-      }
-
-      String commandLine = sb.toString();
-
-      //SpawnedVMSupport.log.trace("command line: " + commandLine);
-
-      Process process = Runtime.getRuntime()
-         .exec(commandLine, null, new File(workDir));
-
-      //SpawnedVMSupport.log.trace("process: " + process);
-
-      CountDownLatch latch = new CountDownLatch(1);
-
-      ProcessLogger outputLogger = new ProcessLogger(logOutput,
-                                                     process.getInputStream(),
-                                                     logName,
-                                                     false,
-                                                     success,
-                                                     failure,
-                                                     latch);
-      outputLogger.start();
-
-      // Adding a reader to System.err, so the VM won't hang on a System.err.println as identified on this forum thread:
-      // http://www.jboss.org/index.html?module=bb&op=viewtopic&t=151815
-      ProcessLogger errorLogger = new ProcessLogger(true,
-                                                    process.getErrorStream(),
-                                                    logName,
-                                                    true,
-                                                    success,
-                                                    failure,
-                                                    latch);
-      errorLogger.start();
-
-      if (!latch.await(60, TimeUnit.SECONDS))
-      {
-         process.destroy();
-         throw new RuntimeException("Timed out waiting for server to start");
-      }
-
-      if (outputLogger.failed || errorLogger.failed)
-      {
-         try
-         {
-            process.destroy();
-         }
-         catch (Throwable e)
-         {
-         }
-         throw new RuntimeException("server failed to start");
-      }
-      return process;
-   }
-
-   /**
-    * Redirect the input stream to a logger (as debug logs)
-    */
-   static class ProcessLogger extends Thread
-   {
-      private final InputStream is;
-
-      private final String logName;
-
-      private final boolean print;
-
-      private final boolean sendToErr;
-
-      private final String success;
-
-      private final String failure;
-
-      private final CountDownLatch latch;
-
-      boolean failed = false;
-
-      ProcessLogger(final boolean print,
-                    final InputStream is,
-                    final String logName,
-                    final boolean sendToErr,
-                    final String success,
-                    final String failure,
-                    final CountDownLatch latch) throws ClassNotFoundException
-      {
-         this.is = is;
-         this.print = print;
-         this.logName = logName;
-         this.sendToErr = sendToErr;
-         this.success = success;
-         this.failure = failure;
-         this.latch = latch;
-         setDaemon(false);
-      }
-
-      @Override
-      public void run()
-      {
-         try
-         {
-            InputStreamReader isr = new InputStreamReader(is);
-            BufferedReader br = new BufferedReader(isr);
-            String line;
-            while ((line = br.readLine()) != null)
-            {
-               if (line.startsWith(success))
-               {
-                  failed = false;
-                  latch.countDown();
-               }
-               else if (line.startsWith(failure))
-               {
-                  failed = true;
-                  latch.countDown();
-               }
-               if (print)
-               {
-                  if (sendToErr)
-                  {
-                     System.err.println(logName + " err:" + line);
-                  }
-                  else
-                  {
-                     System.out.println(logName + " out:" + line);
-                  }
-               }
-            }
-         }
-         catch (IOException e)
-         {
-            // ok, stream closed
-         }
-
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/aerogear/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/aerogear/pom.xml b/examples/jms/aerogear/pom.xml
index 1e7bfe9..f99707b 100644
--- a/examples/jms/aerogear/pom.xml
+++ b/examples/jms/aerogear/pom.xml
@@ -31,6 +31,7 @@ under the License.
       <endpoint />
       <applicationid />
       <mastersecret />
+      <mavenVersion>2.2.1</mavenVersion>
       <activemq.basedir>${project.basedir}/../../..</activemq.basedir>
    </properties>
 
@@ -40,13 +41,46 @@ 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>
+
+      <!-- maven -->
+      <dependency>
+         <groupId>org.apache.maven</groupId>
+         <artifactId>maven-artifact</artifactId>
+         <version>${mavenVersion}</version>
+      </dependency>
+      <dependency>
+         <groupId>org.apache.maven</groupId>
+         <artifactId>maven-plugin-api</artifactId>
+         <version>${mavenVersion}</version>
+      </dependency>
+      <dependency>
+         <groupId>org.apache.maven</groupId>
+         <artifactId>maven-project</artifactId>
+         <version>${mavenVersion}</version>
+      </dependency>
+      <dependency>
+         <groupId>org.apache.maven</groupId>
+         <artifactId>maven-model</artifactId>
+         <version>${mavenVersion}</version>
+      </dependency>
+      <dependency>
+         <groupId>org.apache.maven</groupId>
+         <artifactId>maven-core</artifactId>
+         <version>${mavenVersion}</version>
+      </dependency>
       <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
+         <groupId>org.apache.maven</groupId>
+         <artifactId>maven-artifact-manager</artifactId>
+         <version>${mavenVersion}</version>
+      </dependency>
+      <dependency>
+         <groupId>org.apache.maven</groupId>
+         <artifactId>maven-repository-metadata</artifactId>
+         <version>${mavenVersion}</version>
       </dependency>
    </dependencies>
 
@@ -60,29 +94,39 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
+                        <id>create</id>
+                        <goals>
+                           <goal>create</goal>
+                           <!-- todo add integration layer -->
+                        </goals>
+                        <configuration>
+                           <!-- this list was extracted from mvn dependency:tree on integration/aerogear -->
+                           <libList>
+                              <param>org.apache.activemq:artemis-aerogear-integration:${project.version}</param>
+                              <param>org.jboss.aerogear:unifiedpush-java-client:1.0.0</param>
+                              <param>net.iharder:base64:2.3.8</param>
+                              <param>com.fasterxml.jackson.core:jackson-annotations:2.3.0</param>
+                              <param>com.fasterxml.jackson.core:jackson-core:2.3.0</param>
+                              <param>org.jboss.resteasy:resteasy-jackson-provider:2.3.2.Final</param>
+                              <param>org.codehaus.jackson:jackson-core-asl:1.8.5</param>
+                              <param>org.codehaus.jackson:jackson-mapper-asl:1.8.5</param>
+                              <param>org.codehaus.jackson:jackson-jaxrs:1.8.5</param>
+                              <param>org.codehaus.jackson:jackson-xc:1.8.5</param>
+                           </libList>
+                        </configuration>
+                     </execution>
+                     <execution>
                         <id>start</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>cli</goal>
                         </goals>
                         <configuration>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                              <property>
-                                 <name>endpoint</name>
-                                 <value>${endpoint}</value>
-                              </property>
-                              <property>
-                                 <name>applicationid</name>
-                                 <value>${applicationid}</value>
-                              </property>
-                              <property>
-                                 <name>mastersecret</name>
-                                 <value>${mastersecret}</value>
-                              </property>
-                           </systemProperties>
+                           <spawn>true</spawn>
+                           <testServer>true</testServer>
+                           <!-- this list was extracted from mvn dependency:tree on integration/aerogear -->
+                           <args>
+                              <param>run</param>
+                           </args>
                         </configuration>
                      </execution>
                      <execution>
@@ -93,15 +137,20 @@ under the License.
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.AerogearExample</clientClass>
                            <args>
-                              <param>tcp://localhost:61616</param>
+                              <param>${basedir}/target/server0</param>
                            </args>
                         </configuration>
                      </execution>
                      <execution>
                         <id>stop</id>
                         <goals>
-                           <goal>stop</goal>
+                           <goal>cli</goal>
                         </goals>
+                        <configuration>
+                           <args>
+                              <param>stop</param>
+                           </args>
+                        </configuration>
                      </execution>
                   </executions>
                   <dependencies>
@@ -110,45 +159,7 @@ under the License.
                         <artifactId>artemis-jms-aerogear-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-aerogear-integration</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                  </configuration>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/aerogear/src/main/java/org/apache/activemq/artemis/jms/example/AerogearExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/aerogear/src/main/java/org/apache/activemq/artemis/jms/example/AerogearExample.java b/examples/jms/aerogear/src/main/java/org/apache/activemq/artemis/jms/example/AerogearExample.java
index c22b0da..346b8a1 100644
--- a/examples/jms/aerogear/src/main/java/org/apache/activemq/artemis/jms/example/AerogearExample.java
+++ b/examples/jms/aerogear/src/main/java/org/apache/activemq/artemis/jms/example/AerogearExample.java
@@ -19,27 +19,17 @@ package org.apache.activemq.artemis.jms.example;
 import javax.jms.Connection;
 import javax.jms.ConnectionFactory;
 import javax.jms.Message;
-import javax.jms.MessageConsumer;
 import javax.jms.MessageProducer;
 import javax.jms.Queue;
 import javax.jms.Session;
-import javax.jms.TextMessage;
 import javax.naming.InitialContext;
 
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
-
 /**
  * A simple JMS Queue example that creates a producer and consumer on a queue and sends then receives a message.
  */
-public class AerogearExample extends ActiveMQExample
+public class AerogearExample
 {
-   public static void main(final String[] args)
-   {
-      new AerogearExample().run(args);
-   }
-
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(final String[] args) throws Exception
    {
       Connection connection = null;
       InitialContext initialContext = null;
@@ -75,8 +65,6 @@ public class AerogearExample extends ActiveMQExample
          System.out.println("now check your mobile app and press enter");
 
          System.in.read();
-
-         return true;
       }
       finally
       {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/aerogear/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/aerogear/src/main/resources/activemq/server0/artemis-roles.properties b/examples/jms/aerogear/src/main/resources/activemq/server0/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/aerogear/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/b3af4bb7/examples/jms/aerogear/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/aerogear/src/main/resources/activemq/server0/artemis-users.properties b/examples/jms/aerogear/src/main/resources/activemq/server0/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/aerogear/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/b3af4bb7/examples/jms/aerogear/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/aerogear/src/main/resources/activemq/server0/broker.xml b/examples/jms/aerogear/src/main/resources/activemq/server0/broker.xml
index 8645df4..90c93e6 100644
--- a/examples/jms/aerogear/src/main/resources/activemq/server0/broker.xml
+++ b/examples/jms/aerogear/src/main/resources/activemq/server0/broker.xml
@@ -29,13 +29,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
+      <bindings-directory>${data.dir:../data}/bindings</bindings-directory>
 
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
+      <journal-directory>${data.dir:../data}/journal</journal-directory>
 
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
+      <large-messages-directory>${data.dir:../data}/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
+      <paging-directory>${data.dir:../data}/paging</paging-directory>
 
       <!-- Acceptors -->
       <acceptors>
@@ -52,7 +52,7 @@ under the License.
 
       <connector-services>
          <connector-service name="aerogear-connector">
-            <factory-class>org.apache.activemq.integration.aerogear.AeroGearConnectorServiceFactory</factory-class>
+            <factory-class>org.apache.activemq.artemis.integration.aerogear.AeroGearConnectorServiceFactory</factory-class>
             <param key="endpoint" value="${endpoint}"/>
             <param key="queue" value="jms.queue.exampleQueue"/>
             <param key="application-id" value="${applicationid}"/>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/application-layer-failover/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/application-layer-failover/pom.xml b/examples/jms/application-layer-failover/pom.xml
index 797cbe6..9f4abb5 100644
--- a/examples/jms/application-layer-failover/pom.xml
+++ b/examples/jms/application-layer-failover/pom.xml
@@ -57,23 +57,22 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start0</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
+                           <instance>${basedir}/target/server0</instance>
                         </configuration>
                      </execution>
                      <execution>
-                        <id>start1</id>
+                        <id>create2</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
-                           <serverStartString>INFO: AMQ221001</serverStartString>
-                           <fork>true</fork>
+                           <instance>${basedir}/target/server1</instance>
+                           <portOffset>1</portOffset>
                         </configuration>
                      </execution>
                      <execution>
@@ -84,33 +83,9 @@ under the License.
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.ApplicationLayerFailoverExample</clientClass>
                            <args>
-                              <param>tcp://localhost:61616</param>
-                              <param>tcp://localhost:61617</param>
+                              <param>${basedir}/target/server0</param>
+                              <param>${basedir}/target/server1</param>
                            </args>
-                           <systemProperties>
-                              <property>
-                                 <name>exampleConfigDir</name>
-                                 <value>${basedir}/target/classes/activemq</value>
-                              </property>
-                           </systemProperties>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop0</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop1</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
                         </configuration>
                      </execution>
                   </executions>
@@ -120,41 +95,7 @@ under the License.
                         <artifactId>artemis-jms-application-layer-failover-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                  </configuration>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/application-layer-failover/src/main/java/org/apache/activemq/artemis/jms/example/ApplicationLayerFailoverExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/application-layer-failover/src/main/java/org/apache/activemq/artemis/jms/example/ApplicationLayerFailoverExample.java b/examples/jms/application-layer-failover/src/main/java/org/apache/activemq/artemis/jms/example/ApplicationLayerFailoverExample.java
index 46900f2..ca916ee 100644
--- a/examples/jms/application-layer-failover/src/main/java/org/apache/activemq/artemis/jms/example/ApplicationLayerFailoverExample.java
+++ b/examples/jms/application-layer-failover/src/main/java/org/apache/activemq/artemis/jms/example/ApplicationLayerFailoverExample.java
@@ -99,7 +99,11 @@ public class ApplicationLayerFailoverExample extends ActiveMQExample
 
          System.out.println("Killing the server");
 
-         killServer(0, 1);
+         killServer(0);
+
+         // this utility method will wait for the server1 to be activated
+         waitForServerStart(1, 20000);
+
 
          // Step 6. Wait for the client side to register the failure and reconnect
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/application-layer-failover/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/application-layer-failover/src/main/resources/activemq/server0/artemis-roles.properties b/examples/jms/application-layer-failover/src/main/resources/activemq/server0/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/application-layer-failover/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/b3af4bb7/examples/jms/application-layer-failover/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/application-layer-failover/src/main/resources/activemq/server0/artemis-users.properties b/examples/jms/application-layer-failover/src/main/resources/activemq/server0/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/application-layer-failover/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/b3af4bb7/examples/jms/application-layer-failover/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/application-layer-failover/src/main/resources/activemq/server0/broker.xml b/examples/jms/application-layer-failover/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index 74270c7..0000000
--- a/examples/jms/application-layer-failover/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,53 +0,0 @@
-<?xml version='1.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.
--->
-
-<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-               xmlns="urn:activemq"
-               xsi:schemaLocation="urn:activemq /schema/artemis-server.xsd">
-
-   <jms xmlns="urn:activemq:jms">
-   </jms>
-
-   <core xmlns="urn:activemq:core">
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
-      </acceptors>
-
-      <!-- Other config -->
-
-      <security-settings>
-         <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
-            <permission type="createDurableQueue" roles="guest"/>
-            <permission type="deleteDurableQueue" roles="guest"/>
-            <permission type="createNonDurableQueue" roles="guest"/>
-            <permission type="deleteNonDurableQueue" roles="guest"/>
-            <permission type="consume" roles="guest"/>
-            <permission type="send" roles="guest"/>
-         </security-setting>
-      </security-settings>
-
-      <journal-directory>target/data/journal</journal-directory>
-      <bindings-directory>target/data/bindings</bindings-directory>
-      <large-messages-directory>target/data/large-messages</large-messages-directory>
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/application-layer-failover/src/main/resources/activemq/server1/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/application-layer-failover/src/main/resources/activemq/server1/artemis-roles.properties b/examples/jms/application-layer-failover/src/main/resources/activemq/server1/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/application-layer-failover/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/b3af4bb7/examples/jms/application-layer-failover/src/main/resources/activemq/server1/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/application-layer-failover/src/main/resources/activemq/server1/artemis-users.properties b/examples/jms/application-layer-failover/src/main/resources/activemq/server1/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/application-layer-failover/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/b3af4bb7/examples/jms/application-layer-failover/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/application-layer-failover/src/main/resources/activemq/server1/broker.xml b/examples/jms/application-layer-failover/src/main/resources/activemq/server1/broker.xml
deleted file mode 100644
index bc5ad71..0000000
--- a/examples/jms/application-layer-failover/src/main/resources/activemq/server1/broker.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-
-<!--
-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.
--->
-
-<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-               xmlns="urn:activemq"
-               xsi:schemaLocation="urn:activemq /schema/artemis-server.xsd">
-
-   <jms xmlns="urn:activemq:jms">
-      <!--the queue used by the example-->
-      <queue name="exampleQueue"/>
-   </jms>
-
-   <core xmlns="urn:activemq:core">
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61617</acceptor>
-      </acceptors>
-
-      <!-- Other config -->
-
-      <security-settings>
-         <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
-            <permission type="createDurableQueue" roles="guest"/>
-            <permission type="deleteDurableQueue" roles="guest"/>
-            <permission type="createNonDurableQueue" roles="guest"/>
-            <permission type="deleteNonDurableQueue" roles="guest"/>
-            <permission type="consume" roles="guest"/>
-            <permission type="send" roles="guest"/>
-         </security-setting>
-      </security-settings>
-
-      <journal-directory>target/data/journal</journal-directory>
-      <bindings-directory>target/data/bindings</bindings-directory>
-      <large-messages-directory>target/data/large-messages</large-messages-directory>
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/bridge/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/bridge/pom.xml b/examples/jms/bridge/pom.xml
index db872de..f1dd547 100644
--- a/examples/jms/bridge/pom.xml
+++ b/examples/jms/bridge/pom.xml
@@ -62,59 +62,37 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start0</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
                         </configuration>
                      </execution>
                      <execution>
-                        <id>start1</id>
+                        <id>create2</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
-                           <fork>true</fork>
+                           <instance>${basedir}/target/server1</instance>
+                           <configuration>${basedir}/target/classes/activemq/server1</configuration>
+                           <portOffset>1</portOffset>
                         </configuration>
                      </execution>
                      <execution>
                         <id>runClient</id>
                         <goals>
-                           <goal>runClient</goal>
+                           <goal>client</goal>
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.BridgeExample</clientClass>
                            <args>
-                              <param>tcp://localhost:61616</param>
-                              <param>tcp://localhost:61617</param>
+                              <param>${basedir}/target/server0</param>
+                              <param>${basedir}/target/server1</param>
                            </args>
-                           <systemProperties>
-                              <property>
-                                 <name>exampleConfigDir</name>
-                                 <value>${basedir}/target/classes/activemq</value>
-                              </property>
-                           </systemProperties>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop0</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop1</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
                         </configuration>
                      </execution>
                   </executions>
@@ -131,20 +109,10 @@ under the License.
                      </dependency>
                      <dependency>
                         <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
                         <artifactId>artemis-jms-client</artifactId>
                         <version>${project.version}</version>
                      </dependency>
                      <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
                         <groupId>io.netty</groupId>
                         <artifactId>netty-all</artifactId>
                         <version>${netty.version}</version>
@@ -155,15 +123,6 @@ under the License.
                         <version>${geronimo.jms.2.spec.version}</version>
                      </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <systemProperties>
-                        <property>
-                           <name>data.dir</name>
-                           <value>${basedir}/target/</value>
-                        </property>
-                     </systemProperties>
-                  </configuration>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/bridge/src/main/java/org/apache/activemq/artemis/jms/example/BridgeExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/bridge/src/main/java/org/apache/activemq/artemis/jms/example/BridgeExample.java b/examples/jms/bridge/src/main/java/org/apache/activemq/artemis/jms/example/BridgeExample.java
index 520c529..4346c32 100644
--- a/examples/jms/bridge/src/main/java/org/apache/activemq/artemis/jms/example/BridgeExample.java
+++ b/examples/jms/bridge/src/main/java/org/apache/activemq/artemis/jms/example/BridgeExample.java
@@ -16,8 +16,6 @@
  */
 package org.apache.activemq.artemis.jms.example;
 
-import java.util.Hashtable;
-
 import javax.jms.Connection;
 import javax.jms.ConnectionFactory;
 import javax.jms.Message;
@@ -26,6 +24,7 @@ import javax.jms.MessageProducer;
 import javax.jms.Queue;
 import javax.jms.Session;
 import javax.naming.InitialContext;
+import java.util.Hashtable;
 
 import org.apache.activemq.artemis.common.example.ActiveMQExample;
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/bridge/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/bridge/src/main/resources/activemq/server0/artemis-roles.properties b/examples/jms/bridge/src/main/resources/activemq/server0/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/bridge/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/b3af4bb7/examples/jms/bridge/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/bridge/src/main/resources/activemq/server0/artemis-users.properties b/examples/jms/bridge/src/main/resources/activemq/server0/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/bridge/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/b3af4bb7/examples/jms/bridge/src/main/resources/activemq/server1/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/bridge/src/main/resources/activemq/server1/artemis-roles.properties b/examples/jms/bridge/src/main/resources/activemq/server1/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/bridge/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/b3af4bb7/examples/jms/bridge/src/main/resources/activemq/server1/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/bridge/src/main/resources/activemq/server1/artemis-users.properties b/examples/jms/bridge/src/main/resources/activemq/server1/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/bridge/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/b3af4bb7/examples/jms/browser/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/browser/pom.xml b/examples/jms/browser/pom.xml
index 6f86c76..530f66b 100644
--- a/examples/jms/browser/pom.xml
+++ b/examples/jms/browser/pom.xml
@@ -57,9 +57,10 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start</id>
+                        <id>create</id>
+                        <phase>verify</phase>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                      </execution>
                      <execution>
@@ -70,16 +71,10 @@ under the License.
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.QueueBrowserExample</clientClass>
                            <args>
-                              <param>tcp://localhost:61616</param>
+                              <param>${basedir}/target/server0</param>
                            </args>
                         </configuration>
                      </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                     </execution>
                   </executions>
                   <dependencies>
                      <dependency>
@@ -87,47 +82,7 @@ under the License.
                         <artifactId>artemis-jms-browser-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                     <systemProperties>
-                        <property>
-                           <name>data.dir</name>
-                           <value>${basedir}/target/</value>
-                        </property>
-                     </systemProperties>
-                  </configuration>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/browser/src/main/java/org/apache/activemq/artemis/jms/example/QueueBrowserExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/browser/src/main/java/org/apache/activemq/artemis/jms/example/QueueBrowserExample.java b/examples/jms/browser/src/main/java/org/apache/activemq/artemis/jms/example/QueueBrowserExample.java
index d57f34a..8e8e422 100644
--- a/examples/jms/browser/src/main/java/org/apache/activemq/artemis/jms/example/QueueBrowserExample.java
+++ b/examples/jms/browser/src/main/java/org/apache/activemq/artemis/jms/example/QueueBrowserExample.java
@@ -16,8 +16,6 @@
  */
 package org.apache.activemq.artemis.jms.example;
 
-import java.util.Enumeration;
-
 import javax.jms.Connection;
 import javax.jms.ConnectionFactory;
 import javax.jms.MessageConsumer;
@@ -27,6 +25,7 @@ import javax.jms.QueueBrowser;
 import javax.jms.Session;
 import javax.jms.TextMessage;
 import javax.naming.InitialContext;
+import java.util.Enumeration;
 
 import org.apache.activemq.artemis.common.example.ActiveMQExample;
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/browser/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/browser/src/main/resources/activemq/server0/artemis-roles.properties b/examples/jms/browser/src/main/resources/activemq/server0/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/browser/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/b3af4bb7/examples/jms/browser/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/browser/src/main/resources/activemq/server0/artemis-users.properties b/examples/jms/browser/src/main/resources/activemq/server0/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/browser/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/b3af4bb7/examples/jms/browser/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/browser/src/main/resources/activemq/server0/broker.xml b/examples/jms/browser/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index 5003991..0000000
--- a/examples/jms/browser/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,61 +0,0 @@
-<?xml version='1.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.
--->
-
-<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-               xmlns="urn:activemq"
-               xsi:schemaLocation="urn:activemq /schema/artemis-server.xsd">
-
-   <jms xmlns="urn:activemq:jms">
-      <!--the queue used by the example-->
-      <queue name="exampleQueue"/>
-   </jms>
-
-   <core xmlns="urn:activemq:core">
-
-      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
-
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
-
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
-
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
-      </acceptors>
-
-      <!-- Other config -->
-
-      <security-settings>
-         <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
-            <permission type="createDurableQueue" roles="guest"/>
-            <permission type="deleteDurableQueue" roles="guest"/>
-            <permission type="createNonDurableQueue" roles="guest"/>
-            <permission type="deleteNonDurableQueue" roles="guest"/>
-            <permission type="consume" roles="guest"/>
-            <permission type="send" roles="guest"/>
-         </security-setting>
-      </security-settings>
-
-   </core>
-
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/client-kickoff/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/client-kickoff/pom.xml b/examples/jms/client-kickoff/pom.xml
index c141afb..22d511c 100644
--- a/examples/jms/client-kickoff/pom.xml
+++ b/examples/jms/client-kickoff/pom.xml
@@ -62,35 +62,13 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <!--we need to fork the server as we have system props that need set pre runtime-->
-                           <fork>true</fork>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                              <property>
-                                 <name>com.sun.management.jmxremote</name>
-                                 <value />
-                              </property>
-                              <property>
-                                 <name>com.sun.management.jmxremote.port</name>
-                                 <value>3000</value>
-                              </property>
-                              <property>
-                                 <name>com.sun.management.jmxremote.ssl</name>
-                                 <value>false</value>
-                              </property>
-                              <property>
-                                 <name>com.sun.management.jmxremote.authenticate</name>
-                                 <value>false</value>
-                              </property>
-                           </systemProperties>
+                           <!-- options used for JMX on the example -->
+                           <javaOptions>-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=3000 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false</javaOptions>
                         </configuration>
                      </execution>
                      <execution>
@@ -101,16 +79,10 @@ under the License.
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.ClientKickoffExample</clientClass>
                            <args>
-                              <param>tcp://localhost:61616</param>
+                              <param>${basedir}/target/server0</param>
                            </args>
                         </configuration>
                      </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                     </execution>
                   </executions>
                   <dependencies>
                      <dependency>
@@ -118,41 +90,7 @@ under the License.
                         <artifactId>artemis-jms-client-kickoff-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                  </configuration>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/client-kickoff/src/main/java/org/apache/activemq/artemis/jms/example/ClientKickoffExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/client-kickoff/src/main/java/org/apache/activemq/artemis/jms/example/ClientKickoffExample.java b/examples/jms/client-kickoff/src/main/java/org/apache/activemq/artemis/jms/example/ClientKickoffExample.java
index 597ea5f..eb5db60 100644
--- a/examples/jms/client-kickoff/src/main/java/org/apache/activemq/artemis/jms/example/ClientKickoffExample.java
+++ b/examples/jms/client-kickoff/src/main/java/org/apache/activemq/artemis/jms/example/ClientKickoffExample.java
@@ -16,9 +16,6 @@
  */
 package org.apache.activemq.artemis.jms.example;
 
-import java.util.HashMap;
-import java.util.concurrent.atomic.AtomicReference;
-
 import javax.jms.ExceptionListener;
 import javax.jms.JMSException;
 import javax.jms.QueueConnection;
@@ -30,6 +27,8 @@ import javax.management.remote.JMXConnector;
 import javax.management.remote.JMXConnectorFactory;
 import javax.management.remote.JMXServiceURL;
 import javax.naming.InitialContext;
+import java.util.HashMap;
+import java.util.concurrent.atomic.AtomicReference;
 
 import org.apache.activemq.artemis.api.core.management.ActiveMQServerControl;
 import org.apache.activemq.artemis.api.core.management.ObjectNameBuilder;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/client-kickoff/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/client-kickoff/src/main/resources/activemq/server0/artemis-roles.properties b/examples/jms/client-kickoff/src/main/resources/activemq/server0/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/client-kickoff/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


[21/24] activemq-artemis git commit: ARTEMIS-178 Refactor examples to use CLI

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/client-kickoff/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/client-kickoff/src/main/resources/activemq/server0/artemis-users.properties b/examples/jms/client-kickoff/src/main/resources/activemq/server0/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/client-kickoff/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/b3af4bb7/examples/jms/client-side-failoverlistener/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/client-side-failoverlistener/pom.xml b/examples/jms/client-side-failoverlistener/pom.xml
index 1c7bf64..87c41f3 100644
--- a/examples/jms/client-side-failoverlistener/pom.xml
+++ b/examples/jms/client-side-failoverlistener/pom.xml
@@ -57,42 +57,28 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start0</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                              <property>
-                                 <name>udp-address</name>
-                                 <value>${udp-address}</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server0</instance>
+                           <data>../../shared/</data>
+                           <sharedStore>true</sharedStore>
+                           <slave>false</slave>
                         </configuration>
                      </execution>
                      <execution>
-                        <id>start1</id>
+                        <id>create2</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
-                           <fork>true</fork>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                              <property>
-                                 <name>udp-address</name>
-                                 <value>${udp-address}</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server1</instance>
+                           <data>../../shared/</data>
+                           <sharedStore>true</sharedStore>
+                           <slave>true</slave>
+                           <portOffset>1</portOffset>
                         </configuration>
                      </execution>
 
@@ -103,30 +89,10 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.ClientSideFailoverListerExample</clientClass>
-                           <systemProperties>
-                              <property>
-                                 <name>exampleConfigDir</name>
-                                 <value>${basedir}/target/classes/activemq</value>
-                              </property>
-                           </systemProperties>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop0</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop1</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
+                           <args>
+                              <param>${basedir}/target/server0</param>
+                              <param>${basedir}/target/server1</param>
+                           </args>
                         </configuration>
                      </execution>
                   </executions>
@@ -136,46 +102,7 @@ under the License.
                         <artifactId>artemis-jms-client-side-fileoverlistener-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <systemProperties>
-                        <property>
-                           <name>data.dir</name>
-                           <value>${basedir}/target/</value>
-                        </property>
-                     </systemProperties>
-                  </configuration>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/client-side-failoverlistener/src/main/java/org/apache/activemq/artemis/jms/example/ClientSideFailoverListerExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/client-side-failoverlistener/src/main/java/org/apache/activemq/artemis/jms/example/ClientSideFailoverListerExample.java b/examples/jms/client-side-failoverlistener/src/main/java/org/apache/activemq/artemis/jms/example/ClientSideFailoverListerExample.java
index 20c8808..c753000 100644
--- a/examples/jms/client-side-failoverlistener/src/main/java/org/apache/activemq/artemis/jms/example/ClientSideFailoverListerExample.java
+++ b/examples/jms/client-side-failoverlistener/src/main/java/org/apache/activemq/artemis/jms/example/ClientSideFailoverListerExample.java
@@ -38,12 +38,24 @@ import org.apache.activemq.artemis.jms.client.ActiveMQConnection;
  */
 public class ClientSideFailoverListerExample extends ActiveMQExample
 {
-   public static void main(final String[] args)
+   public static void main(final String[] args) throws Exception
    {
       new ClientSideFailoverListerExample().run(args);
    }
 
    @Override
+   protected void startServers(String[] serversArgs) throws Exception
+   {
+      startServer(0, 5000);
+
+      // server 1 is a backup, it's not activated
+      startServer(1, 0);
+
+      Thread.sleep(1000);
+   }
+
+
+   @Override
    public boolean runExample() throws Exception
    {
       InitialContext initialContext = null;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/client-side-failoverlistener/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/client-side-failoverlistener/src/main/resources/activemq/server0/artemis-roles.properties b/examples/jms/client-side-failoverlistener/src/main/resources/activemq/server0/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/client-side-failoverlistener/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/b3af4bb7/examples/jms/client-side-failoverlistener/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/client-side-failoverlistener/src/main/resources/activemq/server0/artemis-users.properties b/examples/jms/client-side-failoverlistener/src/main/resources/activemq/server0/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/client-side-failoverlistener/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/b3af4bb7/examples/jms/client-side-failoverlistener/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/client-side-failoverlistener/src/main/resources/activemq/server0/broker.xml b/examples/jms/client-side-failoverlistener/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index 18550ef..0000000
--- a/examples/jms/client-side-failoverlistener/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,92 +0,0 @@
-<?xml version='1.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.
--->
-
-<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-               xmlns="urn:activemq"
-               xsi:schemaLocation="urn:activemq /schema/artemis-server.xsd">
-   <jms xmlns="urn:activemq:jms">
-      <!--the queue used by the example-->
-      <queue name="exampleQueue"/>
-   </jms>
-
-   <core xmlns="urn:activemq:core">
-
-      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
-
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
-
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
-
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
-
-      <ha-policy>
-         <shared-store>
-            <master/>
-         </shared-store>
-      </ha-policy>
-
-      <!-- Connectors -->
-      <connectors>
-         <connector name="netty-connector">tcp://localhost:61616</connector>
-      </connectors>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
-      </acceptors>
-
-      <broadcast-groups>
-         <broadcast-group name="bg-group1">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <broadcast-period>1000</broadcast-period>
-            <connector-ref>netty-connector</connector-ref>
-         </broadcast-group>
-      </broadcast-groups>
-
-      <discovery-groups>
-         <discovery-group name="dg-group1">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <refresh-timeout>60000</refresh-timeout>
-         </discovery-group>
-      </discovery-groups>
-
-      <cluster-connections>
-         <cluster-connection name="my-cluster">
-            <address>jms</address>
-            <connector-ref>netty-connector</connector-ref>
-            <discovery-group-ref discovery-group-name="dg-group1"/>
-         </cluster-connection>
-      </cluster-connections>
-
-      <security-settings>
-         <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
-            <permission type="createDurableQueue" roles="guest"/>
-            <permission type="deleteDurableQueue" roles="guest"/>
-            <permission type="createNonDurableQueue" roles="guest"/>
-            <permission type="deleteNonDurableQueue" roles="guest"/>
-            <permission type="consume" roles="guest"/>
-            <permission type="send" roles="guest"/>
-         </security-setting>
-      </security-settings>
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/client-side-failoverlistener/src/main/resources/activemq/server1/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/client-side-failoverlistener/src/main/resources/activemq/server1/artemis-roles.properties b/examples/jms/client-side-failoverlistener/src/main/resources/activemq/server1/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/client-side-failoverlistener/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/b3af4bb7/examples/jms/client-side-failoverlistener/src/main/resources/activemq/server1/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/client-side-failoverlistener/src/main/resources/activemq/server1/artemis-users.properties b/examples/jms/client-side-failoverlistener/src/main/resources/activemq/server1/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/client-side-failoverlistener/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/b3af4bb7/examples/jms/client-side-failoverlistener/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/client-side-failoverlistener/src/main/resources/activemq/server1/broker.xml b/examples/jms/client-side-failoverlistener/src/main/resources/activemq/server1/broker.xml
deleted file mode 100644
index eb70455..0000000
--- a/examples/jms/client-side-failoverlistener/src/main/resources/activemq/server1/broker.xml
+++ /dev/null
@@ -1,93 +0,0 @@
-<?xml version='1.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.
--->
-
-<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-               xmlns="urn:activemq"
-               xsi:schemaLocation="urn:activemq /schema/artemis-server.xsd">
-
-   <jms xmlns="urn:activemq:jms">
-      <!--the queue used by the example-->
-      <queue name="exampleQueue"/>
-   </jms>
-
-   <core xmlns="urn:activemq:core">
-
-      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
-
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
-
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
-
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
-
-      <ha-policy>
-         <shared-store>
-            <slave/>
-         </shared-store>
-      </ha-policy>
-
-      <!-- Connectors -->
-      <connectors>
-         <connector name="netty-connector">tcp://localhost:61617</connector>
-      </connectors>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61617</acceptor>
-      </acceptors>
-
-      <broadcast-groups>
-         <broadcast-group name="bg-group1">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <broadcast-period>1000</broadcast-period>
-            <connector-ref>netty-connector</connector-ref>
-         </broadcast-group>
-      </broadcast-groups>
-
-      <discovery-groups>
-         <discovery-group name="dg-group1">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <refresh-timeout>60000</refresh-timeout>
-         </discovery-group>
-      </discovery-groups>
-
-      <cluster-connections>
-         <cluster-connection name="my-cluster">
-            <address>jms</address>
-            <connector-ref>netty-connector</connector-ref>
-            <discovery-group-ref discovery-group-name="dg-group1"/>
-         </cluster-connection>
-      </cluster-connections>
-
-      <security-settings>
-         <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
-            <permission type="createDurableQueue" roles="guest"/>
-            <permission type="deleteDurableQueue" roles="guest"/>
-            <permission type="createNonDurableQueue" roles="guest"/>
-            <permission type="deleteNonDurableQueue" roles="guest"/>
-            <permission type="consume" roles="guest"/>
-            <permission type="send" roles="guest"/>
-         </security-setting>
-      </security-settings>
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/client-side-load-balancing/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/client-side-load-balancing/pom.xml b/examples/jms/client-side-load-balancing/pom.xml
index 0f13c8c..fc4ec4c 100644
--- a/examples/jms/client-side-load-balancing/pom.xml
+++ b/examples/jms/client-side-load-balancing/pom.xml
@@ -57,56 +57,41 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start0</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server0</instance>
+                           <clustered>true</clustered>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
                         </configuration>
                      </execution>
                      <execution>
-                        <id>start1</id>
+                        <id>create2</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
-                           <fork>true</fork>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                              <property>
-                                 <name>udp-address</name>
-                                 <value>${udp-address}</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server1</instance>
+                           <clustered>true</clustered>
+                           <configuration>${basedir}/target/classes/activemq/server1</configuration>
+                           <portOffset>1</portOffset>
                         </configuration>
                      </execution>
                      <execution>
-                        <id>start2</id>
+                        <id>create3</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server2</configurationDir>
-                           <fork>true</fork>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server2</instance>
+                           <clustered>true</clustered>
+                           <configuration>${basedir}/target/classes/activemq/server2</configuration>
+                           <portOffset>2</portOffset>
                         </configuration>
                      </execution>
+
                      <execution>
                         <id>runClient</id>
                         <goals>
@@ -114,39 +99,11 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.ClientSideLoadBalancingExample</clientClass>
-                           <systemProperties>
-                              <property>
-                                 <name>exampleConfigDir</name>
-                                 <value>${basedir}/target/classes/activemq</value>
-                              </property>
-                           </systemProperties>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop0</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop1</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop2</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server2</configurationDir>
+                           <args>
+                              <param>${basedir}/target/server0</param>
+                              <param>${basedir}/target/server1</param>
+                              <param>${basedir}/target/server2</param>
+                           </args>
                         </configuration>
                      </execution>
                   </executions>
@@ -156,46 +113,7 @@ under the License.
                         <artifactId>artemis-jms-client-side-load-balancing-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <systemProperties>
-                        <property>
-                           <name>data.dir</name>
-                           <value>${basedir}/target/</value>
-                        </property>
-                     </systemProperties>
-                  </configuration>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/client-side-load-balancing/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/client-side-load-balancing/src/main/resources/activemq/server0/artemis-roles.properties b/examples/jms/client-side-load-balancing/src/main/resources/activemq/server0/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/client-side-load-balancing/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/b3af4bb7/examples/jms/client-side-load-balancing/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/client-side-load-balancing/src/main/resources/activemq/server0/artemis-users.properties b/examples/jms/client-side-load-balancing/src/main/resources/activemq/server0/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/client-side-load-balancing/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/b3af4bb7/examples/jms/client-side-load-balancing/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/client-side-load-balancing/src/main/resources/activemq/server0/broker.xml b/examples/jms/client-side-load-balancing/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index 7d54128..0000000
--- a/examples/jms/client-side-load-balancing/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,92 +0,0 @@
-<?xml version='1.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.
--->
-
-<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-               xmlns="urn:activemq"
-               xsi:schemaLocation="urn:activemq /schema/artemis-server.xsd">
-   <jms xmlns="urn:activemq:jms">
-      <!--the queue used by the example-->
-      <queue name="exampleQueue"/>
-   </jms>
-
-   <core xmlns="urn:activemq:core">
-      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
-
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
-
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
-
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
-
-      <!-- Connectors -->
-
-      <connectors>
-         <connector name="netty-connector">tcp://localhost:61616</connector>
-      </connectors>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
-      </acceptors>
-
-      <!-- Clustering configuration -->
-
-      <broadcast-groups>
-         <broadcast-group name="my-broadcast-group">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <broadcast-period>100</broadcast-period>
-            <connector-ref>netty-connector</connector-ref>
-         </broadcast-group>
-      </broadcast-groups>
-
-      <discovery-groups>
-         <discovery-group name="my-discovery-group">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <refresh-timeout>10000</refresh-timeout>
-         </discovery-group>
-      </discovery-groups>
-
-      <cluster-connections>
-         <cluster-connection name="my-cluster">
-            <address>jms</address>
-            <connector-ref>netty-connector</connector-ref>
-            <max-hops>0</max-hops>
-            <discovery-group-ref discovery-group-name="my-discovery-group"/>
-         </cluster-connection>
-      </cluster-connections>
-
-      <!-- Other config -->
-
-      <security-settings>
-         <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
-            <permission type="createDurableQueue" roles="guest"/>
-            <permission type="deleteDurableQueue" roles="guest"/>
-            <permission type="createNonDurableQueue" roles="guest"/>
-            <permission type="deleteNonDurableQueue" roles="guest"/>
-            <permission type="consume" roles="guest"/>
-            <permission type="send" roles="guest"/>
-         </security-setting>
-      </security-settings>
-   </core>
-
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/client-side-load-balancing/src/main/resources/activemq/server1/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/client-side-load-balancing/src/main/resources/activemq/server1/artemis-roles.properties b/examples/jms/client-side-load-balancing/src/main/resources/activemq/server1/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/client-side-load-balancing/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/b3af4bb7/examples/jms/client-side-load-balancing/src/main/resources/activemq/server1/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/client-side-load-balancing/src/main/resources/activemq/server1/artemis-users.properties b/examples/jms/client-side-load-balancing/src/main/resources/activemq/server1/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/client-side-load-balancing/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/b3af4bb7/examples/jms/client-side-load-balancing/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/client-side-load-balancing/src/main/resources/activemq/server1/broker.xml b/examples/jms/client-side-load-balancing/src/main/resources/activemq/server1/broker.xml
deleted file mode 100644
index 3d6efdd..0000000
--- a/examples/jms/client-side-load-balancing/src/main/resources/activemq/server1/broker.xml
+++ /dev/null
@@ -1,89 +0,0 @@
-<?xml version='1.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.
--->
-
-<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-               xmlns="urn:activemq"
-               xsi:schemaLocation="urn:activemq /schema/artemis-server.xsd">
-   <jms xmlns="urn:activemq:jms">
-      <!--the queue used by the example-->
-      <queue name="exampleQueue"/>
-   </jms>
-   <core xmlns="urn:activemq:core">
-      <bindings-directory>${data.dir}/server1/data/messaging/bindings</bindings-directory>
-
-      <journal-directory>${data.dir}/server1/data/messaging/journal</journal-directory>
-
-      <large-messages-directory>${data.dir}/server1/data/messaging/largemessages</large-messages-directory>
-
-      <paging-directory>${data.dir}/server1/data/messaging/paging</paging-directory>
-
-      <!-- Connectors -->
-      <connectors>
-         <connector name="netty-connector">tcp://localhost:61617</connector>
-      </connectors>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61617</acceptor>
-      </acceptors>
-
-      <!-- Clustering configuration -->
-      <broadcast-groups>
-         <broadcast-group name="my-broadcast-group">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <broadcast-period>100</broadcast-period>
-            <connector-ref>netty-connector</connector-ref>
-         </broadcast-group>
-      </broadcast-groups>
-
-      <discovery-groups>
-         <discovery-group name="my-discovery-group">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <refresh-timeout>10000</refresh-timeout>
-         </discovery-group>
-      </discovery-groups>
-
-      <cluster-connections>
-         <cluster-connection name="my-cluster">
-            <address>jms</address>
-            <connector-ref>netty-connector</connector-ref>
-            <max-hops>0</max-hops>
-            <discovery-group-ref discovery-group-name="my-discovery-group"/>
-         </cluster-connection>
-      </cluster-connections>
-
-      <!-- Other config -->
-
-      <security-settings>
-         <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
-            <permission type="createDurableQueue" roles="guest"/>
-            <permission type="deleteDurableQueue" roles="guest"/>
-            <permission type="createNonDurableQueue" roles="guest"/>
-            <permission type="deleteNonDurableQueue" roles="guest"/>
-            <permission type="consume" roles="guest"/>
-            <permission type="send" roles="guest"/>
-         </security-setting>
-      </security-settings>
-   </core>
-
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/client-side-load-balancing/src/main/resources/activemq/server2/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/client-side-load-balancing/src/main/resources/activemq/server2/artemis-roles.properties b/examples/jms/client-side-load-balancing/src/main/resources/activemq/server2/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/client-side-load-balancing/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/b3af4bb7/examples/jms/client-side-load-balancing/src/main/resources/activemq/server2/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/client-side-load-balancing/src/main/resources/activemq/server2/artemis-users.properties b/examples/jms/client-side-load-balancing/src/main/resources/activemq/server2/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/client-side-load-balancing/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/b3af4bb7/examples/jms/client-side-load-balancing/src/main/resources/activemq/server2/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/client-side-load-balancing/src/main/resources/activemq/server2/broker.xml b/examples/jms/client-side-load-balancing/src/main/resources/activemq/server2/broker.xml
deleted file mode 100644
index e4bcf5e..0000000
--- a/examples/jms/client-side-load-balancing/src/main/resources/activemq/server2/broker.xml
+++ /dev/null
@@ -1,87 +0,0 @@
-<?xml version='1.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.
--->
-
-<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-               xmlns="urn:activemq"
-               xsi:schemaLocation="urn:activemq /schema/artemis-server.xsd">
-   <jms xmlns="urn:activemq:jms">
-   </jms>
-   <core xmlns="urn:activemq:core">
-      <bindings-directory>${data.dir}/server2/data/messaging/bindings</bindings-directory>
-
-      <journal-directory>${data.dir}/server2/data/messaging/journal</journal-directory>
-
-      <large-messages-directory>${data.dir}/server2/data/messaging/largemessages</large-messages-directory>
-
-      <paging-directory>${data.dir}/server2/data/messaging/paging</paging-directory>
-
-      <!-- Connectors -->
-      <connectors>
-         <connector name="netty-connector">tcp://localhost:61618</connector>
-      </connectors>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61618</acceptor>
-      </acceptors>
-
-      <!-- Clustering configuration -->
-      <broadcast-groups>
-         <broadcast-group name="my-broadcast-group">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <broadcast-period>100</broadcast-period>
-            <connector-ref>netty-connector</connector-ref>
-         </broadcast-group>
-      </broadcast-groups>
-
-      <discovery-groups>
-         <discovery-group name="my-discovery-group">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <refresh-timeout>10000</refresh-timeout>
-         </discovery-group>
-      </discovery-groups>
-
-      <cluster-connections>
-         <cluster-connection name="my-cluster">
-            <address>jms</address>
-            <connector-ref>netty-connector</connector-ref>
-            <max-hops>0</max-hops>
-            <discovery-group-ref discovery-group-name="my-discovery-group"/>
-         </cluster-connection>
-      </cluster-connections>
-
-      <!-- Other config -->
-
-      <security-settings>
-         <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
-            <permission type="createDurableQueue" roles="guest"/>
-            <permission type="deleteDurableQueue" roles="guest"/>
-            <permission type="createNonDurableQueue" roles="guest"/>
-            <permission type="deleteNonDurableQueue" roles="guest"/>
-            <permission type="consume" roles="guest"/>
-            <permission type="send" roles="guest"/>
-         </security-setting>
-      </security-settings>
-   </core>
-
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/clustered-durable-subscription/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-durable-subscription/pom.xml b/examples/jms/clustered-durable-subscription/pom.xml
index 324eed6..a23512c 100644
--- a/examples/jms/clustered-durable-subscription/pom.xml
+++ b/examples/jms/clustered-durable-subscription/pom.xml
@@ -57,34 +57,24 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start0</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
                         </configuration>
                      </execution>
                      <execution>
-                        <id>start1</id>
+                        <id>create2</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
-                           <fork>true</fork>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server1</instance>
+                           <configuration>${basedir}/target/classes/activemq/server1</configuration>
+                           <portOffset>1</portOffset>
                         </configuration>
                      </execution>
                      <execution>
@@ -95,33 +85,9 @@ under the License.
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.ClusteredDurableSubscriptionExample</clientClass>
                            <args>
-                              <param>tcp://localhost:61616</param>
-                              <param>tcp://localhost:61617</param>
+                              <param>${basedir}/target/server0</param>
+                              <param>${basedir}/target/server1</param>
                            </args>
-                           <systemProperties>
-                              <property>
-                                 <name>exampleConfigDir</name>
-                                 <value>${basedir}/target/classes/activemq</value>
-                              </property>
-                           </systemProperties>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop0</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop1</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
                         </configuration>
                      </execution>
                   </executions>
@@ -131,46 +97,7 @@ under the License.
                         <artifactId>artemis-jms-clustered-durable-subscription-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <systemProperties>
-                        <property>
-                           <name>data.dir</name>
-                           <value>${basedir}/target/</value>
-                        </property>
-                     </systemProperties>
-                  </configuration>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/clustered-durable-subscription/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredDurableSubscriptionExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-durable-subscription/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredDurableSubscriptionExample.java b/examples/jms/clustered-durable-subscription/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredDurableSubscriptionExample.java
index c5b3be4..d850f08 100644
--- a/examples/jms/clustered-durable-subscription/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredDurableSubscriptionExample.java
+++ b/examples/jms/clustered-durable-subscription/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredDurableSubscriptionExample.java
@@ -16,8 +16,6 @@
  */
 package org.apache.activemq.artemis.jms.example;
 
-import java.util.Hashtable;
-
 import javax.jms.Connection;
 import javax.jms.ConnectionFactory;
 import javax.jms.MessageConsumer;
@@ -26,6 +24,7 @@ import javax.jms.Session;
 import javax.jms.TextMessage;
 import javax.jms.Topic;
 import javax.naming.InitialContext;
+import java.util.Hashtable;
 
 import org.apache.activemq.artemis.common.example.ActiveMQExample;
 
@@ -58,7 +57,7 @@ public class ClusteredDurableSubscriptionExample extends ActiveMQExample
          // 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", args[0]);
+         properties.put("connectionFactory.ConnectionFactory", "tcp://localhost:61616");
          properties.put("topic.topic/exampleTopic", "exampleTopic");
          ic0 = new InitialContext(properties);
 
@@ -72,7 +71,7 @@ public class ClusteredDurableSubscriptionExample extends ActiveMQExample
 
          properties = new Hashtable<String, Object>();
          properties.put("java.naming.factory.initial", "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory");
-         properties.put("connectionFactory.ConnectionFactory", args[1]);
+         properties.put("connectionFactory.ConnectionFactory", "tcp://localhost:61617");
          ic1 = new InitialContext(properties);
 
          // Step 5. Look-up a JMS Connection Factory object from JNDI on server 1

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/clustered-durable-subscription/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-durable-subscription/src/main/resources/activemq/server0/artemis-roles.properties b/examples/jms/clustered-durable-subscription/src/main/resources/activemq/server0/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/clustered-durable-subscription/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/b3af4bb7/examples/jms/clustered-durable-subscription/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-durable-subscription/src/main/resources/activemq/server0/artemis-users.properties b/examples/jms/clustered-durable-subscription/src/main/resources/activemq/server0/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/clustered-durable-subscription/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/b3af4bb7/examples/jms/clustered-durable-subscription/src/main/resources/activemq/server1/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-durable-subscription/src/main/resources/activemq/server1/artemis-roles.properties b/examples/jms/clustered-durable-subscription/src/main/resources/activemq/server1/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/clustered-durable-subscription/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/b3af4bb7/examples/jms/clustered-durable-subscription/src/main/resources/activemq/server1/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-durable-subscription/src/main/resources/activemq/server1/artemis-users.properties b/examples/jms/clustered-durable-subscription/src/main/resources/activemq/server1/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/clustered-durable-subscription/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/b3af4bb7/examples/jms/clustered-grouping/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-grouping/pom.xml b/examples/jms/clustered-grouping/pom.xml
index 45fe589..a9357cf 100644
--- a/examples/jms/clustered-grouping/pom.xml
+++ b/examples/jms/clustered-grouping/pom.xml
@@ -57,62 +57,35 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start0</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                              <property>
-                                 <name>udp-address</name>
-                                 <value>${udp-address}</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
                         </configuration>
                      </execution>
                      <execution>
-                        <id>start1</id>
+                        <id>create2</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
-                           <fork>true</fork>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                              <property>
-                                 <name>udp-address</name>
-                                 <value>${udp-address}</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server1</instance>
+                           <configuration>${basedir}/target/classes/activemq/server1</configuration>
+                           <portOffset>1</portOffset>
                         </configuration>
                      </execution>
                      <execution>
-                        <id>start2</id>
+                        <id>create3</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server2</configurationDir>
-                           <fork>true</fork>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                              <property>
-                                 <name>udp-address</name>
-                                 <value>${udp-address}</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server2</instance>
+                           <configuration>${basedir}/target/classes/activemq/server2</configuration>
+                           <portOffset>2</portOffset>
                         </configuration>
                      </execution>
                      <execution>
@@ -123,43 +96,10 @@ under the License.
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.ClusteredGroupingExample</clientClass>
                            <args>
-                              <param>tcp://localhost:61616</param>
-                              <param>tcp://localhost:61617</param>
-                              <param>tcp://localhost:61618</param>
+                              <param>${basedir}/target/server0</param>
+                              <param>${basedir}/target/server1</param>
+                              <param>${basedir}/target/server2</param>
                            </args>
-                           <systemProperties>
-                              <property>
-                                 <name>exampleConfigDir</name>
-                                 <value>${basedir}/target/classes/activemq</value>
-                              </property>
-                           </systemProperties>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop0</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop1</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop2</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server2</configurationDir>
                         </configuration>
                      </execution>
                   </executions>
@@ -169,46 +109,7 @@ under the License.
                         <artifactId>artemis-jms-clustered-grouping-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <systemProperties>
-                        <property>
-                           <name>data.dir</name>
-                           <value>${basedir}/target/</value>
-                        </property>
-                     </systemProperties>
-                  </configuration>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/clustered-grouping/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredGroupingExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-grouping/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredGroupingExample.java b/examples/jms/clustered-grouping/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredGroupingExample.java
index 8e40e94..b13681b 100644
--- a/examples/jms/clustered-grouping/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredGroupingExample.java
+++ b/examples/jms/clustered-grouping/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredGroupingExample.java
@@ -16,8 +16,6 @@
  */
 package org.apache.activemq.artemis.jms.example;
 
-import java.util.Hashtable;
-
 import javax.jms.Connection;
 import javax.jms.ConnectionFactory;
 import javax.jms.MessageConsumer;
@@ -26,6 +24,7 @@ import javax.jms.Queue;
 import javax.jms.Session;
 import javax.jms.TextMessage;
 import javax.naming.InitialContext;
+import java.util.Hashtable;
 
 import org.apache.activemq.artemis.common.example.ActiveMQExample;
 
@@ -60,7 +59,7 @@ public class ClusteredGroupingExample extends ActiveMQExample
          // 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", args[0]);
+         properties.put("connectionFactory.ConnectionFactory", "tcp://localhost:61616");
          properties.put("queue.queue/exampleQueue", "exampleQueue");
          ic0 = new InitialContext(properties);
 
@@ -73,7 +72,7 @@ public class ClusteredGroupingExample extends ActiveMQExample
          // Step 4. Get an initial context for looking up JNDI from server 1
          properties = new Hashtable<String, Object>();
          properties.put("java.naming.factory.initial", "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory");
-         properties.put("connectionFactory.ConnectionFactory", args[1]);
+         properties.put("connectionFactory.ConnectionFactory", "tcp://localhost:61617");
          ic1 = new InitialContext(properties);
 
          // Step 5. Look-up a JMS Connection Factory object from JNDI on server 1
@@ -82,7 +81,7 @@ public class ClusteredGroupingExample extends ActiveMQExample
          // Step 4. Get an initial context for looking up JNDI from server 2
          properties = new Hashtable<String, Object>();
          properties.put("java.naming.factory.initial", "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory");
-         properties.put("connectionFactory.ConnectionFactory", args[2]);
+         properties.put("connectionFactory.ConnectionFactory", "tcp://localhost:61618");
          ic2 = new InitialContext(properties);
 
          // Step 5. Look-up a JMS Connection Factory object from JNDI on server 2

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/clustered-grouping/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-grouping/src/main/resources/activemq/server0/artemis-roles.properties b/examples/jms/clustered-grouping/src/main/resources/activemq/server0/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/clustered-grouping/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/b3af4bb7/examples/jms/clustered-grouping/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-grouping/src/main/resources/activemq/server0/artemis-users.properties b/examples/jms/clustered-grouping/src/main/resources/activemq/server0/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/clustered-grouping/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/b3af4bb7/examples/jms/clustered-grouping/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-grouping/src/main/resources/activemq/server0/broker.xml b/examples/jms/clustered-grouping/src/main/resources/activemq/server0/broker.xml
index eb20ac8..8b67aa5 100644
--- a/examples/jms/clustered-grouping/src/main/resources/activemq/server0/broker.xml
+++ b/examples/jms/clustered-grouping/src/main/resources/activemq/server0/broker.xml
@@ -30,13 +30,14 @@ under the License.
    <core xmlns="urn:activemq:core">
 
 
-      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
+      <bindings-directory>${data.dir:../data}/bindings</bindings-directory>
 
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
+      <journal-directory>${data.dir:../data}/journal</journal-directory>
 
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
+      <large-messages-directory>${data.dir:../data}/largemessages</large-messages-directory>
+
+      <paging-directory>${data.dir:../data}/paging</paging-directory>
 
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
 
       <!-- Connectors -->
 


[23/24] activemq-artemis git commit: ARTEMIS-178 Refactor examples to use CLI

Posted by cl...@apache.org.
ARTEMIS-178 Refactor examples to use CLI

This is changing the examples to run the real servers.
The maven plugin should be an automation of the CLI
Where we run real servers instead of any embedded framework

Going forward we will need to remove the common examples.
Failover examples will be able to use Process Builders


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/b3af4bb7
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/b3af4bb7
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/b3af4bb7

Branch: refs/heads/master
Commit: b3af4bb77751996419868be9784ba73f1c7e72fe
Parents: c8d053e
Author: Clebert Suconic <cl...@apache.org>
Authored: Tue May 12 17:59:02 2015 -0400
Committer: jbertram <jb...@apache.org>
Committed: Wed Jul 29 16:00:41 2015 -0500

----------------------------------------------------------------------
 .../apache/activemq/artemis/cli/Artemis.java    |   6 +
 .../activemq/artemis/cli/commands/Create.java   |  29 +-
 .../activemq/artemis/cli/commands/Run.java      |   2 +
 .../artemis/cli/process/ProcessBuilder.java     | 192 +++++++++++
 .../artemis/cli/process/package-info.java       |  19 ++
 .../cli/commands/etc/replicated-settings.txt    |   2 +-
 .../cli/commands/etc/shared-store-settings.txt  |   2 +-
 .../src/main/resources/bin/artemis              |   2 +-
 artemis-maven-plugin/pom.xml                    |  20 ++
 .../activemq/artemis/maven/ActiveMQClient.java  |  22 --
 .../artemis/maven/ActiveMQClientPlugin.java     |  19 +-
 .../artemis/maven/ActiveMQCreatePlugin.java     | 331 +++++++++++++++++++
 .../artemis/maven/ActiveMQStartPlugin.java      | 230 -------------
 .../artemis/maven/ActiveMQStopPlugin.java       |  76 -----
 .../artemis/maven/ArtemisCLIPlugin.java         | 172 ++++++++++
 .../artemis/maven/InVMNodeManagerServer.java    |  75 -----
 .../artemis/maven/LibInstallPlugin.java         | 147 ++++++++
 .../activemq/artemis/maven/PluginUtil.java      |  50 ---
 .../artemis/maven/TestClusterManager.java       |  52 ---
 .../artemis/maven/TestClusterManagerMBean.java  |  29 --
 .../apache/activemq/artemis/maven/TestNode.java |  49 ---
 .../artemis/server/ActiveMQBootstrap.java       | 270 ---------------
 .../server/SpawnedActiveMQBootstrap.java        |  38 ---
 .../artemis/server/SpawnedVMSupport.java        | 252 --------------
 examples/jms/aerogear/pom.xml                   | 137 ++++----
 .../artemis/jms/example/AerogearExample.java    |  16 +-
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |  10 +-
 examples/jms/application-layer-failover/pom.xml |  77 +----
 .../ApplicationLayerFailoverExample.java        |   6 +-
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |  53 ---
 .../activemq/server1/artemis-roles.properties   |  17 -
 .../activemq/server1/artemis-users.properties   |  17 -
 .../main/resources/activemq/server1/broker.xml  |  56 ----
 examples/jms/bridge/pom.xml                     |  65 +---
 .../artemis/jms/example/BridgeExample.java      |   3 +-
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../activemq/server1/artemis-roles.properties   |  17 -
 .../activemq/server1/artemis-users.properties   |  17 -
 examples/jms/browser/pom.xml                    |  53 +--
 .../jms/example/QueueBrowserExample.java        |   3 +-
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |  61 ----
 examples/jms/client-kickoff/pom.xml             |  72 +---
 .../jms/example/ClientKickoffExample.java       |   5 +-
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../jms/client-side-failoverlistener/pom.xml    | 107 +-----
 .../ClientSideFailoverListerExample.java        |  14 +-
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |  92 ------
 .../activemq/server1/artemis-roles.properties   |  17 -
 .../activemq/server1/artemis-users.properties   |  17 -
 .../main/resources/activemq/server1/broker.xml  |  93 ------
 examples/jms/client-side-load-balancing/pom.xml | 128 ++-----
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |  92 ------
 .../activemq/server1/artemis-roles.properties   |  17 -
 .../activemq/server1/artemis-users.properties   |  17 -
 .../main/resources/activemq/server1/broker.xml  |  89 -----
 .../activemq/server2/artemis-roles.properties   |  17 -
 .../activemq/server2/artemis-users.properties   |  17 -
 .../main/resources/activemq/server2/broker.xml  |  87 -----
 .../jms/clustered-durable-subscription/pom.xml  |  95 +-----
 .../ClusteredDurableSubscriptionExample.java    |   7 +-
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../activemq/server1/artemis-roles.properties   |  17 -
 .../activemq/server1/artemis-users.properties   |  17 -
 examples/jms/clustered-grouping/pom.xml         | 133 +-------
 .../jms/example/ClusteredGroupingExample.java   |   9 +-
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |   9 +-
 .../activemq/server1/artemis-roles.properties   |  17 -
 .../activemq/server1/artemis-users.properties   |  17 -
 .../main/resources/activemq/server1/broker.xml  |   9 +-
 .../activemq/server2/artemis-roles.properties   |  17 -
 .../activemq/server2/artemis-users.properties   |  17 -
 .../main/resources/activemq/server2/broker.xml  |   9 +-
 examples/jms/clustered-jgroups/pom.xml          |  95 ++----
 .../jms/example/ClusteredJgroupsExample.java    |   7 +-
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../activemq/server0/test-jgroups-file_ping.xml |   3 +-
 .../activemq/server1/artemis-roles.properties   |  17 -
 .../activemq/server1/artemis-users.properties   |  17 -
 .../activemq/server1/test-jgroups-file_ping.xml |   3 +-
 examples/jms/clustered-queue/pom.xml            |  83 +----
 .../jms/example/ClusteredQueueExample.java      |   7 +-
 examples/jms/clustered-standalone/pom.xml       | 112 +------
 .../jms/example/ClusteredStandaloneExample.java |  11 +-
 examples/jms/clustered-static-discovery/pom.xml | 123 ++-----
 .../example/StaticClusteredQueueExample.java    |   5 +-
 examples/jms/clustered-static-oneway/pom.xml    | 101 +-----
 .../jms/example/ClusterStaticOnewayExample.java |   5 +-
 examples/jms/clustered-topic/pom.xml            | 102 +-----
 .../jms/example/ClusteredTopicExample.java      |   7 +-
 .../jms/colocated-failover-scale-down/pom.xml   |  88 +----
 .../ColocatedFailoverScaleDownExample.java      |  11 +-
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 .../main/resources/activemq/server1/broker.xml  |   8 +-
 examples/jms/colocated-failover/pom.xml         |  88 +----
 .../jms/example/ColocatedFailoverExample.java   |  11 +-
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 .../main/resources/activemq/server1/broker.xml  |   8 +-
 examples/jms/common/pom.xml                     |   5 +
 .../artemis/common/example/ActiveMQExample.java | 222 ++++++++-----
 .../artemis/common/example/ExampleUtil.java     | 122 +++++++
 examples/jms/consumer-rate-limit/pom.xml        |  54 +--
 examples/jms/dead-letter/pom.xml                |  54 +--
 examples/jms/delayed-redelivery/pom.xml         |  56 +---
 examples/jms/divert/pom.xml                     |  82 +----
 .../artemis/jms/example/DivertExample.java      |   7 +-
 examples/jms/durable-subscription/pom.xml       |  54 +--
 examples/jms/embedded-simple/pom.xml            |  44 ---
 .../artemis/jms/example/EmbeddedExample.java    |  11 +-
 examples/jms/embedded/pom.xml                   |  44 ---
 .../artemis/jms/example/EmbeddedExample.java    |   7 +-
 examples/jms/expiry/pom.xml                     |  54 +--
 examples/jms/ha-policy-autobackup/pom.xml       |  88 +----
 .../jms/example/HAPolicyAutoBackupExample.java  |  28 +-
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 .../main/resources/activemq/server1/broker.xml  |   8 +-
 examples/jms/http-transport/pom.xml             |  60 +---
 .../main/resources/activemq/server0/broker.xml  |   2 +
 .../jms/instantiate-connection-factory/pom.xml  |  54 +--
 .../InstantiateConnectionFactoryExample.java    |   7 +-
 .../main/resources/activemq/server0/broker.xml  |   2 +-
 examples/jms/interceptor/pom.xml                |  56 +---
 examples/jms/jms-auto-closeable/pom.xml         |  55 +--
 examples/jms/jms-bridge/pom.xml                 |  82 +----
 .../artemis/jms/example/JMSBridgeExample.java   |  34 +-
 .../main/resources/activemq/server1/broker.xml  |   3 +-
 examples/jms/jms-completion-listener/pom.xml    |  57 +---
 examples/jms/jms-context/pom.xml                |  55 +--
 examples/jms/jms-shared-consumer/pom.xml        |  54 +--
 .../jms/example/JMSSharedConsumerExample.java   |   5 +-
 examples/jms/jmx/pom.xml                        |  77 +----
 examples/jms/large-message/pom.xml              |  63 +---
 .../jms/example/LargeMessageExample.java        |  15 +-
 examples/jms/last-value-queue/pom.xml           |  57 +---
 examples/jms/management-notifications/pom.xml   |  57 +---
 examples/jms/management/pom.xml                 |  55 +--
 examples/jms/message-counters/pom.xml           |  77 +----
 examples/jms/message-group/pom.xml              |  57 +---
 examples/jms/message-group2/pom.xml             |  55 +--
 examples/jms/message-priority/pom.xml           |  57 +---
 examples/jms/multiple-failover-failback/pom.xml | 132 +-------
 .../MultipleFailoverFailbackExample.java        |  16 +-
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 .../main/resources/activemq/server1/broker.xml  |   8 +-
 .../main/resources/activemq/server2/broker.xml  |   8 +-
 examples/jms/multiple-failover/pom.xml          | 130 +-------
 .../jms/example/MultipleFailoverExample.java    |  19 +-
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 .../main/resources/activemq/server1/broker.xml  |   8 +-
 .../main/resources/activemq/server2/broker.xml  |   8 +-
 examples/jms/no-consumer-buffering/pom.xml      |  55 +--
 examples/jms/non-transaction-failover/pom.xml   |  98 +-----
 .../example/NonTransactionFailoverExample.java  |  13 +-
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 .../main/resources/activemq/server1/broker.xml  |   8 +-
 examples/jms/openwire/pom.xml                   |  60 +---
 .../main/resources/activemq/server0/broker.xml  |   4 +-
 examples/jms/paging/pom.xml                     |  55 +--
 examples/jms/perf/pom.xml                       |  90 ++---
 .../activemq/artemis/jms/example/Server.java    |  28 ++
 .../jms/perf/src/main/resources/perf.properties |   6 +-
 examples/jms/pre-acknowledge/pom.xml            |  54 +--
 examples/jms/producer-rate-limit/pom.xml        |  55 +--
 examples/jms/proton-cpp/pom.xml                 |  61 +---
 .../artemis/jms/example/ProtonCPPExample.java   |   3 -
 examples/jms/proton-j/pom.xml                   |  59 +---
 .../main/resources/activemq/server0/broker.xml  |   1 +
 examples/jms/proton-ruby/pom.xml                |  52 +--
 examples/jms/proton-ruby/readme.html            |   3 +-
 .../jms/queue-message-redistribution/pom.xml    | 102 +-----
 .../QueueMessageRedistributionExample.java      |   7 +-
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../activemq/server1/artemis-roles.properties   |  17 -
 .../activemq/server1/artemis-users.properties   |  17 -
 examples/jms/queue-requestor/pom.xml            |  55 +--
 examples/jms/queue-selector/pom.xml             |  55 +--
 examples/jms/queue/pom.xml                      |  56 +---
 examples/jms/queue/readme.html                  |   1 +
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |  60 ----
 examples/jms/reattach-node/pom.xml              |  64 +---
 examples/jms/replicated-failback-static/pom.xml | 104 +-----
 examples/jms/replicated-failback/pom.xml        | 104 +-----
 .../jms/example/ReplicatedFailbackExample.java  |   6 +
 .../main/resources/activemq/server0/broker.xml  |  10 +-
 .../main/resources/activemq/server1/broker.xml  |  10 +-
 .../jms/replicated-multiple-failover/pom.xml    | 133 +-------
 .../jms/replicated-transaction-failover/pom.xml | 104 +-----
 examples/jms/request-reply/pom.xml              |  55 +--
 examples/jms/scale-down/pom.xml                 |  90 +----
 .../artemis/jms/example/ScaleDownExample.java   |   8 +-
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 .../main/resources/activemq/server1/broker.xml  |   8 +-
 examples/jms/scheduled-message/pom.xml          |  55 +--
 examples/jms/security/pom.xml                   |  55 +--
 examples/jms/send-acknowledgements/pom.xml      |  55 +--
 examples/jms/spring-integration/pom.xml         |  37 +--
 examples/jms/ssl-enabled/pom.xml                |  55 +--
 examples/jms/static-selector-jms/pom.xml        |  54 +--
 examples/jms/static-selector/pom.xml            |  55 +--
 examples/jms/stomp-websockets/pom.xml           |  68 +---
 examples/jms/stomp/pom.xml                      |  60 +---
 examples/jms/stomp1.1/pom.xml                   |  60 +---
 examples/jms/stomp1.2/pom.xml                   |  60 +---
 examples/jms/stop-server-failover/pom.xml       | 104 +-----
 examples/jms/symmetric-cluster/pom.xml          | 225 +++----------
 .../jms/example/SymmetricClusterExample.java    |  12 +-
 examples/jms/temp-queue/pom.xml                 |  55 +--
 examples/jms/topic-hierarchies/pom.xml          |  55 +--
 examples/jms/topic-selector-example1/pom.xml    |  55 +--
 examples/jms/topic-selector-example2/pom.xml    |  55 +--
 examples/jms/topic/pom.xml                      |  54 +--
 examples/jms/transaction-failover/pom.xml       | 104 +-----
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 .../main/resources/activemq/server1/broker.xml  |   8 +-
 examples/jms/transactional/pom.xml              |  55 +--
 examples/jms/xa-heuristic/pom.xml               |  76 +----
 .../artemis/jms/example/XAHeuristicExample.java |  12 +-
 examples/jms/xa-receive/pom.xml                 |  58 +---
 .../artemis/jms/example/XAReceiveExample.java   |  10 +-
 .../artemis/jms/example/XASendExample.java      |  10 +-
 examples/soak/normal/README                     |  21 +-
 examples/soak/normal/pom.xml                    | 125 +++----
 examples/soak/normal/server0/broker.xml         |   5 +-
 .../artemis/jms/soak/example/SoakReceiver.java  |  31 +-
 .../artemis/jms/soak/example/SoakSender.java    |  27 +-
 .../normal/src/main/resources/jndi.properties   |  20 ++
 244 files changed, 2501 insertions(+), 8758 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/Artemis.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/Artemis.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/Artemis.java
index 1b09ea4..edcdce0 100644
--- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/Artemis.java
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/Artemis.java
@@ -19,6 +19,7 @@ package org.apache.activemq.artemis.cli;
 import java.io.File;
 import java.io.InputStream;
 import java.io.OutputStream;
+import java.util.List;
 
 import io.airlift.airline.Cli;
 import org.apache.activemq.artemis.cli.commands.Action;
@@ -70,6 +71,11 @@ public class Artemis
       return execute(null, null, args);
    }
 
+   public static Object execute(File artemisHome, File artemisInstance, List<String> args) throws Exception
+   {
+      return execute(artemisHome, artemisInstance, (String[]) args.toArray(new String[args.size()]));
+   }
+
    public static Object execute(File artemisHome, File artemisInstance, String... args) throws Exception
    {
       Action action = builder(artemisInstance).build().parse(args);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java
----------------------------------------------------------------------
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 b349ad1..580b411 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
@@ -118,6 +118,9 @@ public class Create extends InputAbstract
    @Option(name = "--shared-store", description = "Enable broker shared store")
    boolean sharedStore = false;
 
+   @Option(name = "--slave", description = "Valid for shared store or replication: this is a slave server?")
+   boolean slave;
+
    @Option(name = "--cluster-user", description = "The cluster user to use for clustering. (Default: input)")
    String clusterUser = null;
 
@@ -411,6 +414,26 @@ public class Create extends InputAbstract
       this.role = role;
    }
 
+   public boolean isSlave()
+   {
+      return slave;
+   }
+
+   public void setSlave(boolean slave)
+   {
+      this.slave = slave;
+   }
+
+   public Boolean getAllowAnonymous()
+   {
+      return allowAnonymous;
+   }
+
+   public void setAllowAnonymous(Boolean allowAnonymous)
+   {
+      this.allowAnonymous = allowAnonymous;
+   }
+
    @Override
    public Object execute(ActionContext context) throws Exception
    {
@@ -469,10 +492,12 @@ public class Create extends InputAbstract
 
       HashMap<String, String> filters = new HashMap<String, String>();
 
+      filters.put("${master-slave}", isSlave() ? "slave" : "master");
+
       if (replicated)
       {
          clustered = true;
-         filters.put("${replicated.settings}", readTextFile(ETC_REPLICATED_SETTINGS_TXT));
+         filters.put("${replicated.settings}", applyFilters(readTextFile(ETC_REPLICATED_SETTINGS_TXT), filters));
       }
       else
       {
@@ -482,7 +507,7 @@ public class Create extends InputAbstract
       if (sharedStore)
       {
          clustered = true;
-         filters.put("${shared-store.settings}", readTextFile(ETC_SHARED_STORE_SETTINGS_TXT));
+         filters.put("${shared-store.settings}", applyFilters(readTextFile(ETC_SHARED_STORE_SETTINGS_TXT), filters));
       }
       else
       {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Run.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Run.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Run.java
index e9b7705..67824ce 100644
--- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Run.java
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Run.java
@@ -164,6 +164,8 @@ public class Run extends Configurable
                }
                finally
                {
+                  System.out.println("Server stopped!");
+                  System.out.flush();
                   latchRunning.countDown();
                   if (!embedded)
                   {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/process/ProcessBuilder.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/process/ProcessBuilder.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/process/ProcessBuilder.java
new file mode 100644
index 0000000..05d09d5
--- /dev/null
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/process/ProcessBuilder.java
@@ -0,0 +1,192 @@
+/*
+ * 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.
+ */
+package org.apache.activemq.artemis.cli.process;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+
+import org.apache.activemq.artemis.utils.ConcurrentHashSet;
+
+public class ProcessBuilder
+{
+   static ConcurrentHashSet<Process> processes = new ConcurrentHashSet<>();
+
+   static
+   {
+      Runtime.getRuntime().addShutdownHook(new Thread()
+      {
+         public void run()
+         {
+            for (Process p : processes)
+            {
+               if (p.isAlive())
+               {
+                  p.destroy();
+               }
+            }
+         }
+      });
+   }
+
+
+   /**
+    * it will lookup for process that are dead already, eliminating leaks.
+    */
+   public static void cleanupProcess()
+   {
+      for (Process p: processes)
+      {
+         if (!p.isAlive())
+         {
+            processes.remove(p);
+         }
+      }
+   }
+
+
+
+   /**
+    * *
+    * @param logname the prefix for log output
+    * @param location The location where this command is being executed from
+    * @param hook it will finish the process upon shutdown of the VM
+    * @param args The arguments being passwed to the the CLI tool
+    * @return
+    * @throws Exception
+    */
+   public static Process build(String logname, File location, boolean hook, String... args) throws Exception
+   {
+      boolean IS_WINDOWS = System.getProperty("os.name").toLowerCase().trim().startsWith("win");
+
+      String[] newArgs;
+      if (IS_WINDOWS)
+      {
+         newArgs = rebuildArgs(args, "cmd", "/c", "artemis.cmd");
+      }
+      else
+      {
+         newArgs = rebuildArgs(args, "./artemis");
+      }
+
+      java.lang.ProcessBuilder builder = new java.lang.ProcessBuilder(newArgs);
+
+      builder.directory(new File(location, "bin"));
+
+      Process process = builder.start();
+
+      ProcessLogger outputLogger = new ProcessLogger(true,
+                                                     process.getInputStream(),
+                                                     logname + "::Out",
+                                                     false);
+      outputLogger.start();
+
+      // Adding a reader to System.err, so the VM won't hang on a System.err.println as identified on this forum thread:
+      ProcessLogger errorLogger = new ProcessLogger(true,
+                                                    process.getErrorStream(),
+                                                    logname + "::Err",
+                                                    true);
+      errorLogger.start();
+
+      processes.add(process);
+
+      cleanupProcess();
+
+      return process;
+   }
+
+   public static String[] rebuildArgs(String[] args, String ... prefixArgs)
+   {
+      String[] resultArgs = new String[args.length + prefixArgs.length];
+
+      int i = 0;
+
+      for (String arg: prefixArgs)
+      {
+         resultArgs[i++] = arg;
+      }
+
+      for (String arg: args)
+      {
+         resultArgs[i++] = arg;
+      }
+
+      return resultArgs;
+   }
+
+
+   /**
+    * Redirect the input stream to a logger (as debug logs)
+    */
+   static class ProcessLogger extends Thread
+   {
+      private final InputStream is;
+
+      private final String logName;
+
+      private final boolean print;
+
+      private final boolean sendToErr;
+
+      boolean failed = false;
+
+      ProcessLogger(final boolean print,
+                    final InputStream is,
+                    final String logName,
+                    final boolean sendToErr) throws ClassNotFoundException
+      {
+         this.is = is;
+         this.print = print;
+         this.logName = logName;
+         this.sendToErr = sendToErr;
+         setDaemon(false);
+      }
+
+      @Override
+      public void run()
+      {
+         try
+         {
+            InputStreamReader isr = new InputStreamReader(is);
+            BufferedReader br = new BufferedReader(isr);
+            String line;
+            while ((line = br.readLine()) != null)
+            {
+               if (print)
+               {
+                  if (sendToErr)
+                  {
+                     System.err.println(logName + " err:" + line);
+                  }
+                  else
+                  {
+                     System.out.println(logName + " out:" + line);
+                  }
+               }
+            }
+         }
+         catch (IOException e)
+         {
+            // ok, stream closed
+         }
+
+      }
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/process/package-info.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/process/package-info.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/process/package-info.java
new file mode 100644
index 0000000..d902bbd
--- /dev/null
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/process/package-info.java
@@ -0,0 +1,19 @@
+/*
+ * 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.
+ */
+
+/** Contains useful classes for spawning process from client classes */
+package org.apache.activemq.artemis.cli.process;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/replicated-settings.txt
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/replicated-settings.txt b/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/replicated-settings.txt
index db9faa0..17a2bc3 100644
--- a/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/replicated-settings.txt
+++ b/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/replicated-settings.txt
@@ -1,6 +1,6 @@
 
       <ha-policy>
          <replication>
-            <master/>
+            <${master-slave}/>
          </replication>
       </ha-policy>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/shared-store-settings.txt
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/shared-store-settings.txt b/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/shared-store-settings.txt
index 5901938..750dbc1 100644
--- a/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/shared-store-settings.txt
+++ b/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/shared-store-settings.txt
@@ -1,6 +1,6 @@
 
       <ha-policy>
          <shared-store>
-            <master/>
+            <${master-slave}/>
          </shared-store>
       </ha-policy>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/artemis-distribution/src/main/resources/bin/artemis
----------------------------------------------------------------------
diff --git a/artemis-distribution/src/main/resources/bin/artemis b/artemis-distribution/src/main/resources/bin/artemis
index a91cf5c..296fb29 100755
--- a/artemis-distribution/src/main/resources/bin/artemis
+++ b/artemis-distribution/src/main/resources/bin/artemis
@@ -105,4 +105,4 @@ exec "$JAVACMD" $JAVA_ARGS $ARTEMIS_CLUSTER_PROPS \
     -Dartemis.home="$ARTEMIS_HOME" \
     -Djava.library.path="$ARTEMIS_HOME/bin/lib/linux-i686:$ARTEMIS_HOME/bin/lib/linux-x86_64" \
     $DEBUG_ARGS \
-    org.apache.activemq.artemis.boot.Artemis $@
+    org.apache.activemq.artemis.boot.Artemis "$@"

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/artemis-maven-plugin/pom.xml
----------------------------------------------------------------------
diff --git a/artemis-maven-plugin/pom.xml b/artemis-maven-plugin/pom.xml
index 9d086ad..960a46e 100644
--- a/artemis-maven-plugin/pom.xml
+++ b/artemis-maven-plugin/pom.xml
@@ -43,6 +43,16 @@
          <version>2.0</version>
       </dependency>
       <dependency>
+         <groupId>org.eclipse.aether</groupId>
+         <artifactId>aether-api</artifactId>
+         <version>1.0.2.v20150114</version>
+      </dependency>
+      <dependency>
+         <groupId>org.eclipse.aether</groupId>
+         <artifactId>aether-util</artifactId>
+         <version>1.0.2.v20150114</version>
+      </dependency>
+      <dependency>
          <groupId>org.apache.activemq</groupId>
          <artifactId>artemis-server</artifactId>
          <version>${project.version}</version>
@@ -53,6 +63,16 @@
          <version>${project.version}</version>
       </dependency>
       <dependency>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-boot</artifactId>
+         <version>${project.version}</version>
+      </dependency>
+      <dependency>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-cli</artifactId>
+         <version>${project.version}</version>
+      </dependency>
+      <dependency>
          <groupId>io.netty</groupId>
          <artifactId>netty-all</artifactId>
       </dependency>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/ActiveMQClient.java
----------------------------------------------------------------------
diff --git a/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/ActiveMQClient.java b/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/ActiveMQClient.java
deleted file mode 100644
index 4b7de95..0000000
--- a/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/ActiveMQClient.java
+++ /dev/null
@@ -1,22 +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.
- */
-package org.apache.activemq.artemis.maven;
-
-public interface ActiveMQClient
-{
-   void run();
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/ActiveMQClientPlugin.java
----------------------------------------------------------------------
diff --git a/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/ActiveMQClientPlugin.java b/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/ActiveMQClientPlugin.java
index 90a6112..c269e4f 100644
--- a/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/ActiveMQClientPlugin.java
+++ b/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/ActiveMQClientPlugin.java
@@ -16,30 +16,27 @@
  */
 package org.apache.activemq.artemis.maven;
 
-import java.lang.reflect.Method;
-import java.util.Properties;
-
 import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
 import org.apache.maven.plugins.annotations.LifecyclePhase;
 import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+
+import java.lang.reflect.Method;
+import java.util.Properties;
 
 /**
- *         Allows a Java Client to be run which must hve a static main(String[] args) method
+ * Allows a Java Client to be run which must hve a static main(String[] args) method
  */
 @Mojo(name = "runClient", defaultPhase = LifecyclePhase.VERIFY)
 public class ActiveMQClientPlugin extends AbstractMojo
 {
 
-   /**
-    * @parameter
-    */
+   @Parameter
    String clientClass;
 
-   /**
-    * @parameter
-    */
+   @Parameter
    String[] args;
 
    /**
@@ -61,7 +58,7 @@ public class ActiveMQClientPlugin extends AbstractMojo
       }
       catch (Exception e)
       {
-         e.printStackTrace();
+         getLog().error(e);
          throw new MojoFailureException(e.getMessage());
       }
    }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/ActiveMQCreatePlugin.java
----------------------------------------------------------------------
diff --git a/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/ActiveMQCreatePlugin.java b/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/ActiveMQCreatePlugin.java
new file mode 100644
index 0000000..5fca4a3
--- /dev/null
+++ b/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/ActiveMQCreatePlugin.java
@@ -0,0 +1,331 @@
+/**
+ * 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.
+ */
+package org.apache.activemq.artemis.maven;
+
+import java.io.File;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.LinkOption;
+import java.nio.file.Path;
+import java.nio.file.StandardCopyOption;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.activemq.artemis.cli.Artemis;
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugin.descriptor.PluginDescriptor;
+import org.apache.maven.plugins.annotations.Component;
+import org.apache.maven.plugins.annotations.LifecyclePhase;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.maven.project.MavenProject;
+import org.eclipse.aether.RepositorySystem;
+import org.eclipse.aether.RepositorySystemSession;
+import org.eclipse.aether.artifact.Artifact;
+import org.eclipse.aether.artifact.DefaultArtifact;
+import org.eclipse.aether.repository.RemoteRepository;
+import org.eclipse.aether.resolution.ArtifactRequest;
+import org.eclipse.aether.resolution.ArtifactResolutionException;
+import org.eclipse.aether.resolution.ArtifactResult;
+
+@Mojo(name = "create", defaultPhase = LifecyclePhase.VERIFY)
+public class ActiveMQCreatePlugin extends AbstractMojo
+
+{
+
+   @Parameter
+   String name;
+
+   /**
+    * The plugin descriptor
+    */
+   private PluginDescriptor descriptor;
+
+   @Parameter(defaultValue = "${basedir}/target/classes/activemq/server0", required = true)
+   private File configuration;
+
+   @Parameter(defaultValue = "${activemq.basedir}", required = true)
+   private File home;
+
+   @Parameter(defaultValue = "${activemq.basedir}/artemis-distribution/target/apache-artemis-${project.version}-bin/apache-artemis-${project.version}/", required = true)
+   private File alternateHome;
+
+   @Parameter(defaultValue = "${basedir}/target/server0", required = true)
+   private File instance;
+
+   @Parameter(defaultValue = "true")
+   private boolean noWeb;
+
+   @Parameter(defaultValue = "guest")
+   private String user;
+
+   @Parameter(defaultValue = "guest")
+   private String password;
+
+   @Parameter(defaultValue = "guest")
+   private String role;
+
+   @Parameter(defaultValue = "")
+   private String javaOptions = "";
+
+   @Parameter(defaultValue = "0")
+   private int portOffset = 0;
+
+   @Parameter(defaultValue = "true")
+   private boolean allowAnonymous;
+
+   @Parameter(defaultValue = "false")
+   private boolean replicated;
+
+   @Parameter(defaultValue = "false")
+   private boolean sharedStore;
+
+   @Parameter(defaultValue = "true")
+   private boolean clustered;
+
+   @Parameter(defaultValue = "false")
+   private boolean slave;
+
+   @Parameter(defaultValue = "../data")
+   String dataFolder;
+
+   @Component
+   private RepositorySystem repositorySystem;
+
+   @Parameter(defaultValue = "${repositorySystemSession}")
+   private RepositorySystemSession repoSession;
+
+   @Parameter(defaultValue = "${project.remoteProjectRepositories}")
+   private List<RemoteRepository> remoteRepos;
+
+
+   @Parameter
+   private String[] libList;
+
+   @Parameter(defaultValue = "${localRepository}")
+   private org.apache.maven.artifact.repository.ArtifactRepository localRepository;
+
+   /**
+    * Validate if the directory is a artemis.home *
+    *
+    * @param path
+    * @return
+    */
+   private boolean lookupHome(Path path)
+   {
+
+      if (path == null)
+      {
+         return false;
+      }
+
+      Path binFolder = path.resolve("bin");
+
+      if (binFolder == null && Files.exists(binFolder, LinkOption.NOFOLLOW_LINKS))
+      {
+         return false;
+      }
+
+      Path artemisScript = binFolder.resolve("artemis");
+
+
+      return artemisScript != null && Files.exists(artemisScript, LinkOption.NOFOLLOW_LINKS);
+
+
+   }
+
+   private void add(List<String> list,  String ... str)
+   {
+      for (String s: str)
+      {
+         list.add(s);
+      }
+   }
+
+   public void execute() throws MojoExecutionException, MojoFailureException
+   {
+      getLog().info("Local " + localRepository);
+      MavenProject project = (MavenProject) getPluginContext().get("project");
+
+
+      if (!lookupHome(home.toPath()))
+      {
+         if (lookupHome(alternateHome.toPath()))
+         {
+            home = alternateHome;
+         }
+         else
+         {
+            getLog().error("********************************************************************************************");
+            getLog().error("Could not locate suitable Artemis.home on either " + home + " or " + alternateHome);
+            getLog().error("Use the binary distribution or build the distribution before running the examples");
+            getLog().error("********************************************************************************************");
+
+            throw new MojoExecutionException("Couldn't find artemis.home");
+         }
+      }
+
+
+      Map properties = getPluginContext();
+
+      Set<Map.Entry> entries = properties.entrySet();
+
+      getLog().info("Entries.size " + entries.size());
+      for (Map.Entry entry : entries)
+      {
+         getLog().info("... key=" + entry.getKey() + " = " + entry.getValue());
+      }
+
+      ArrayList<String> listCommands = new ArrayList<>();
+      add(listCommands, "create", "--allow-anonymous", "--silent-input", "--force", "--no-web", "--user", user, "--password", password,
+                        "--role", role,
+                        "--port-offset", "" + portOffset,
+                        "--data", dataFolder);
+
+      if (allowAnonymous)
+      {
+         add(listCommands, "--allow-anonymous");
+      }
+      else
+      {
+         add(listCommands, "--require-login");
+      }
+
+      if (!javaOptions.isEmpty())
+      {
+         add(listCommands, "--java-options", javaOptions);
+      }
+
+      if (slave)
+      {
+         add(listCommands, "--slave");
+      }
+
+      if (replicated)
+      {
+         add(listCommands, "--replicated");
+      }
+
+      if (replicated)
+      {
+         add(listCommands, "--shared-store");
+      }
+
+      if (replicated)
+      {
+         add(listCommands, "--shared-store");
+      }
+
+      if (clustered)
+      {
+         add(listCommands, "--clustered");
+      }
+
+      add(listCommands, "--verbose");
+
+      add(listCommands, instance.getAbsolutePath());
+
+      getLog().info("************************************************");
+      getLog().info("Calling create server at " + instance + " home= " + home);
+
+      try
+      {
+         Artemis.execute(home, null, listCommands);
+
+         String[] list = configuration.list();
+
+         if (list != null)
+         {
+            getLog().debug("************************************************");
+            getLog().debug("Replacing configuration files:");
+
+            for (String file : configuration.list())
+            {
+               Path target = instance.toPath().resolve("etc").resolve(file);
+               getLog().debug("Replacing " + file + " into " + target);
+
+
+               Files.copy(configuration.toPath().resolve(file), target, StandardCopyOption.REPLACE_EXISTING);
+            }
+         }
+
+         File projectLib = project.getArtifact().getFile();
+         copyToLib(projectLib);
+
+         if (libList != null)
+         {
+            for (int i = 0; i < libList.length; i++)
+            {
+               String[] splitString = libList[i].split(":");
+
+               getLog().debug("********************" + splitString[0] + "/" + splitString[1] + "/" + splitString[2]);
+
+               Artifact artifact;
+               try
+               {
+                  artifact = new DefaultArtifact( libList[i] );
+               }
+               catch ( IllegalArgumentException e )
+               {
+                  throw new MojoFailureException( e.getMessage(), e );
+               }
+
+               ArtifactRequest request = new ArtifactRequest();
+               request.setArtifact( artifact );
+               request.setRepositories( remoteRepos );
+
+               getLog().debug("Resolving artifact " + artifact + " from " + remoteRepos);
+
+               ArtifactResult result;
+               try
+               {
+                  result = repositorySystem.resolveArtifact( repoSession, request );
+               }
+               catch ( ArtifactResolutionException e )
+               {
+                  throw new MojoExecutionException( e.getMessage(), e );
+               }
+
+               File artifactFile = result.getArtifact().getFile();
+
+               getLog().debug("Artifact:: " + artifact + " file = " + artifactFile);
+
+               copyToLib(artifactFile);
+
+            }
+         }
+
+      }
+      catch (Exception e)
+      {
+         getLog().error(e);
+         throw new MojoFailureException(e.getMessage());
+      }
+   }
+
+   private void copyToLib(File projectLib) throws IOException
+   {
+      Path target = instance.toPath().resolve("lib").resolve(projectLib.getName());
+      target.toFile().mkdirs();
+      getLog().debug("Copying " + projectLib.getName() + " as " + target.toFile().getAbsolutePath());
+      Files.copy(projectLib.toPath(), target, StandardCopyOption.REPLACE_EXISTING);
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/ActiveMQStartPlugin.java
----------------------------------------------------------------------
diff --git a/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/ActiveMQStartPlugin.java b/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/ActiveMQStartPlugin.java
deleted file mode 100644
index 6a7ca64..0000000
--- a/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/ActiveMQStartPlugin.java
+++ /dev/null
@@ -1,230 +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.
- */
-package org.apache.activemq.artemis.maven;
-
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-import java.io.File;
-import java.lang.management.ManagementFactory;
-import java.util.Arrays;
-import java.util.Properties;
-
-import org.apache.activemq.artemis.server.ActiveMQBootstrap;
-import org.apache.activemq.artemis.server.SpawnedActiveMQBootstrap;
-import org.apache.activemq.artemis.server.SpawnedVMSupport;
-import org.apache.activemq.artemis.spi.core.security.ActiveMQSecurityManager;
-import org.apache.maven.plugin.AbstractMojo;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.MojoFailureException;
-import org.apache.maven.plugin.descriptor.PluginDescriptor;
-import org.apache.maven.plugins.annotations.LifecyclePhase;
-import org.apache.maven.plugins.annotations.Mojo;
-import org.codehaus.classworlds.ClassRealm;
-import org.codehaus.classworlds.ClassWorld;
-
-@Mojo(name = "start", defaultPhase = LifecyclePhase.VERIFY)
-public class ActiveMQStartPlugin extends AbstractMojo
-
-{
-   static final String SKIPBROKERSTART = "skipBrokerStart";
-
-   /**
-    * The plugin descriptor
-    */
-   private PluginDescriptor descriptor;
-
-
-   /**
-    * @parameter default-value=false
-    */
-   private Boolean waitOnStart;
-
-   /**
-    * @parameter
-    */
-   private String configurationDir;
-
-   /**
-    * @parameter
-    */
-   private String nodeId;
-
-   /**
-    * @parameter default-value=false;
-    */
-   private Boolean fork;
-
-   /**
-    * @parameter default-value=false
-    */
-   private Boolean debug;
-
-   /**
-    * @parameter
-    */
-   private Properties systemProperties;
-
-   /**
-    * @parameter default-value=STARTED::
-    */
-   private String serverStartString;
-
-   /**
-    * @parameter
-    */
-   private ActiveMQSecurityManager securityManager;
-
-   /**
-    * registers a TestClusterMBean for test clients to use.
-    */
-   private boolean testClusterManager;
-
-   public void execute() throws MojoExecutionException, MojoFailureException
-   {
-      String property = System.getProperty(SKIPBROKERSTART);
-      if (property != null)
-      {
-         getLog().info("skipping Broker Start");
-         return;
-      }
-      if (testClusterManager)
-      {
-         try
-         {
-            createClusterManagerMBean();
-         }
-         catch (Exception e)
-         {
-            throw new MojoExecutionException("Failed to create cluster manager mbean", e);
-         }
-      }
-
-      if (systemProperties != null && !systemProperties.isEmpty())
-      {
-         System.getProperties()
-            .putAll(systemProperties);
-      }
-
-      String workingPath = new File(".").getAbsolutePath();
-
-      try
-      {
-         registerNode(nodeId, workingPath, configurationDir);
-      }
-      catch (Exception e1)
-      {
-         throw new MojoExecutionException("Failed to create cluster manager mbean", e1);
-      }
-
-      if (fork)
-      {
-         try
-         {
-            PluginDescriptor pd = (PluginDescriptor) getPluginContext().get("pluginDescriptor");
-            final Process p = SpawnedVMSupport.spawnVM(pd.getArtifacts(),
-                                                       "ActiveMQServer_" + (nodeId != null ? nodeId : ""),
-                                                       SpawnedActiveMQBootstrap.class.getName(),
-                                                       systemProperties,
-                                                       true,
-                                                       serverStartString,
-                                                       "FAILED::",
-                                                       ".",
-                                                       configurationDir,
-                                                       debug,
-                                                       configurationDir,
-                                                       "" + waitOnStart,
-                                                       nodeId);
-            Runtime.getRuntime().addShutdownHook(new Thread()
-            {
-               @Override
-               public void run()
-               {
-                  //just to be on the safe side
-                  p.destroy();
-               }
-            });
-            if (waitOnStart)
-            {
-               p.waitFor();
-            }
-         }
-         catch (Throwable e)
-         {
-            e.printStackTrace();
-            throw new MojoExecutionException(e.getMessage());
-         }
-      }
-      else
-      {
-         ActiveMQBootstrap bootstrap = new ActiveMQBootstrap(configurationDir, waitOnStart, nodeId, securityManager);
-         if (configurationDir != null)
-         {
-            extendPluginClasspath(configurationDir);
-         }
-         try
-         {
-            bootstrap.execute();
-         }
-         catch (Exception e)
-         {
-            throw new MojoExecutionException(e.getMessage(), e);
-         }
-      }
-   }
-
-   private void registerNode(String nodeId, String workingPath,
-                             String hornetqConfigurationDir) throws Exception
-   {
-      TestClusterManagerMBean control = PluginUtil.getTestClusterManager();
-      if (control != null)
-      {
-         control.registerNode(nodeId, workingPath, hornetqConfigurationDir);
-      }
-   }
-
-   private void createClusterManagerMBean() throws Exception
-   {
-      MBeanServer mbeanServer = ManagementFactory.getPlatformMBeanServer();
-      ObjectName name = ObjectName.getInstance("hornetq:module=test,type=TestClusterManager");
-      mbeanServer.registerMBean(new TestClusterManager(), name);
-   }
-
-   public void extendPluginClasspath(String element) throws MojoExecutionException
-   {
-      ClassWorld world = new ClassWorld();
-      ClassRealm realm;
-      try
-      {
-         realm = world.newRealm(
-            "maven.plugin." + getClass().getSimpleName() + ((nodeId == null) ? "" : nodeId),
-            Thread.currentThread()
-               .getContextClassLoader()
-         );
-         File elementFile = new File(element);
-         getLog().debug("Adding element to plugin classpath" + elementFile.getPath());
-         realm.addConstituent(elementFile.toURI()
-                                 .toURL());
-      }
-      catch (Exception ex)
-      {
-         throw new MojoExecutionException(ex.toString(), ex);
-      }
-      System.out.println(Arrays.toString(realm.getConstituents()));
-      Thread.currentThread()
-         .setContextClassLoader(realm.getClassLoader());
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/ActiveMQStopPlugin.java
----------------------------------------------------------------------
diff --git a/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/ActiveMQStopPlugin.java b/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/ActiveMQStopPlugin.java
deleted file mode 100644
index 98f7b24..0000000
--- a/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/ActiveMQStopPlugin.java
+++ /dev/null
@@ -1,76 +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.
- */
-package org.apache.activemq.artemis.maven;
-
-import java.io.File;
-import java.io.IOException;
-
-import org.apache.maven.plugin.AbstractMojo;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.MojoFailureException;
-import org.apache.maven.plugins.annotations.LifecyclePhase;
-import org.apache.maven.plugins.annotations.Mojo;
-
-@Mojo(name = "stop", defaultPhase = LifecyclePhase.VERIFY)
-public class ActiveMQStopPlugin extends AbstractMojo
-{
-
-   /**
-    * @parameter
-    */
-   private String configurationDir;
-
-   public void execute() throws MojoExecutionException, MojoFailureException
-   {
-      String property = System.getProperty(ActiveMQStartPlugin.SKIPBROKERSTART);
-      if (property != null)
-      {
-         return;
-      }
-      try
-      {
-         String dirName = configurationDir != null ? configurationDir : ".";
-         final File file = new File(dirName + "/" + "/STOP_ME");
-         file.createNewFile();
-         long time = System.currentTimeMillis();
-         while (System.currentTimeMillis() < time + 60000)
-         {
-            if (!file.exists())
-            {
-               break;
-            }
-            try
-            {
-               Thread.sleep(200);
-            }
-            catch (InterruptedException e)
-            {
-               //ignore
-            }
-         }
-         if (file.exists())
-         {
-            throw new MojoExecutionException("looks like the server hasn't been stopped");
-         }
-      }
-      catch (IOException e)
-      {
-         e.printStackTrace();
-         throw new MojoExecutionException(e.getMessage());
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/ArtemisCLIPlugin.java
----------------------------------------------------------------------
diff --git a/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/ArtemisCLIPlugin.java b/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/ArtemisCLIPlugin.java
new file mode 100644
index 0000000..79aad50
--- /dev/null
+++ b/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/ArtemisCLIPlugin.java
@@ -0,0 +1,172 @@
+/**
+ * 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.
+ */
+package org.apache.activemq.artemis.maven;
+
+import java.io.File;
+import java.nio.file.Files;
+import java.nio.file.LinkOption;
+import java.nio.file.Path;
+import java.util.Map;
+
+import org.apache.activemq.artemis.cli.Artemis;
+import org.apache.activemq.artemis.cli.commands.Run;
+import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugin.descriptor.PluginDescriptor;
+import org.apache.maven.plugins.annotations.LifecyclePhase;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.maven.project.MavenProject;
+
+@Mojo(name = "cli", defaultPhase = LifecyclePhase.VERIFY)
+public class ArtemisCLIPlugin extends AbstractMojo
+
+{
+
+   @Parameter
+   String name;
+
+   /**
+    * The plugin descriptor
+    */
+   private PluginDescriptor descriptor;
+
+   @Parameter(defaultValue = "${activemq.basedir}", required = true)
+   private File home;
+
+   @Parameter(defaultValue = "${activemq.basedir}/artemis-distribution/target/apache-artemis-${project.version}-bin/apache-artemis-${project.version}/", required = true)
+   private File alternateHome;
+
+   @Parameter(defaultValue = "${basedir}/target/server0", required = true)
+   private File location;
+
+   @Parameter
+   private String[] args;
+
+   @Parameter
+   private boolean spawn = false;
+
+   @Parameter
+   private boolean testServer;
+
+
+   /**
+    * Validate if the directory is a artemis.home *
+    *
+    * @param path
+    * @return
+    */
+   private boolean lookupHome(Path path)
+   {
+
+      if (path == null)
+      {
+         return false;
+      }
+
+      Path binFolder = path.resolve("bin");
+
+      if (binFolder == null && Files.exists(binFolder, LinkOption.NOFOLLOW_LINKS))
+      {
+         return false;
+      }
+
+      Path artemisScript = binFolder.resolve("artemis");
+
+
+      return artemisScript != null && Files.exists(artemisScript, LinkOption.NOFOLLOW_LINKS);
+
+
+   }
+
+   public void execute() throws MojoExecutionException, MojoFailureException
+   {
+      // This is to avoid the Run issuing a kill at any point
+      Run.setEmbedded(true);
+
+      MavenProject project = (MavenProject) getPluginContext().get("project");
+
+
+      if (!lookupHome(home.toPath()))
+      {
+         if (lookupHome(alternateHome.toPath()))
+         {
+            home = alternateHome;
+         }
+         else
+         {
+            getLog().error("********************************************************************************************");
+            getLog().error("Could not locate suitable Artemis.home on either " + home + " or " + alternateHome);
+            getLog().error("Use the binary distribution or build the distribution before running the examples");
+            getLog().error("********************************************************************************************");
+
+            throw new MojoExecutionException("Couldn't find artemis.home");
+         }
+      }
+
+      Map properties = getPluginContext();
+
+      try
+      {
+         if (spawn)
+         {
+            final Process process = org.apache.activemq.artemis.cli.process.ProcessBuilder.build("server", location, true, args);
+            Runtime.getRuntime().addShutdownHook(new Thread()
+            {
+               public void run()
+               {
+                  process.destroy();
+               }
+            });
+
+            if (testServer)
+            {
+               for (int tryNr = 0; tryNr < 20; tryNr++)
+               {
+                  try
+                  {
+                     ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory();
+                     cf.createConnection().close();
+                     getLog().info("Server started");
+                  }
+                  catch (Exception e)
+                  {
+                     getLog().info("awaiting server to start");
+                     Thread.sleep(500);
+                     continue;
+                  }
+                  break;
+               }
+            }
+         }
+         else
+         {
+            Artemis.execute(home, location, args);
+         }
+
+         Thread.sleep(600);
+
+         org.apache.activemq.artemis.cli.process.ProcessBuilder.cleanupProcess();
+      }
+      catch (Exception e)
+      {
+         throw new MojoExecutionException(e.getMessage(), e);
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/InVMNodeManagerServer.java
----------------------------------------------------------------------
diff --git a/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/InVMNodeManagerServer.java b/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/InVMNodeManagerServer.java
deleted file mode 100644
index b8b1a67..0000000
--- a/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/InVMNodeManagerServer.java
+++ /dev/null
@@ -1,75 +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.
- */
-package org.apache.activemq.artemis.maven;
-
-import javax.management.MBeanServer;
-
-import java.io.File;
-
-import org.apache.activemq.artemis.core.config.Configuration;
-import org.apache.activemq.artemis.core.server.NodeManager;
-import org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl;
-import org.apache.activemq.artemis.spi.core.security.ActiveMQSecurityManager;
-
-public final class InVMNodeManagerServer extends ActiveMQServerImpl
-{
-   final NodeManager nodeManager;
-
-   public InVMNodeManagerServer(final NodeManager nodeManager)
-   {
-      super();
-      this.nodeManager = nodeManager;
-   }
-
-   public InVMNodeManagerServer(final Configuration configuration, final NodeManager nodeManager)
-   {
-      super(configuration);
-      this.nodeManager = nodeManager;
-   }
-
-   public InVMNodeManagerServer(final Configuration configuration,
-                                final MBeanServer mbeanServer,
-                                final NodeManager nodeManager)
-   {
-      super(configuration, mbeanServer);
-      this.nodeManager = nodeManager;
-   }
-
-   public InVMNodeManagerServer(final Configuration configuration,
-                                final ActiveMQSecurityManager securityManager,
-                                final NodeManager nodeManager)
-   {
-      super(configuration, securityManager);
-      this.nodeManager = nodeManager;
-   }
-
-   public InVMNodeManagerServer(final Configuration configuration,
-                                final MBeanServer mbeanServer,
-                                final ActiveMQSecurityManager securityManager,
-                                final NodeManager nodeManager)
-   {
-      super(configuration, mbeanServer, securityManager);
-      this.nodeManager = nodeManager;
-   }
-
-   @Override
-   protected NodeManager createNodeManager(final File directory, boolean replicatingBackup)
-   {
-      return nodeManager;
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/LibInstallPlugin.java
----------------------------------------------------------------------
diff --git a/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/LibInstallPlugin.java b/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/LibInstallPlugin.java
new file mode 100644
index 0000000..e65108d
--- /dev/null
+++ b/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/LibInstallPlugin.java
@@ -0,0 +1,147 @@
+/**
+ * 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.
+ */
+package org.apache.activemq.artemis.maven;
+
+import java.io.File;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.StandardCopyOption;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugin.descriptor.PluginDescriptor;
+import org.apache.maven.plugins.annotations.Component;
+import org.apache.maven.plugins.annotations.LifecyclePhase;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.maven.project.MavenProject;
+import org.eclipse.aether.RepositorySystem;
+import org.eclipse.aether.RepositorySystemSession;
+import org.eclipse.aether.artifact.Artifact;
+import org.eclipse.aether.artifact.DefaultArtifact;
+import org.eclipse.aether.repository.RemoteRepository;
+import org.eclipse.aether.resolution.ArtifactRequest;
+import org.eclipse.aether.resolution.ArtifactResolutionException;
+import org.eclipse.aether.resolution.ArtifactResult;
+
+@Mojo(name = "lib-install", defaultPhase = LifecyclePhase.VERIFY)
+public class LibInstallPlugin extends AbstractMojo
+
+{
+
+   @Parameter
+   String name;
+
+   /**
+    * The plugin descriptor
+    */
+   private PluginDescriptor descriptor;
+
+   @Parameter(defaultValue = "${basedir}/target/server0", required = true)
+   private File instance;
+
+   @Component
+   private RepositorySystem repositorySystem;
+
+   @Parameter(defaultValue = "${repositorySystemSession}")
+   private RepositorySystemSession repoSession;
+
+   @Parameter(defaultValue = "${project.remoteProjectRepositories}")
+   private List<RemoteRepository> remoteRepos;
+
+
+   @Parameter
+   private String[] libList;
+
+   @Parameter(defaultValue = "${localRepository}")
+   private org.apache.maven.artifact.repository.ArtifactRepository localRepository;
+
+   public void execute() throws MojoExecutionException, MojoFailureException
+   {
+      MavenProject project = (MavenProject) getPluginContext().get("project");
+
+      Map properties = getPluginContext();
+
+      try
+      {
+
+         File projectLib = project.getArtifact().getFile();
+         copyToLib(projectLib);
+
+         if (libList != null)
+         {
+            for (int i = 0; i < libList.length; i++)
+            {
+               String[] splitString = libList[i].split(":");
+
+               getLog().info("********************" + splitString[0] + "/" + splitString[1] + "/" + splitString[2]);
+
+               Artifact artifact;
+               try
+               {
+                  artifact = new DefaultArtifact(libList[i]);
+               }
+               catch (IllegalArgumentException e)
+               {
+                  throw new MojoFailureException(e.getMessage(), e);
+               }
+
+               ArtifactRequest request = new ArtifactRequest();
+               request.setArtifact(artifact);
+               request.setRepositories(remoteRepos);
+
+               getLog().info("Resolving artifact " + artifact + " from " + remoteRepos);
+
+               ArtifactResult result;
+               try
+               {
+                  result = repositorySystem.resolveArtifact(repoSession, request);
+               }
+               catch (ArtifactResolutionException e)
+               {
+                  throw new MojoExecutionException(e.getMessage(), e);
+               }
+
+               File artifactFile = result.getArtifact().getFile();
+
+               getLog().info("Artifact:: " + artifact + " file = " + artifactFile);
+
+               copyToLib(artifactFile);
+
+            }
+         }
+
+      }
+      catch (Exception e)
+      {
+         getLog().error(e);
+         throw new MojoFailureException(e.getMessage());
+      }
+   }
+
+   private void copyToLib(File projectLib) throws IOException
+   {
+      Path target = instance.toPath().resolve("lib").resolve(projectLib.getName());
+      target.toFile().mkdirs();
+      getLog().info("Copying " + projectLib.getName() + " as " + target.toFile().getAbsolutePath());
+      Files.copy(projectLib.toPath(), target, StandardCopyOption.REPLACE_EXISTING);
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/PluginUtil.java
----------------------------------------------------------------------
diff --git a/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/PluginUtil.java b/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/PluginUtil.java
deleted file mode 100644
index a3f3505..0000000
--- a/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/PluginUtil.java
+++ /dev/null
@@ -1,50 +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.
- */
-package org.apache.activemq.artemis.maven;
-
-import javax.management.MBeanServerConnection;
-import javax.management.MBeanServerInvocationHandler;
-import javax.management.ObjectName;
-import javax.management.remote.JMXConnector;
-import javax.management.remote.JMXConnectorFactory;
-import javax.management.remote.JMXServiceURL;
-import java.util.HashMap;
-
-public class PluginUtil
-{
-   public static TestClusterManagerMBean getTestClusterManager()
-   {
-      final String JMX_URL = "service:jmx:rmi:///jndi/rmi://localhost:3000/jmxrmi";
-      try
-      {
-         JMXConnector connector = JMXConnectorFactory.connect(new JMXServiceURL(JMX_URL), new HashMap<String, String>());
-         ObjectName name = ObjectName.getInstance("activemq:module=test,type=TestClusterManager");
-         MBeanServerConnection mbsc = connector.getMBeanServerConnection();
-         TestClusterManagerMBean clusterControl = MBeanServerInvocationHandler.newProxyInstance(mbsc,
-                                                                                                name,
-                                                                                                TestClusterManagerMBean.class,
-                                                                                                false);
-         clusterControl.getNumNodes();//serves as a validation.
-         return clusterControl;
-      }
-      catch (Exception e)
-      {
-         return null;
-      }
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/TestClusterManager.java
----------------------------------------------------------------------
diff --git a/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/TestClusterManager.java b/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/TestClusterManager.java
deleted file mode 100644
index 7f7aced..0000000
--- a/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/TestClusterManager.java
+++ /dev/null
@@ -1,52 +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.
- */
-package org.apache.activemq.artemis.maven;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-public class TestClusterManager implements TestClusterManagerMBean
-{
-   private final List<TestNode> testNodes = new ArrayList<TestNode>();
-
-   @Override
-   public int getNumNodes()
-   {
-      synchronized (testNodes)
-      {
-         return testNodes.size();
-      }
-   }
-
-   @Override
-   public void registerNode(String nodeId, String workingDir,
-                            String hornetqConfigurationDir)
-   {
-      synchronized (testNodes)
-      {
-         testNodes.add(new TestNode(nodeId, workingDir, hornetqConfigurationDir));
-      }
-   }
-
-   @Override
-   public void killNode(int i) throws IOException
-   {
-      TestNode node = testNodes.get(i);
-      node.kill();
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/TestClusterManagerMBean.java
----------------------------------------------------------------------
diff --git a/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/TestClusterManagerMBean.java b/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/TestClusterManagerMBean.java
deleted file mode 100644
index 50b3e8f..0000000
--- a/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/TestClusterManagerMBean.java
+++ /dev/null
@@ -1,29 +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.
- */
-package org.apache.activemq.artemis.maven;
-
-import java.io.IOException;
-
-public interface TestClusterManagerMBean
-{
-   int getNumNodes();
-
-   void registerNode(String nodeId, String workingDir,
-                     String hornetqConfigurationDirt);
-
-   void killNode(int i) throws IOException;
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/TestNode.java
----------------------------------------------------------------------
diff --git a/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/TestNode.java b/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/TestNode.java
deleted file mode 100644
index 1de6a0c..0000000
--- a/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/TestNode.java
+++ /dev/null
@@ -1,49 +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.
- */
-package org.apache.activemq.artemis.maven;
-
-import java.io.File;
-import java.io.IOException;
-
-public class TestNode
-{
-   String nodeId;
-   String workingDir;
-   String configDir;
-
-   public TestNode(String nodeId, String workingDir,
-                   String configDir)
-   {
-      this.nodeId = nodeId;
-      this.workingDir = workingDir;
-      this.configDir = configDir;
-   }
-
-   public void kill() throws IOException
-   {
-      File file = new File(configDir, "KILL_ME");
-      file.createNewFile();
-      try
-      {
-         Thread.sleep(3000);
-      }
-      catch (InterruptedException e)
-      {
-      }
-   }
-
-}


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

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/delayed-redelivery/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/delayed-redelivery/pom.xml b/examples/jms/delayed-redelivery/pom.xml
index 4264468..764efda 100644
--- a/examples/jms/delayed-redelivery/pom.xml
+++ b/examples/jms/delayed-redelivery/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>
@@ -61,9 +56,18 @@ under the License.
                         <goals>
                            <goal>create</goal>
                         </goals>
+                     </execution>
+                     <execution>
+                        <id>start</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
                         <configuration>
-                           <instance>${basedir}/target/server0</instance>
-                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                           <spawn>true</spawn>
+                           <testURI>tcp://localhost:61616</testURI>
+                           <args>
+                              <param>run</param>
+                           </args>
                         </configuration>
                      </execution>
                      <execution>
@@ -73,8 +77,16 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.DelayedRedeliveryExample</clientClass>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>stop</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
                            <args>
-                              <param>${basedir}/target/server0</param>
+                              <param>stop</param>
                            </args>
                         </configuration>
                      </execution>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/delayed-redelivery/src/main/java/org/apache/activemq/artemis/jms/example/DelayedRedeliveryExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/delayed-redelivery/src/main/java/org/apache/activemq/artemis/jms/example/DelayedRedeliveryExample.java b/examples/jms/delayed-redelivery/src/main/java/org/apache/activemq/artemis/jms/example/DelayedRedeliveryExample.java
index 54e3b53..6a2d15d 100644
--- a/examples/jms/delayed-redelivery/src/main/java/org/apache/activemq/artemis/jms/example/DelayedRedeliveryExample.java
+++ b/examples/jms/delayed-redelivery/src/main/java/org/apache/activemq/artemis/jms/example/DelayedRedeliveryExample.java
@@ -25,23 +25,15 @@ import javax.jms.Session;
 import javax.jms.TextMessage;
 import javax.naming.InitialContext;
 
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
-
 /**
  * This example demonstrates how ActiveMQ Artemis can be configured with a redelivery delay in the event a message
  * is redelivered.
  *
  * Please see the readme.html for more information
  */
-public class DelayedRedeliveryExample extends ActiveMQExample
+public class DelayedRedeliveryExample
 {
-   public static void main(final String[] args)
-   {
-      new DelayedRedeliveryExample().run(args);
-   }
-
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(final String[] args) throws Exception
    {
       Connection connection = null;
       InitialContext initialContext = null;
@@ -96,7 +88,7 @@ public class DelayedRedeliveryExample extends ActiveMQExample
 
          if (messageReceived != null)
          {
-            return false;
+            throw new IllegalStateException("Expected to recieve message.");
          }
 
          System.out.println("Redelivery has been delayed so received message is " + messageReceived);
@@ -118,13 +110,11 @@ public class DelayedRedeliveryExample extends ActiveMQExample
          long end = System.currentTimeMillis();
 
          System.out.println("3nd delivery from " + queue.getQueueName() +
-                            ": " +
-                            messageReceived.getText() +
-                            " after " +
-                            (end - start) +
-                            " milliseconds.");
-
-         return true;
+                                    ": " +
+                                    messageReceived.getText() +
+                                    " after " +
+                                    (end - start) +
+                                    " milliseconds.");
       }
       finally
       {
@@ -139,5 +129,4 @@ public class DelayedRedeliveryExample extends ActiveMQExample
          }
       }
    }
-
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/delayed-redelivery/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/delayed-redelivery/src/main/resources/activemq/server0/broker.xml b/examples/jms/delayed-redelivery/src/main/resources/activemq/server0/broker.xml
index d23db3d..3e41664 100644
--- a/examples/jms/delayed-redelivery/src/main/resources/activemq/server0/broker.xml
+++ b/examples/jms/delayed-redelivery/src/main/resources/activemq/server0/broker.xml
@@ -32,13 +32,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
+      <bindings-directory>${data.dir:../data}/bindings</bindings-directory>
 
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
+      <journal-directory>${data.dir:../data}/journal</journal-directory>
 
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
+      <large-messages-directory>${data.dir:../data}/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
+      <paging-directory>${data.dir:../data}/paging</paging-directory>
 
       <!-- Acceptors -->
       <acceptors>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/divert/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/divert/pom.xml b/examples/jms/divert/pom.xml
index 260569e..46dfbc6 100644
--- a/examples/jms/divert/pom.xml
+++ b/examples/jms/divert/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.activemq</groupId>
          <artifactId>artemis-server</artifactId>
          <version>${project.version}</version>
@@ -62,7 +57,7 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>create</id>
+                        <id>create0</id>
                         <goals>
                            <goal>create</goal>
                         </goals>
@@ -72,7 +67,7 @@ under the License.
                         </configuration>
                      </execution>
                      <execution>
-                        <id>create2</id>
+                        <id>create1</id>
                         <goals>
                            <goal>create</goal>
                         </goals>
@@ -82,15 +77,64 @@ under the License.
                         </configuration>
                      </execution>
                      <execution>
+                        <id>start0</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
+                           <spawn>true</spawn>
+                           <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.DivertExample</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>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/divert/src/main/java/org/apache/activemq/artemis/jms/example/DivertExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/divert/src/main/java/org/apache/activemq/artemis/jms/example/DivertExample.java b/examples/jms/divert/src/main/java/org/apache/activemq/artemis/jms/example/DivertExample.java
index 503aadd..9cbaaa6 100644
--- a/examples/jms/divert/src/main/java/org/apache/activemq/artemis/jms/example/DivertExample.java
+++ b/examples/jms/divert/src/main/java/org/apache/activemq/artemis/jms/example/DivertExample.java
@@ -28,23 +28,15 @@ import javax.jms.Topic;
 import javax.naming.InitialContext;
 import java.util.Hashtable;
 
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
-
 /**
  * This examples demonstrates the use of ActiveMQ Artemis "Diverts" to transparently divert or copy messages
  * from one address to another.
  *
  * Please see the readme.html for more information.
  */
-public class DivertExample extends ActiveMQExample
+public class DivertExample
 {
-   public static void main(final String[] args)
-   {
-      new DivertExample().run(args);
-   }
-
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(final String[] args) throws Exception
    {
       Connection connectionLondon = null;
 
@@ -58,7 +50,7 @@ public class DivertExample extends ActiveMQExample
          // Step 1. Create an initial context to perform the JNDI lookup on the London server
          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/orders", "orders");
          properties.put("topic.topic/priceUpdates", "priceUpdates");
          properties.put("topic.topic/spyTopic", "spyTopic");
@@ -77,7 +69,7 @@ public class DivertExample extends ActiveMQExample
          // Step 6. Create an initial context to perform the JNDI lookup on the New York server
          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.ConnectionFactory2", "tcp://localhost:61617");
          properties.put("topic.topic/newYorkPriceUpdates", "newYorkPriceUpdates");
          initialContextNewYork = new InitialContext(properties);
 
@@ -94,7 +86,7 @@ public class DivertExample extends ActiveMQExample
          ConnectionFactory cfLondon = (ConnectionFactory)initialContextLondon.lookup("ConnectionFactory");
 
          // Step 9. Perform a lookup on the Connection Factory on the New York server
-         ConnectionFactory cfNewYork = (ConnectionFactory)initialContextNewYork.lookup("ConnectionFactory");
+         ConnectionFactory cfNewYork = (ConnectionFactory)initialContextNewYork.lookup("ConnectionFactory2");
 
          // Step 10. Create a JMS Connection on the London server
          connectionLondon = cfLondon.createConnection();
@@ -181,7 +173,7 @@ public class DivertExample extends ActiveMQExample
 
          if (priceUpdate1 != null)
          {
-            return false;
+            throw new IllegalStateException("Message is not null");
          }
 
          System.out.println("Did not received price update in New York, look it's: " + priceUpdate1);
@@ -190,7 +182,7 @@ public class DivertExample extends ActiveMQExample
 
          if (priceUpdate2 != null)
          {
-            return false;
+            throw new IllegalStateException("Message is not null");
          }
 
          System.out.println("Did not received price update in New York, look it's: " + priceUpdate2);
@@ -211,7 +203,7 @@ public class DivertExample extends ActiveMQExample
 
          if (message != null)
          {
-            return false;
+            throw new IllegalStateException("Message is not null");
          }
 
          System.out.println("Didn't receive local price update, look, it's: " + message);
@@ -231,8 +223,6 @@ public class DivertExample extends ActiveMQExample
 
          System.out.println("Received forwarded price update on server 2: " + priceUpdate2.getText());
          System.out.println("Time of forward: " + priceUpdate2.getLongProperty("time_of_forward"));
-
-         return true;
       }
       finally
       {
@@ -255,5 +245,4 @@ public class DivertExample extends ActiveMQExample
          }
       }
    }
-
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/divert/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/divert/src/main/resources/activemq/server0/broker.xml b/examples/jms/divert/src/main/resources/activemq/server0/broker.xml
index 7c25065..7ce362a 100644
--- a/examples/jms/divert/src/main/resources/activemq/server0/broker.xml
+++ b/examples/jms/divert/src/main/resources/activemq/server0/broker.xml
@@ -40,16 +40,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
-      <!-- We need to make it clustered otherwise the bridge won't deploy -->
+      <bindings-directory>${data.dir:../data}/bindings</bindings-directory>
 
+      <journal-directory>${data.dir:../data}/journal</journal-directory>
 
-      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
+      <large-messages-directory>${data.dir:../data}/largemessages</large-messages-directory>
 
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-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/divert/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/divert/src/main/resources/activemq/server1/broker.xml b/examples/jms/divert/src/main/resources/activemq/server1/broker.xml
index d624897..315d13b 100644
--- a/examples/jms/divert/src/main/resources/activemq/server1/broker.xml
+++ b/examples/jms/divert/src/main/resources/activemq/server1/broker.xml
@@ -32,13 +32,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>${data.dir}/server1/data/messaging/bindings</bindings-directory>
+      <bindings-directory>${data.dir:../data}/bindings</bindings-directory>
 
-      <journal-directory>${data.dir}/server1/data/messaging/journal</journal-directory>
+      <journal-directory>${data.dir:../data}/journal</journal-directory>
 
-      <large-messages-directory>${data.dir}/server1/data/messaging/largemessages</large-messages-directory>
+      <large-messages-directory>${data.dir:../data}/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir}/server1/data/messaging/paging</paging-directory>
+      <paging-directory>${data.dir:../data}/paging</paging-directory>
 
       <!-- Acceptors -->
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/durable-subscription/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/durable-subscription/pom.xml b/examples/jms/durable-subscription/pom.xml
index 1d408de..9571cd8 100644
--- a/examples/jms/durable-subscription/pom.xml
+++ b/examples/jms/durable-subscription/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>
@@ -61,9 +56,18 @@ under the License.
                         <goals>
                            <goal>create</goal>
                         </goals>
+                     </execution>
+                     <execution>
+                        <id>start</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
                         <configuration>
-                           <instance>${basedir}/target/server0</instance>
-                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                           <spawn>true</spawn>
+                           <testURI>tcp://localhost:61616</testURI>
+                           <args>
+                              <param>run</param>
+                           </args>
                         </configuration>
                      </execution>
                      <execution>
@@ -73,8 +77,16 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.DurableSubscriptionExample</clientClass>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>stop</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
                            <args>
-                              <param>${basedir}/target/server0</param>
+                              <param>stop</param>
                            </args>
                         </configuration>
                      </execution>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/durable-subscription/src/main/java/org/apache/activemq/artemis/jms/example/DurableSubscriptionExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/durable-subscription/src/main/java/org/apache/activemq/artemis/jms/example/DurableSubscriptionExample.java b/examples/jms/durable-subscription/src/main/java/org/apache/activemq/artemis/jms/example/DurableSubscriptionExample.java
index c40cc69..2a8eabf 100644
--- a/examples/jms/durable-subscription/src/main/java/org/apache/activemq/artemis/jms/example/DurableSubscriptionExample.java
+++ b/examples/jms/durable-subscription/src/main/java/org/apache/activemq/artemis/jms/example/DurableSubscriptionExample.java
@@ -25,20 +25,12 @@ import javax.jms.Topic;
 import javax.jms.TopicSubscriber;
 import javax.naming.InitialContext;
 
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
-
 /**
  * A simple JMS example that shows how to use a durable subscription.
  */
-public class DurableSubscriptionExample extends ActiveMQExample
+public class DurableSubscriptionExample
 {
-   public static void main(final String[] args)
-   {
-      new DurableSubscriptionExample().run(args);
-   }
-
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(final String[] args) throws Exception
    {
       Connection connection = null;
       InitialContext initialContext = null;
@@ -111,8 +103,6 @@ public class DurableSubscriptionExample extends ActiveMQExample
 
          // Step 18. Delete the durable subscription
          session.unsubscribe("subscriber-1");
-
-         return true;
       }
       finally
       {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/durable-subscription/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/durable-subscription/src/main/resources/activemq/server0/broker.xml b/examples/jms/durable-subscription/src/main/resources/activemq/server0/broker.xml
index 6b661e4..2b2ba2e 100644
--- a/examples/jms/durable-subscription/src/main/resources/activemq/server0/broker.xml
+++ b/examples/jms/durable-subscription/src/main/resources/activemq/server0/broker.xml
@@ -29,13 +29,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
+      <bindings-directory>${data.dir:../data}/bindings</bindings-directory>
 
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
+      <journal-directory>${data.dir:../data}/journal</journal-directory>
 
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
+      <large-messages-directory>${data.dir:../data}/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
+      <paging-directory>${data.dir:../data}/paging</paging-directory>
 
       <!-- Acceptors -->
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/embedded-simple/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/embedded-simple/pom.xml b/examples/jms/embedded-simple/pom.xml
index 9836ff6..a1dae09 100644
--- a/examples/jms/embedded-simple/pom.xml
+++ b/examples/jms/embedded-simple/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.activemq</groupId>
          <artifactId>artemis-server</artifactId>
          <version>${project.version}</version>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/embedded-simple/src/main/java/org/apache/activemq/artemis/jms/example/EmbeddedExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/embedded-simple/src/main/java/org/apache/activemq/artemis/jms/example/EmbeddedExample.java b/examples/jms/embedded-simple/src/main/java/org/apache/activemq/artemis/jms/example/EmbeddedExample.java
index c148dca..2bf15a2 100644
--- a/examples/jms/embedded-simple/src/main/java/org/apache/activemq/artemis/jms/example/EmbeddedExample.java
+++ b/examples/jms/embedded-simple/src/main/java/org/apache/activemq/artemis/jms/example/EmbeddedExample.java
@@ -16,6 +16,12 @@
  */
 package org.apache.activemq.artemis.jms.example;
 
+import org.apache.activemq.artemis.api.jms.JMSFactoryType;
+import org.apache.activemq.artemis.core.config.impl.SecurityConfiguration;
+import org.apache.activemq.artemis.jms.server.JMSServerManager;
+import org.apache.activemq.artemis.jms.server.embedded.EmbeddedJMS;
+import org.apache.activemq.artemis.spi.core.security.ActiveMQSecurityManagerImpl;
+
 import javax.jms.Connection;
 import javax.jms.ConnectionFactory;
 import javax.jms.MessageConsumer;
@@ -27,81 +33,58 @@ import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
 
-import org.apache.activemq.artemis.api.jms.JMSFactoryType;
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
-import org.apache.activemq.artemis.core.config.impl.SecurityConfiguration;
-import org.apache.activemq.artemis.jms.server.JMSServerManager;
-import org.apache.activemq.artemis.jms.server.embedded.EmbeddedJMS;
-import org.apache.activemq.artemis.spi.core.security.ActiveMQSecurityManagerImpl;
-
 /**
  * This example demonstrates how to run an ActiveMQ Artemis embedded with JMS
  */
-public class EmbeddedExample extends ActiveMQExample
+public class EmbeddedExample
 {
-
    public static void main(final String[] args) throws Exception
    {
-      new EmbeddedExample().runExample();
-   }
+      EmbeddedJMS jmsServer = new EmbeddedJMS();
 
-   @Override
-   public boolean runExample() throws Exception
-   {
-      try
-      {
-         EmbeddedJMS jmsServer = new EmbeddedJMS();
+      SecurityConfiguration securityConfig = new SecurityConfiguration();
+      securityConfig.addUser("guest", "guest");
+      securityConfig.addRole("guest", "guest");
+      securityConfig.setDefaultUser("guest");
+      jmsServer.setSecurityManager(new ActiveMQSecurityManagerImpl(securityConfig));
 
-         SecurityConfiguration securityConfig = new SecurityConfiguration();
-         securityConfig.addUser("guest", "guest");
-         securityConfig.addRole("guest", "guest");
-         securityConfig.setDefaultUser("guest");
-         jmsServer.setSecurityManager(new ActiveMQSecurityManagerImpl(securityConfig));
+      jmsServer.start();
+      System.out.println("Started Embedded JMS Server");
 
-         jmsServer.start();
-         System.out.println("Started Embedded JMS Server");
+      JMSServerManager jmsServerManager = jmsServer.getJMSServerManager();
+      List<String> connectors = new ArrayList<String>();
+      connectors.add("in-vm");
+      jmsServerManager.createConnectionFactory("ConnectionFactory", false, JMSFactoryType.CF, connectors, "ConnectionFactory");
+      jmsServerManager.createQueue(false, "exampleQueue", null, false, "queue/exampleQueue");
 
-         JMSServerManager jmsServerManager = jmsServer.getJMSServerManager();
-         List<String> connectors = new ArrayList<String>();
-         connectors.add("in-vm");
-         jmsServerManager.createConnectionFactory("ConnectionFactory", false, JMSFactoryType.CF, connectors, "ConnectionFactory");
-         jmsServerManager.createQueue(false, "exampleQueue", null, false, "queue/exampleQueue");
+      ConnectionFactory cf = (ConnectionFactory) jmsServer.lookup("ConnectionFactory");
+      Queue queue = (Queue) jmsServer.lookup("queue/exampleQueue");
 
-         ConnectionFactory cf = (ConnectionFactory)jmsServer.lookup("ConnectionFactory");
-         Queue queue = (Queue)jmsServer.lookup("queue/exampleQueue");
-
-         // Step 10. Send and receive a message using JMS API
-         Connection connection = null;
-         try
+      // Step 10. Send and receive a message using JMS API
+      Connection connection = null;
+      try
+      {
+         connection = cf.createConnection();
+         Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+         MessageProducer producer = session.createProducer(queue);
+         TextMessage message = session.createTextMessage("Hello sent at " + new Date());
+         System.out.println("Sending message: " + message.getText());
+         producer.send(message);
+         MessageConsumer messageConsumer = session.createConsumer(queue);
+         connection.start();
+         TextMessage messageReceived = (TextMessage) messageConsumer.receive(1000);
+         System.out.println("Received message:" + messageReceived.getText());
+      }
+      finally
+      {
+         if (connection != null)
          {
-            connection = cf.createConnection();
-            Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-            MessageProducer producer = session.createProducer(queue);
-            TextMessage message = session.createTextMessage("Hello sent at " + new Date());
-            System.out.println("Sending message: " + message.getText());
-            producer.send(message);
-            MessageConsumer messageConsumer = session.createConsumer(queue);
-            connection.start();
-            TextMessage messageReceived = (TextMessage)messageConsumer.receive(1000);
-            System.out.println("Received message:" + messageReceived.getText());
+            connection.close();
          }
-         finally
-         {
-            if (connection != null)
-            {
-               connection.close();
-            }
 
-            // Step 11. Stop the JMS server
-            jmsServer.stop();
-            System.out.println("Stopped the JMS Server");
-         }
-      }
-      catch (Exception e)
-      {
-         e.printStackTrace();
-         return false;
+         // Step 11. Stop the JMS server
+         jmsServer.stop();
+         System.out.println("Stopped the JMS Server");
       }
-      return true;
    }
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/embedded/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/embedded/pom.xml b/examples/jms/embedded/pom.xml
index e39c4a4..8d81f45 100644
--- a/examples/jms/embedded/pom.xml
+++ b/examples/jms/embedded/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.activemq</groupId>
          <artifactId>artemis-server</artifactId>
          <version>${project.version}</version>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/embedded/src/main/java/org/apache/activemq/artemis/jms/example/EmbeddedExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/embedded/src/main/java/org/apache/activemq/artemis/jms/example/EmbeddedExample.java b/examples/jms/embedded/src/main/java/org/apache/activemq/artemis/jms/example/EmbeddedExample.java
index 0c029ad..2a97c0f 100644
--- a/examples/jms/embedded/src/main/java/org/apache/activemq/artemis/jms/example/EmbeddedExample.java
+++ b/examples/jms/embedded/src/main/java/org/apache/activemq/artemis/jms/example/EmbeddedExample.java
@@ -27,7 +27,6 @@ import java.util.ArrayList;
 import java.util.Date;
 
 import org.apache.activemq.artemis.api.core.TransportConfiguration;
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
 import org.apache.activemq.artemis.core.config.Configuration;
 import org.apache.activemq.artemis.core.config.impl.ConfigurationImpl;
 import org.apache.activemq.artemis.core.remoting.impl.netty.NettyAcceptorFactory;
@@ -43,95 +42,78 @@ import org.apache.activemq.artemis.jms.server.embedded.EmbeddedJMS;
 /**
  * This example demonstrates how to run an ActiveMQ Artemis embedded with JMS
  */
-public final class EmbeddedExample extends ActiveMQExample
+public final class EmbeddedExample
 {
 
    public static void main(final String[] args) throws Exception
    {
-      new EmbeddedExample().runExample();
-   }
-
-   @Override
-   public boolean runExample() throws Exception
-   {
+      // Step 1. Create ActiveMQ Artemis core configuration, and set the properties accordingly
+      Configuration configuration = new ConfigurationImpl();
+      configuration.setPersistenceEnabled(false);
+      configuration.setJournalDirectory("target/data/journal");
+      configuration.setSecurityEnabled(false);
+      configuration.getAcceptorConfigurations().add(new TransportConfiguration(NettyAcceptorFactory.class.getName()));
+
+      TransportConfiguration connectorConfig = new TransportConfiguration(NettyConnectorFactory.class.getName());
+
+      configuration.getConnectorConfigurations().put("connector", connectorConfig);
+
+
+      // Step 2. Create the JMS configuration
+      JMSConfiguration jmsConfig = new JMSConfigurationImpl();
+
+      // Step 3. Configure the JMS ConnectionFactory
+      ArrayList<String> connectorNames = new ArrayList<String>();
+      connectorNames.add("connector");
+      ConnectionFactoryConfiguration cfConfig = new ConnectionFactoryConfigurationImpl()
+              .setName("cf")
+              .setConnectorNames(connectorNames)
+              .setBindings("cf");
+      jmsConfig.getConnectionFactoryConfigurations().add(cfConfig);
+
+      // Step 4. Configure the JMS Queue
+      JMSQueueConfiguration queueConfig = new JMSQueueConfigurationImpl()
+              .setName("queue1")
+              .setDurable(false)
+              .setBindings("queue/queue1");
+      jmsConfig.getQueueConfigurations().add(queueConfig);
+
+      // Step 5. Start the JMS Server using the ActiveMQ Artemis core server and the JMS configuration
+      EmbeddedJMS jmsServer = new EmbeddedJMS();
+      jmsServer.setConfiguration(configuration);
+      jmsServer.setJmsConfiguration(jmsConfig);
+      jmsServer.start();
+      System.out.println("Started Embedded JMS Server");
+
+      // Step 6. Lookup JMS resources defined in the configuration
+      ConnectionFactory cf = (ConnectionFactory) jmsServer.lookup("cf");
+      Queue queue = (Queue) jmsServer.lookup("queue/queue1");
+
+      // Step 7. Send and receive a message using JMS API
+      Connection connection = null;
       try
       {
-
-         // Step 1. Create ActiveMQ Artemis core configuration, and set the properties accordingly
-         Configuration configuration = new ConfigurationImpl();
-         configuration.setPersistenceEnabled(false);
-         configuration.setJournalDirectory("target/data/journal");
-         configuration.setSecurityEnabled(false);
-         configuration.getAcceptorConfigurations()
-                      .add(new TransportConfiguration(NettyAcceptorFactory.class.getName()));
-
-         TransportConfiguration connectorConfig = new TransportConfiguration(NettyConnectorFactory.class.getName());
-
-         configuration.getConnectorConfigurations().put("connector", connectorConfig);
-
-
-         // Step 2. Create the JMS configuration
-         JMSConfiguration jmsConfig = new JMSConfigurationImpl();
-
-         // Step 3. Configure the JMS ConnectionFactory
-         ArrayList<String> connectorNames = new ArrayList<String>();
-         connectorNames.add("connector");
-         ConnectionFactoryConfiguration cfConfig = new ConnectionFactoryConfigurationImpl()
-            .setName("cf")
-            .setConnectorNames(connectorNames)
-            .setBindings("cf");
-         jmsConfig.getConnectionFactoryConfigurations().add(cfConfig);
-
-         // Step 4. Configure the JMS Queue
-         JMSQueueConfiguration queueConfig = new JMSQueueConfigurationImpl()
-            .setName("queue1")
-            .setDurable(false)
-            .setBindings("queue/queue1");
-         jmsConfig.getQueueConfigurations().add(queueConfig);
-
-         // Step 5. Start the JMS Server using the ActiveMQ Artemis core server and the JMS configuration
-         EmbeddedJMS jmsServer = new EmbeddedJMS();
-         jmsServer.setConfiguration(configuration);
-         jmsServer.setJmsConfiguration(jmsConfig);
-         jmsServer.start();
-         System.out.println("Started Embedded JMS Server");
-
-         // Step 6. Lookup JMS resources defined in the configuration
-         ConnectionFactory cf = (ConnectionFactory)jmsServer.lookup("cf");
-         Queue queue = (Queue)jmsServer.lookup("queue/queue1");
-
-         // Step 7. Send and receive a message using JMS API
-         Connection connection = null;
-         try
+         connection = cf.createConnection();
+         Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+         MessageProducer producer = session.createProducer(queue);
+         TextMessage message = session.createTextMessage("Hello sent at " + new Date());
+         System.out.println("Sending message: " + message.getText());
+         producer.send(message);
+         MessageConsumer messageConsumer = session.createConsumer(queue);
+         connection.start();
+         TextMessage messageReceived = (TextMessage) messageConsumer.receive(1000);
+         System.out.println("Received message:" + messageReceived.getText());
+      }
+      finally
+      {
+         if (connection != null)
          {
-            connection = cf.createConnection();
-            Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-            MessageProducer producer = session.createProducer(queue);
-            TextMessage message = session.createTextMessage("Hello sent at " + new Date());
-            System.out.println("Sending message: " + message.getText());
-            producer.send(message);
-            MessageConsumer messageConsumer = session.createConsumer(queue);
-            connection.start();
-            TextMessage messageReceived = (TextMessage)messageConsumer.receive(1000);
-            System.out.println("Received message:" + messageReceived.getText());
+            connection.close();
          }
-         finally
-         {
-            if (connection != null)
-            {
-               connection.close();
-            }
 
-            // Step 11. Stop the JMS server
-            jmsServer.stop();
-            System.out.println("Stopped the JMS Server");
-         }
-      }
-      catch (Exception e)
-      {
-         e.printStackTrace();
-         return false;
+         // Step 11. Stop the JMS server
+         jmsServer.stop();
+         System.out.println("Stopped the JMS Server");
       }
-      return true;
    }
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/expiry/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/expiry/pom.xml b/examples/jms/expiry/pom.xml
index 6133af4..9c53999 100644
--- a/examples/jms/expiry/pom.xml
+++ b/examples/jms/expiry/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>
@@ -61,9 +56,18 @@ under the License.
                         <goals>
                            <goal>create</goal>
                         </goals>
+                     </execution>
+                     <execution>
+                        <id>start</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
                         <configuration>
-                           <instance>${basedir}/target/server0</instance>
-                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                           <spawn>true</spawn>
+                           <testURI>tcp://localhost:61616</testURI>
+                           <args>
+                              <param>run</param>
+                           </args>
                         </configuration>
                      </execution>
                      <execution>
@@ -73,8 +77,16 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.ExpiryExample</clientClass>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>stop</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
                            <args>
-                              <param>${basedir}/target/server0</param>
+                              <param>stop</param>
                            </args>
                         </configuration>
                      </execution>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/expiry/src/main/java/org/apache/activemq/artemis/jms/example/ExpiryExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/expiry/src/main/java/org/apache/activemq/artemis/jms/example/ExpiryExample.java b/examples/jms/expiry/src/main/java/org/apache/activemq/artemis/jms/example/ExpiryExample.java
index 026458c..dfb4324 100644
--- a/examples/jms/expiry/src/main/java/org/apache/activemq/artemis/jms/example/ExpiryExample.java
+++ b/examples/jms/expiry/src/main/java/org/apache/activemq/artemis/jms/example/ExpiryExample.java
@@ -25,20 +25,12 @@ import javax.jms.Session;
 import javax.jms.TextMessage;
 import javax.naming.InitialContext;
 
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
-
 /**
  * An example showing how messages are moved to an expiry queue when they expire.
  */
-public class ExpiryExample extends ActiveMQExample
+public class ExpiryExample
 {
-   public static void main(final String[] args)
-   {
-      new ExpiryExample().run(args);
-   }
-
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(final String[] args) throws Exception
    {
       Connection connection = null;
       InitialContext initialContext = null;
@@ -116,8 +108,6 @@ public class ExpiryExample extends ActiveMQExample
          System.out.println("*Origin destination* of the expired message: " + messageReceived.getStringProperty("_AMQ_ORIG_ADDRESS"));
          // Step 21. the actual expiration time is stored in the _AMQ_ACTUAL_EXPIRY property
          System.out.println("*Actual expiration time* of the expired message: " + messageReceived.getLongProperty("_AMQ_ACTUAL_EXPIRY"));
-
-         return true;
       }
       finally
       {
@@ -132,5 +122,4 @@ public class ExpiryExample extends ActiveMQExample
          }
       }
    }
-
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/expiry/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/expiry/src/main/resources/activemq/server0/broker.xml b/examples/jms/expiry/src/main/resources/activemq/server0/broker.xml
index 3333732..4907097 100644
--- a/examples/jms/expiry/src/main/resources/activemq/server0/broker.xml
+++ b/examples/jms/expiry/src/main/resources/activemq/server0/broker.xml
@@ -32,13 +32,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
+      <bindings-directory>${data.dir:../data}/bindings</bindings-directory>
 
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
+      <journal-directory>${data.dir:../data}/journal</journal-directory>
 
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
+      <large-messages-directory>${data.dir:../data}/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
+      <paging-directory>${data.dir:../data}/paging</paging-directory>
 
       <!-- Acceptors -->
       <acceptors>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/ha-policy-autobackup/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/ha-policy-autobackup/pom.xml b/examples/jms/ha-policy-autobackup/pom.xml
index 649adf0..cace530 100644
--- a/examples/jms/ha-policy-autobackup/pom.xml
+++ b/examples/jms/ha-policy-autobackup/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>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/ha-policy-autobackup/src/main/java/org/apache/activemq/artemis/jms/example/HAPolicyAutoBackupExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/ha-policy-autobackup/src/main/java/org/apache/activemq/artemis/jms/example/HAPolicyAutoBackupExample.java b/examples/jms/ha-policy-autobackup/src/main/java/org/apache/activemq/artemis/jms/example/HAPolicyAutoBackupExample.java
index 10f858f..d561750 100644
--- a/examples/jms/ha-policy-autobackup/src/main/java/org/apache/activemq/artemis/jms/example/HAPolicyAutoBackupExample.java
+++ b/examples/jms/ha-policy-autobackup/src/main/java/org/apache/activemq/artemis/jms/example/HAPolicyAutoBackupExample.java
@@ -16,6 +16,12 @@
  */
 package org.apache.activemq.artemis.jms.example;
 
+import org.apache.activemq.artemis.api.core.TransportConfiguration;
+import org.apache.activemq.artemis.api.core.client.ClusterTopologyListener;
+import org.apache.activemq.artemis.api.core.client.TopologyMember;
+import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
+import org.apache.activemq.artemis.util.ServerUtil;
+
 import javax.jms.Connection;
 import javax.jms.ConnectionFactory;
 import javax.jms.MessageConsumer;
@@ -30,26 +36,17 @@ import java.util.List;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 
-import org.apache.activemq.artemis.api.core.TransportConfiguration;
-import org.apache.activemq.artemis.api.core.client.ClusterTopologyListener;
-import org.apache.activemq.artemis.api.core.client.TopologyMember;
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
-import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
-
 /**
  * A simple example that demonstrates server side load-balancing of messages between the queue instances on different
  * nodes of the cluster.
- *
  */
-public class HAPolicyAutoBackupExample extends ActiveMQExample
+public class HAPolicyAutoBackupExample
 {
-   public static void main(final String[] args) throws Exception
-   {
-      new HAPolicyAutoBackupExample().run(args);
-   }
+   private static Process server0;
 
-   @Override
-   public boolean runExample() throws Exception
+   private static Process server1;
+
+   public static void main(final String[] args) throws Exception
    {
       Connection connection0 = null;
 
@@ -61,16 +58,19 @@ public class HAPolicyAutoBackupExample extends ActiveMQExample
 
       try
       {
+         server0 = ServerUtil.startServer(args[0], HAPolicyAutoBackupExample.class.getSimpleName() + "0", 0, 5000);
+         server1 = ServerUtil.startServer(args[1], HAPolicyAutoBackupExample.class.getSimpleName() + "1", 1, 5000);
+
          // Step 1. Get an initial context for looking up JNDI from server 0 and 1
          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 + "?ha=true&retryInterval=1000&retryIntervalMultiplier=1.0&reconnectAttempts=-1");
+         properties.put("connectionFactory.ConnectionFactory", "tcp://localhost:61616?ha=true&retryInterval=1000&retryIntervalMultiplier=1.0&reconnectAttempts=-1");
          properties.put("queue.queue/exampleQueue", "exampleQueue");
          ic0 = 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 + "?ha=true&retryInterval=1000&retryIntervalMultiplier=1.0&reconnectAttempts=-1");
+         properties.put("connectionFactory.ConnectionFactory", "tcp://localhost:61617?ha=true&retryInterval=1000&retryIntervalMultiplier=1.0&reconnectAttempts=-1");
          ic1 = new InitialContext(properties);
 
          // Step 2. Look-up the JMS Queue object from JNDI
@@ -99,7 +99,6 @@ public class HAPolicyAutoBackupExample extends ActiveMQExample
          MessageConsumer consumer0 = session0.createConsumer(queue);
          MessageConsumer consumer1 = session1.createConsumer(queue);
 
-
          // Step 11. We create a JMS MessageProducer object on server 0
          MessageProducer producer = session0.createProducer(queue);
 
@@ -129,7 +128,7 @@ public class HAPolicyAutoBackupExample extends ActiveMQExample
          consumer1.close();
 
          // Step 15.now kill server1, messages will be scaled down to server0
-         killServer(1);
+         ServerUtil.killServer(server1);
          Thread.sleep(40000);
 
          // Step 16. we now receive the messages that were on server1 but were scaled down to server0
@@ -139,8 +138,6 @@ public class HAPolicyAutoBackupExample extends ActiveMQExample
 
             System.out.println("Got message: " + message0.getText() + " from node 1");
          }
-
-         return true;
       }
       finally
       {
@@ -155,10 +152,13 @@ public class HAPolicyAutoBackupExample extends ActiveMQExample
          {
             connection1.close();
          }
+
+         ServerUtil.killServer(server0);
+         ServerUtil.killServer(server1);
       }
    }
 
-   private void waitForBackups(ConnectionFactory cf0, int backups) throws InterruptedException
+   private static void waitForBackups(ConnectionFactory cf0, int backups) throws InterruptedException
    {
       final CountDownLatch latch = new CountDownLatch(backups);
          ((ActiveMQConnectionFactory) cf0).getServerLocator().addClusterTopologyListener(new ClusterTopologyListener()
@@ -181,5 +181,4 @@ public class HAPolicyAutoBackupExample extends ActiveMQExample
       });
       latch.await(30000, TimeUnit.MILLISECONDS);
    }
-
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/ha-policy-autobackup/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/ha-policy-autobackup/src/main/resources/activemq/server0/artemis-roles.properties b/examples/jms/ha-policy-autobackup/src/main/resources/activemq/server0/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/ha-policy-autobackup/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/ha-policy-autobackup/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/ha-policy-autobackup/src/main/resources/activemq/server0/artemis-users.properties b/examples/jms/ha-policy-autobackup/src/main/resources/activemq/server0/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/ha-policy-autobackup/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/ha-policy-autobackup/src/main/resources/activemq/server1/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/ha-policy-autobackup/src/main/resources/activemq/server1/artemis-roles.properties b/examples/jms/ha-policy-autobackup/src/main/resources/activemq/server1/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/ha-policy-autobackup/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/ha-policy-autobackup/src/main/resources/activemq/server1/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/ha-policy-autobackup/src/main/resources/activemq/server1/artemis-users.properties b/examples/jms/ha-policy-autobackup/src/main/resources/activemq/server1/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/ha-policy-autobackup/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/http-transport/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/http-transport/pom.xml b/examples/jms/http-transport/pom.xml
index b13f800..0d9c91d 100644
--- a/examples/jms/http-transport/pom.xml
+++ b/examples/jms/http-transport/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>
@@ -61,9 +56,18 @@ under the License.
                         <goals>
                            <goal>create</goal>
                         </goals>
+                     </execution>
+                     <execution>
+                        <id>start</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
                         <configuration>
-                           <instance>${basedir}/target/server0</instance>
-                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                           <spawn>true</spawn>
+                           <testURI>tcp://localhost:8080?http-enabled=true</testURI>
+                           <args>
+                              <param>run</param>
+                           </args>
                         </configuration>
                      </execution>
                      <execution>
@@ -73,8 +77,16 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.HttpTransportExample</clientClass>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>stop</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
                            <args>
-                              <param>${basedir}/target/server0</param>
+                              <param>stop</param>
                            </args>
                         </configuration>
                      </execution>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/http-transport/src/main/java/org/apache/activemq/artemis/jms/example/HttpTransportExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/http-transport/src/main/java/org/apache/activemq/artemis/jms/example/HttpTransportExample.java b/examples/jms/http-transport/src/main/java/org/apache/activemq/artemis/jms/example/HttpTransportExample.java
index 8348007..cd2e175 100644
--- a/examples/jms/http-transport/src/main/java/org/apache/activemq/artemis/jms/example/HttpTransportExample.java
+++ b/examples/jms/http-transport/src/main/java/org/apache/activemq/artemis/jms/example/HttpTransportExample.java
@@ -25,20 +25,12 @@ import javax.jms.Session;
 import javax.jms.TextMessage;
 import javax.naming.InitialContext;
 
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
-
 /**
  * A simple JMS Queue example that uses HTTP protocol.
  */
-public class HttpTransportExample extends ActiveMQExample
+public class HttpTransportExample
 {
-   public static void main(final String[] args)
-   {
-      new HttpTransportExample().run(args);
-   }
-
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(final String[] args) throws Exception
    {
       Connection connection = null;
       InitialContext initialContext = null;
@@ -84,8 +76,6 @@ public class HttpTransportExample extends ActiveMQExample
          System.out.println("Received message: " + messageReceived.getText());
 
          initialContext.close();
-
-         return true;
       }
       finally
       {
@@ -100,5 +90,4 @@ public class HttpTransportExample extends ActiveMQExample
          }
       }
    }
-
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/http-transport/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/http-transport/src/main/resources/activemq/server0/broker.xml b/examples/jms/http-transport/src/main/resources/activemq/server0/broker.xml
index f6062b6..ea39ccd 100644
--- a/examples/jms/http-transport/src/main/resources/activemq/server0/broker.xml
+++ b/examples/jms/http-transport/src/main/resources/activemq/server0/broker.xml
@@ -29,20 +29,18 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
+      <bindings-directory>${data.dir:../data}/bindings</bindings-directory>
 
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
+      <journal-directory>${data.dir:../data}/journal</journal-directory>
 
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
+      <large-messages-directory>${data.dir:../data}/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
+      <paging-directory>${data.dir:../data}/paging</paging-directory>
 
       <!-- Acceptors -->
 
       <acceptors>
          <acceptor name="netty-acceptor">tcp://localhost:8080</acceptor>
-         <!-- This is being defined just so the check-alive on the ArtemisExample super class works -->
-         <acceptor name="netty-accepto-checkalive">tcp://localhost:61616</acceptor>
       </acceptors>
 
       <!-- Other config -->

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/instantiate-connection-factory/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/instantiate-connection-factory/pom.xml b/examples/jms/instantiate-connection-factory/pom.xml
index 17e5543..774b2b2 100644
--- a/examples/jms/instantiate-connection-factory/pom.xml
+++ b/examples/jms/instantiate-connection-factory/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.activemq</groupId>
          <artifactId>artemis-core-client</artifactId>
          <version>${project.version}</version>
@@ -71,9 +66,18 @@ under the License.
                         <goals>
                            <goal>create</goal>
                         </goals>
+                     </execution>
+                     <execution>
+                        <id>start</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
                         <configuration>
-                           <instance>${basedir}/target/server0</instance>
-                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                           <spawn>true</spawn>
+                           <testURI>tcp://localhost:61616</testURI>
+                           <args>
+                              <param>run</param>
+                           </args>
                         </configuration>
                      </execution>
                      <execution>
@@ -83,8 +87,16 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.InstantiateConnectionFactoryExample</clientClass>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>stop</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
                            <args>
-                              <param>${basedir}/target/server0</param>
+                              <param>stop</param>
                            </args>
                         </configuration>
                      </execution>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/instantiate-connection-factory/src/main/java/org/apache/activemq/artemis/jms/example/InstantiateConnectionFactoryExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/instantiate-connection-factory/src/main/java/org/apache/activemq/artemis/jms/example/InstantiateConnectionFactoryExample.java b/examples/jms/instantiate-connection-factory/src/main/java/org/apache/activemq/artemis/jms/example/InstantiateConnectionFactoryExample.java
index 85ee7d9..b0acce4 100644
--- a/examples/jms/instantiate-connection-factory/src/main/java/org/apache/activemq/artemis/jms/example/InstantiateConnectionFactoryExample.java
+++ b/examples/jms/instantiate-connection-factory/src/main/java/org/apache/activemq/artemis/jms/example/InstantiateConnectionFactoryExample.java
@@ -29,7 +29,6 @@ import java.util.Map;
 import org.apache.activemq.artemis.api.core.TransportConfiguration;
 import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
 import org.apache.activemq.artemis.api.jms.JMSFactoryType;
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
 import org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnectorFactory;
 import org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants;
 
@@ -40,15 +39,9 @@ import org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants;
  *
  * For more information please see the readme.html file.
  */
-public class InstantiateConnectionFactoryExample extends ActiveMQExample
+public class InstantiateConnectionFactoryExample
 {
-   public static void main(final String[] args)
-   {
-      new InstantiateConnectionFactoryExample().run(args);
-   }
-
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(final String[] args) throws Exception
    {
       Connection connection = null;
       try
@@ -95,8 +88,6 @@ public class InstantiateConnectionFactoryExample extends ActiveMQExample
          TextMessage messageReceived = (TextMessage)messageConsumer.receive(5000);
 
          System.out.println("Received message: " + messageReceived.getText());
-
-         return true;
       }
       finally
       {
@@ -106,5 +97,4 @@ public class InstantiateConnectionFactoryExample extends ActiveMQExample
          }
       }
    }
-
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/instantiate-connection-factory/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/instantiate-connection-factory/src/main/resources/activemq/server0/artemis-roles.properties b/examples/jms/instantiate-connection-factory/src/main/resources/activemq/server0/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/instantiate-connection-factory/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/instantiate-connection-factory/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/instantiate-connection-factory/src/main/resources/activemq/server0/artemis-users.properties b/examples/jms/instantiate-connection-factory/src/main/resources/activemq/server0/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/instantiate-connection-factory/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/instantiate-connection-factory/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/instantiate-connection-factory/src/main/resources/activemq/server0/broker.xml b/examples/jms/instantiate-connection-factory/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index 7690094..0000000
--- a/examples/jms/instantiate-connection-factory/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,60 +0,0 @@
-<?xml version='1.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.
--->
-
-<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-               xmlns="urn:activemq"
-               xsi:schemaLocation="urn:activemq /schema/artemis-server.xsd">
-
-   <jms xmlns="urn:activemq:jms">
-      <!--the queue used by the example-->
-      <queue name="exampleQueue"/>
-   </jms>
-
-   <core xmlns="urn:activemq:core">
-
-      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
-
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
-
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
-
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
-      </acceptors>
-
-      <!-- Other config -->
-
-      <security-settings>
-         <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
-            <permission type="createDurableQueue" roles="guest"/>
-            <permission type="deleteDurableQueue" roles="guest"/>
-            <permission type="createNonDurableQueue" roles="guest"/>
-            <permission type="deleteNonDurableQueue" roles="guest"/>
-            <permission type="consume" roles="guest"/>
-            <permission type="send" roles="guest"/>
-         </security-setting>
-      </security-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/interceptor/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/interceptor/pom.xml b/examples/jms/interceptor/pom.xml
index 5d7a2a0..530a7b9 100644
--- a/examples/jms/interceptor/pom.xml
+++ b/examples/jms/interceptor/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.activemq</groupId>
          <artifactId>artemis-jms-client</artifactId>
          <version>${project.version}</version>
@@ -66,9 +61,18 @@ under the License.
                         <goals>
                            <goal>create</goal>
                         </goals>
+                     </execution>
+                     <execution>
+                        <id>start</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
                         <configuration>
-                           <instance>${basedir}/target/server0</instance>
-                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                           <spawn>true</spawn>
+                           <testURI>tcp://localhost:61616</testURI>
+                           <args>
+                              <param>run</param>
+                           </args>
                         </configuration>
                      </execution>
                      <execution>
@@ -78,8 +82,16 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.InterceptorExample</clientClass>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>stop</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
                            <args>
-                              <param>${basedir}/target/server0</param>
+                              <param>stop</param>
                            </args>
                         </configuration>
                      </execution>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/interceptor/src/main/java/org/apache/activemq/artemis/jms/example/InterceptorExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/interceptor/src/main/java/org/apache/activemq/artemis/jms/example/InterceptorExample.java b/examples/jms/interceptor/src/main/java/org/apache/activemq/artemis/jms/example/InterceptorExample.java
index f6e8d99..1a27726 100644
--- a/examples/jms/interceptor/src/main/java/org/apache/activemq/artemis/jms/example/InterceptorExample.java
+++ b/examples/jms/interceptor/src/main/java/org/apache/activemq/artemis/jms/example/InterceptorExample.java
@@ -25,20 +25,12 @@ import javax.jms.Session;
 import javax.jms.TextMessage;
 import javax.naming.InitialContext;
 
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
-
 /**
  * A simple JMS example that shows how to implement and use interceptors with ActiveMQ Artemis.
  */
-public class InterceptorExample extends ActiveMQExample
+public class InterceptorExample
 {
-   public static void main(final String[] args)
-   {
-      new InterceptorExample().run(args);
-   }
-
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(final String[] args) throws Exception
    {
       Connection connection = null;
       InitialContext initialContext = null;
@@ -66,8 +58,8 @@ public class InterceptorExample extends ActiveMQExample
          TextMessage message = session.createTextMessage("This is a text message");
 
          System.out.println("Sending message [" + message.getText() +
-                            "] with String property: " +
-                            message.getStringProperty("newproperty"));
+                                    "] with String property: " +
+                                    message.getStringProperty("newproperty"));
 
          // Step 8. Send the Message
          producer.send(message);
@@ -82,10 +74,8 @@ public class InterceptorExample extends ActiveMQExample
          TextMessage messageReceived = (TextMessage)messageConsumer.receive(5000);
 
          System.out.println("Received message [" + messageReceived.getText() +
-                            "] with String property: " +
-                            messageReceived.getStringProperty("newproperty"));
-
-         return true;
+                                    "] with String property: " +
+                                    messageReceived.getStringProperty("newproperty"));
       }
       finally
       {
@@ -100,5 +90,4 @@ public class InterceptorExample extends ActiveMQExample
          }
       }
    }
-
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/interceptor/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/interceptor/src/main/resources/activemq/server0/broker.xml b/examples/jms/interceptor/src/main/resources/activemq/server0/broker.xml
index 1ff8a1f..fc82158 100644
--- a/examples/jms/interceptor/src/main/resources/activemq/server0/broker.xml
+++ b/examples/jms/interceptor/src/main/resources/activemq/server0/broker.xml
@@ -29,13 +29,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
+      <bindings-directory>${data.dir:../data}/bindings</bindings-directory>
 
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
+      <journal-directory>${data.dir:../data}/journal</journal-directory>
 
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
+      <large-messages-directory>${data.dir:../data}/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
+      <paging-directory>${data.dir:../data}/paging</paging-directory>
 
 
       <remoting-incoming-interceptors>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/jms-auto-closeable/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/jms-auto-closeable/pom.xml b/examples/jms/jms-auto-closeable/pom.xml
index 6cceae6..17376ab 100644
--- a/examples/jms/jms-auto-closeable/pom.xml
+++ b/examples/jms/jms-auto-closeable/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>
@@ -61,9 +56,18 @@ under the License.
                         <goals>
                            <goal>create</goal>
                         </goals>
+                     </execution>
+                     <execution>
+                        <id>start</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
                         <configuration>
-                           <instance>${basedir}/target/server0</instance>
-                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                           <spawn>true</spawn>
+                           <testURI>tcp://localhost:61616</testURI>
+                           <args>
+                              <param>run</param>
+                           </args>
                         </configuration>
                      </execution>
                      <execution>
@@ -73,8 +77,16 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.JMSAutoCloseableExample</clientClass>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>stop</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
                            <args>
-                              <param>${basedir}/target/server0</param>
+                              <param>stop</param>
                            </args>
                         </configuration>
                      </execution>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/jms-auto-closeable/src/main/java/org/apache/activemq/artemis/jms/example/JMSAutoCloseableExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/jms-auto-closeable/src/main/java/org/apache/activemq/artemis/jms/example/JMSAutoCloseableExample.java b/examples/jms/jms-auto-closeable/src/main/java/org/apache/activemq/artemis/jms/example/JMSAutoCloseableExample.java
index 68bd1eb..555e8ff 100644
--- a/examples/jms/jms-auto-closeable/src/main/java/org/apache/activemq/artemis/jms/example/JMSAutoCloseableExample.java
+++ b/examples/jms/jms-auto-closeable/src/main/java/org/apache/activemq/artemis/jms/example/JMSAutoCloseableExample.java
@@ -18,21 +18,14 @@ package org.apache.activemq.artemis.jms.example;
 
 import javax.jms.*;
 import javax.naming.InitialContext;
-
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
+import java.lang.Exception;
 
 /**
  * A simple JMS example that shows how AutoCloseable is used by JMS 2 resources.
  */
-public class JMSAutoCloseableExample extends ActiveMQExample
+public class JMSAutoCloseableExample
 {
-   public static void main(final String[] args)
-   {
-      new JMSAutoCloseableExample().run(args);
-   }
-
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(final String[] args) throws Exception
    {
       InitialContext initialContext = null;
       try
@@ -48,9 +41,9 @@ public class JMSAutoCloseableExample extends ActiveMQExample
 
          // Step 4.Create a JMS Context using the try-with-resources statement
          try
-         (
-            JMSContext jmsContext = cf.createContext()
-         )
+                 (
+                         JMSContext jmsContext = cf.createContext()
+                 )
          {
             // Step 5. create a jms producer
             JMSProducer jmsProducer = jmsContext.createProducer();
@@ -64,8 +57,6 @@ public class JMSAutoCloseableExample extends ActiveMQExample
             //JMSCcontext will have been closed by the time we get to this point
             System.out.println("expected exception from jmsProducer.send: " + e.getMessage());
          }
-
-         return true;
       }
       finally
       {


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

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/application-layer-failover/src/main/java/org/apache/activemq/artemis/jms/example/ApplicationLayerFailoverExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/application-layer-failover/src/main/java/org/apache/activemq/artemis/jms/example/ApplicationLayerFailoverExample.java b/examples/jms/application-layer-failover/src/main/java/org/apache/activemq/artemis/jms/example/ApplicationLayerFailoverExample.java
index ca916ee..fcd3cca 100644
--- a/examples/jms/application-layer-failover/src/main/java/org/apache/activemq/artemis/jms/example/ApplicationLayerFailoverExample.java
+++ b/examples/jms/application-layer-failover/src/main/java/org/apache/activemq/artemis/jms/example/ApplicationLayerFailoverExample.java
@@ -16,6 +16,8 @@
  */
 package org.apache.activemq.artemis.jms.example;
 
+import org.apache.activemq.artemis.util.ServerUtil;
+
 import java.lang.Object;
 import java.lang.String;
 import java.util.Hashtable;
@@ -32,37 +34,37 @@ import javax.jms.Queue;
 import javax.jms.Session;
 import javax.jms.TextMessage;
 import javax.naming.InitialContext;
-
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
+import javax.naming.NamingException;
 
 /**
  * A simple example that demonstrates application-layer failover of the JMS connection from one node to another
  * when the live server crashes
  */
-public class ApplicationLayerFailoverExample extends ActiveMQExample
+public class ApplicationLayerFailoverExample
 {
-   public static void main(final String[] args)
-   {
-      new ApplicationLayerFailoverExample().run(args);
-   }
+   private static InitialContext initialContext;
 
-   private volatile InitialContext initialContext;
+   private static Connection connection;
 
-   private volatile Connection connection;
+   private static Session session;
 
-   private volatile Session session;
+   private static MessageConsumer consumer;
 
-   private volatile MessageConsumer consumer;
+   private static MessageProducer producer;
 
-   private volatile MessageProducer producer;
+   private static final CountDownLatch failoverLatch = new CountDownLatch(1);
 
-   private final CountDownLatch failoverLatch = new CountDownLatch(1);
+   private static Process server0;
 
-   @Override
-   public boolean runExample() throws Exception
+   private static Process server1;
+
+   public static void main(final String[] args) throws Exception
    {
       try
       {
+         server0 = ServerUtil.startServer(args[0], ApplicationLayerFailoverExample.class.getSimpleName() + "0", 0, 5000);
+         server1 = ServerUtil.startServer(args[1], ApplicationLayerFailoverExample.class.getSimpleName() + "1", 1, 5000);
+
          // Step 1. We create our JMS Connection, Session, MessageProducer and MessageConsumer on server 1.
          createJMSObjects(0);
 
@@ -99,21 +101,12 @@ public class ApplicationLayerFailoverExample extends ActiveMQExample
 
          System.out.println("Killing the server");
 
-         killServer(0);
-
-         // this utility method will wait for the server1 to be activated
-         waitForServerStart(1, 20000);
-
+         ServerUtil.killServer(server0);
 
          // Step 6. Wait for the client side to register the failure and reconnect
 
          boolean ok = failoverLatch.await(5000, TimeUnit.MILLISECONDS);
 
-         if (!ok)
-         {
-            return false;
-         }
-
          System.out.println("Reconnection has occurred. Now sending more messages.");
 
          // Step 8. We now send some more messages
@@ -135,23 +128,21 @@ public class ApplicationLayerFailoverExample extends ActiveMQExample
 
             System.out.println("Got message: " + message0.getText());
          }
-
-         return true;
       }
       catch(Throwable t)
       {
          t.printStackTrace();
-         return false;
       }
       finally
       {
          // Step 14. Be sure to close our resources!
-
          closeResources();
+         ServerUtil.killServer(server0);
+         ServerUtil.killServer(server1);
       }
    }
 
-   private void createJMSObjects(final int server) throws Exception
+   private static void createJMSObjects(final int server) throws Exception
    {
       // Step 1. Get an initial context for looking up JNDI from the server
       Hashtable<String, Object> properties = new Hashtable<String, Object>();
@@ -182,20 +173,34 @@ public class ApplicationLayerFailoverExample extends ActiveMQExample
       producer = session.createProducer(queue);
    }
 
-   private void closeResources() throws Exception
+   private static void closeResources()
    {
       if (initialContext != null)
       {
-         initialContext.close();
+         try
+         {
+            initialContext.close();
+         }
+         catch (NamingException e)
+         {
+            e.printStackTrace();
+         }
       }
 
       if (connection != null)
       {
-         connection.close();
+         try
+         {
+            connection.close();
+         }
+         catch (JMSException e)
+         {
+            e.printStackTrace();
+         }
       }
    }
 
-   private class ExampleListener implements ExceptionListener
+   private static class ExampleListener implements ExceptionListener
    {
       public void onException(final JMSException exception)
       {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/bridge/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/bridge/pom.xml b/examples/jms/bridge/pom.xml
index f1dd547..73cbdc5 100644
--- a/examples/jms/bridge/pom.xml
+++ b/examples/jms/bridge/pom.xml
@@ -27,9 +27,9 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-bridge-example</artifactId>
+   <artifactId>artemis-jms-core-bridge-example</artifactId>
    <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS Bridge Example</name>
+   <name>ActiveMQ Artemis Core Bridge Example</name>
 
    <properties>
       <activemq.basedir>${project.basedir}/../../..</activemq.basedir>
@@ -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.activemq</groupId>
          <artifactId>artemis-server</artifactId>
          <version>${project.version}</version>
@@ -62,7 +57,7 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>create</id>
+                        <id>create0</id>
                         <goals>
                            <goal>create</goal>
                         </goals>
@@ -72,7 +67,7 @@ under the License.
                         </configuration>
                      </execution>
                      <execution>
-                        <id>create2</id>
+                        <id>create1</id>
                         <goals>
                            <goal>create</goal>
                         </goals>
@@ -83,15 +78,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>client</goal>
+                           <goal>runClient</goal>
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.BridgeExample</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>
@@ -99,29 +144,9 @@ under the License.
                   <dependencies>
                      <dependency>
                         <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-bridge-example</artifactId>
+                        <artifactId>artemis-jms-core-bridge-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
                </plugin>
             </plugins>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/bridge/src/main/java/org/apache/activemq/artemis/jms/example/BridgeExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/bridge/src/main/java/org/apache/activemq/artemis/jms/example/BridgeExample.java b/examples/jms/bridge/src/main/java/org/apache/activemq/artemis/jms/example/BridgeExample.java
index 4346c32..a4a165c 100644
--- a/examples/jms/bridge/src/main/java/org/apache/activemq/artemis/jms/example/BridgeExample.java
+++ b/examples/jms/bridge/src/main/java/org/apache/activemq/artemis/jms/example/BridgeExample.java
@@ -26,21 +26,13 @@ import javax.jms.Session;
 import javax.naming.InitialContext;
 import java.util.Hashtable;
 
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
-
 /**
  * This example demonstrates a core bridge set-up between two nodes, consuming messages from a queue
  * on one node and forwarding them to an address on the second node.
  */
-public class BridgeExample extends ActiveMQExample
+public class BridgeExample
 {
-   public static void main(final String[] args)
-   {
-      new BridgeExample().run(args);
-   }
-
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(final String[] args) throws Exception
    {
       Connection connection0 = null;
 
@@ -120,9 +112,9 @@ public class BridgeExample extends ActiveMQExample
          producer.send(message);
 
          System.out.println("Sent " + message.getStringProperty("name") +
-                            " message with " +
-                            message.getStringProperty("hat") +
-                            " hat to sausage-factory on node 0");
+                                    " message with " +
+                                    message.getStringProperty("hat") +
+                                    " hat to sausage-factory on node 0");
 
          // Step 14 - we successfully receive the aardvark message from the mincing-machine one node 1. The aardvark's
          // hat is now blue since it has been transformed!
@@ -130,9 +122,9 @@ public class BridgeExample extends ActiveMQExample
          Message receivedMessage = consumer.receive(5000);
 
          System.out.println("Received " + receivedMessage.getStringProperty("name") +
-                            " message with " +
-                            receivedMessage.getStringProperty("hat") +
-                            " hat from mincing-machine on node 1");
+                                    " message with " +
+                                    receivedMessage.getStringProperty("hat") +
+                                    " hat from mincing-machine on node 1");
 
          // Step 13. We create and send another message, this time representing a sasquatch with a mauve hat to the
          // sausage-factory on node 0. This won't be bridged to the mincing-machine since we only want aardvarks, not
@@ -147,9 +139,9 @@ public class BridgeExample extends ActiveMQExample
          producer.send(message);
 
          System.out.println("Sent " + message.getStringProperty("name") +
-                            " message with " +
-                            message.getStringProperty("hat") +
-                            " hat to sausage-factory on node 0");
+                                    " message with " +
+                                    message.getStringProperty("hat") +
+                                    " hat to sausage-factory on node 0");
 
          // Step 14. We don't receive the message since it has not been bridged.
 
@@ -161,10 +153,8 @@ public class BridgeExample extends ActiveMQExample
          }
          else
          {
-            return false;
+            throw new IllegalStateException();
          }
-
-         return true;
       }
       finally
       {
@@ -191,5 +181,4 @@ public class BridgeExample extends ActiveMQExample
          }
       }
    }
-
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/browser/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/browser/pom.xml b/examples/jms/browser/pom.xml
index 530f66b..adaf222 100644
--- a/examples/jms/browser/pom.xml
+++ b/examples/jms/browser/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>
@@ -64,14 +59,35 @@ under the License.
                         </goals>
                      </execution>
                      <execution>
+                        <id>start</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
+                           <spawn>true</spawn>
+                           <testURI>tcp://localhost:61616</testURI>
+                           <args>
+                              <param>run</param>
+                           </args>
+                        </configuration>
+                     </execution>
+                     <execution>
                         <id>runClient</id>
                         <goals>
                            <goal>runClient</goal>
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.QueueBrowserExample</clientClass>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>stop</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
                            <args>
-                              <param>${basedir}/target/server0</param>
+                              <param>stop</param>
                            </args>
                         </configuration>
                      </execution>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/browser/src/main/java/org/apache/activemq/artemis/jms/example/QueueBrowserExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/browser/src/main/java/org/apache/activemq/artemis/jms/example/QueueBrowserExample.java b/examples/jms/browser/src/main/java/org/apache/activemq/artemis/jms/example/QueueBrowserExample.java
index 8e8e422..6c93cc6 100644
--- a/examples/jms/browser/src/main/java/org/apache/activemq/artemis/jms/example/QueueBrowserExample.java
+++ b/examples/jms/browser/src/main/java/org/apache/activemq/artemis/jms/example/QueueBrowserExample.java
@@ -27,20 +27,12 @@ import javax.jms.TextMessage;
 import javax.naming.InitialContext;
 import java.util.Enumeration;
 
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
-
 /**
  * A simple example which shows how to use a QueueBrowser to look at messages of a queue without removing them from the queue
  */
-public class QueueBrowserExample extends ActiveMQExample
+public class QueueBrowserExample
 {
-   public static void main(final String[] args)
-   {
-      new QueueBrowserExample().run(args);
-   }
-
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(final String[] args) throws Exception
    {
       Connection connection = null;
       InitialContext initialContext = null;
@@ -98,9 +90,6 @@ public class QueueBrowserExample extends ActiveMQExample
          System.out.println("Received message: " + messageReceived.getText());
          messageReceived = (TextMessage)messageConsumer.receive(5000);
          System.out.println("Received message: " + messageReceived.getText());
-
-         return true;
-
       }
       finally
       {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/client-kickoff/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/client-kickoff/pom.xml b/examples/jms/client-kickoff/pom.xml
index 22d511c..1c86b5a 100644
--- a/examples/jms/client-kickoff/pom.xml
+++ b/examples/jms/client-kickoff/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.activemq</groupId>
          <artifactId>artemis-core-client</artifactId>
          <version>${project.version}</version>
@@ -72,14 +67,35 @@ under the License.
                         </configuration>
                      </execution>
                      <execution>
+                        <id>start</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
+                           <spawn>true</spawn>
+                           <testURI>tcp://localhost:61616</testURI>
+                           <args>
+                              <param>run</param>
+                           </args>
+                        </configuration>
+                     </execution>
+                     <execution>
                         <id>runClient</id>
                         <goals>
                            <goal>runClient</goal>
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.ClientKickoffExample</clientClass>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>stop</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
                            <args>
-                              <param>${basedir}/target/server0</param>
+                              <param>stop</param>
                            </args>
                         </configuration>
                      </execution>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/client-kickoff/src/main/java/org/apache/activemq/artemis/jms/example/ClientKickoffExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/client-kickoff/src/main/java/org/apache/activemq/artemis/jms/example/ClientKickoffExample.java b/examples/jms/client-kickoff/src/main/java/org/apache/activemq/artemis/jms/example/ClientKickoffExample.java
index eb5db60..5421739 100644
--- a/examples/jms/client-kickoff/src/main/java/org/apache/activemq/artemis/jms/example/ClientKickoffExample.java
+++ b/examples/jms/client-kickoff/src/main/java/org/apache/activemq/artemis/jms/example/ClientKickoffExample.java
@@ -27,27 +27,21 @@ import javax.management.remote.JMXConnector;
 import javax.management.remote.JMXConnectorFactory;
 import javax.management.remote.JMXServiceURL;
 import javax.naming.InitialContext;
+import java.lang.Exception;
 import java.util.HashMap;
 import java.util.concurrent.atomic.AtomicReference;
 
 import org.apache.activemq.artemis.api.core.management.ActiveMQServerControl;
 import org.apache.activemq.artemis.api.core.management.ObjectNameBuilder;
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
 
 /**
  * An example that shows how to kick off a client connected to ActiveMQ Artemis by using JMX.
  */
-public class ClientKickoffExample extends ActiveMQExample
+public class ClientKickoffExample
 {
    private static final String JMX_URL = "service:jmx:rmi:///jndi/rmi://localhost:3000/jmxrmi";
 
-   public static void main(final String[] args)
-   {
-      new ClientKickoffExample().run(args);
-   }
-
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(final String[] args) throws Exception
    {
       QueueConnection connection = null;
       InitialContext initialContext = null;
@@ -67,7 +61,7 @@ public class ClientKickoffExample extends ActiveMQExample
          connection.setExceptionListener(new ExceptionListener()
          {
             @Override
-         public void onException(final JMSException e)
+            public void onException(final JMSException e)
             {
                exception.set(e);
             }
@@ -81,9 +75,9 @@ public class ClientKickoffExample extends ActiveMQExample
          JMXConnector connector = JMXConnectorFactory.connect(new JMXServiceURL(JMX_URL), new HashMap<String, String>());
          MBeanServerConnection mbsc = connector.getMBeanServerConnection();
          ActiveMQServerControl serverControl = MBeanServerInvocationHandler.newProxyInstance(mbsc,
-                                                                                            on,
-                                                                                            ActiveMQServerControl.class,
-                                                                                            false);
+                                                                                             on,
+                                                                                             ActiveMQServerControl.class,
+                                                                                             false);
 
          // Step 7. List the remote address connected to the server
          System.out.println("List of remote addresses connected to the server:");
@@ -107,8 +101,6 @@ public class ClientKickoffExample extends ActiveMQExample
          System.err.println("----------------------------------");
          exception.get().printStackTrace();
          System.err.println("----------------------------------");
-
-         return true;
       }
       finally
       {
@@ -123,5 +115,4 @@ public class ClientKickoffExample extends ActiveMQExample
          }
       }
    }
-
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/client-kickoff/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/client-kickoff/src/main/resources/activemq/server0/broker.xml b/examples/jms/client-kickoff/src/main/resources/activemq/server0/broker.xml
index af12f6a..3b5a465 100644
--- a/examples/jms/client-kickoff/src/main/resources/activemq/server0/broker.xml
+++ b/examples/jms/client-kickoff/src/main/resources/activemq/server0/broker.xml
@@ -27,13 +27,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
+      <bindings-directory>${data.dir:../data}/bindings</bindings-directory>
 
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
+      <journal-directory>${data.dir:../data}/journal</journal-directory>
 
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
+      <large-messages-directory>${data.dir:../data}/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
+      <paging-directory>${data.dir:../data}/paging</paging-directory>
 
       <!-- true to expose ActiveMQ Artemis resources through JMX -->
       <jmx-management-enabled>true</jmx-management-enabled>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/client-side-failoverlistener/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/client-side-failoverlistener/pom.xml b/examples/jms/client-side-failoverlistener/pom.xml
index 87c41f3..cfdcdd6 100644
--- a/examples/jms/client-side-failoverlistener/pom.xml
+++ b/examples/jms/client-side-failoverlistener/pom.xml
@@ -37,8 +37,13 @@ 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>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
          <version>${project.version}</version>
       </dependency>
       <dependency>
@@ -57,31 +62,31 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>create</id>
+                        <id>create0</id>
                         <goals>
                            <goal>create</goal>
                         </goals>
                         <configuration>
                            <instance>${basedir}/target/server0</instance>
-                           <data>../../shared/</data>
+                           <dataFolder>../shared</dataFolder>
                            <sharedStore>true</sharedStore>
                            <slave>false</slave>
+                           <failoverOnShutdown>true</failoverOnShutdown>
                         </configuration>
                      </execution>
                      <execution>
-                        <id>create2</id>
+                        <id>create1</id>
                         <goals>
                            <goal>create</goal>
                         </goals>
                         <configuration>
                            <instance>${basedir}/target/server1</instance>
-                           <data>../../shared/</data>
+                           <dataFolder>../shared</dataFolder>
                            <sharedStore>true</sharedStore>
                            <slave>true</slave>
                            <portOffset>1</portOffset>
                         </configuration>
                      </execution>
-
                      <execution>
                         <id>runClient</id>
                         <goals>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/client-side-failoverlistener/src/main/java/org/apache/activemq/artemis/jms/example/ClientSideFailoverListerExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/client-side-failoverlistener/src/main/java/org/apache/activemq/artemis/jms/example/ClientSideFailoverListerExample.java b/examples/jms/client-side-failoverlistener/src/main/java/org/apache/activemq/artemis/jms/example/ClientSideFailoverListerExample.java
index c753000..0066139 100644
--- a/examples/jms/client-side-failoverlistener/src/main/java/org/apache/activemq/artemis/jms/example/ClientSideFailoverListerExample.java
+++ b/examples/jms/client-side-failoverlistener/src/main/java/org/apache/activemq/artemis/jms/example/ClientSideFailoverListerExample.java
@@ -16,6 +16,11 @@
  */
 package org.apache.activemq.artemis.jms.example;
 
+import org.apache.activemq.artemis.api.core.client.FailoverEventListener;
+import org.apache.activemq.artemis.api.core.client.FailoverEventType;
+import org.apache.activemq.artemis.jms.client.ActiveMQConnection;
+import org.apache.activemq.artemis.util.ServerUtil;
+
 import javax.jms.Connection;
 import javax.jms.ConnectionFactory;
 import javax.jms.MessageConsumer;
@@ -25,38 +30,19 @@ import javax.jms.Session;
 import javax.jms.TextMessage;
 import javax.naming.InitialContext;
 
-import org.apache.activemq.artemis.api.core.client.FailoverEventListener;
-import org.apache.activemq.artemis.api.core.client.FailoverEventType;
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
-import org.apache.activemq.artemis.jms.client.ActiveMQConnection;
-
 /**
  * This example demonstrates how you can listen on failover event on the client side
- *
+ * <p/>
  * In this example there are two nodes running in a cluster, both server will be running for start,
  * but after a while the first server will crash. This will trigger a fail-over event
  */
-public class ClientSideFailoverListerExample extends ActiveMQExample
+public class ClientSideFailoverListerExample
 {
-   public static void main(final String[] args) throws Exception
-   {
-      new ClientSideFailoverListerExample().run(args);
-   }
-
-   @Override
-   protected void startServers(String[] serversArgs) throws Exception
-   {
-      startServer(0, 5000);
-
-      // server 1 is a backup, it's not activated
-      startServer(1, 0);
-
-      Thread.sleep(1000);
-   }
+   private static Process server0;
 
+   private static Process server1;
 
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(final String[] args) throws Exception
    {
       InitialContext initialContext = null;
 
@@ -64,20 +50,23 @@ public class ClientSideFailoverListerExample extends ActiveMQExample
 
       try
       {
+         server0 = ServerUtil.startServer(args[0], ClientSideFailoverListerExample.class.getSimpleName() + "0", 0, 5000);
+         server1 = ServerUtil.startServer(args[1], ClientSideFailoverListerExample.class.getSimpleName() + "1", 1, 0);
+
          // Step 1. Get an initial context for looking up JNDI from server 0
          initialContext = new InitialContext();
 
          // Step 2. Look-up the JMS Queue object from JNDI
-         Queue queue = (Queue)initialContext.lookup("queue/exampleQueue");
+         Queue queue = (Queue) initialContext.lookup("queue/exampleQueue");
 
          // Step 3. Look-up a JMS Connection Factory object from JNDI on server 0
-         ConnectionFactory connectionFactory = (ConnectionFactory)initialContext.lookup("ConnectionFactory");
+         ConnectionFactory connectionFactory = (ConnectionFactory) initialContext.lookup("ConnectionFactory");
 
          // Step 4. We create 1 JMS connections from the same connection factory.
          // Wait a little while to make sure broadcasts from all nodes have reached the client
          Thread.sleep(5000);
          connectionA = connectionFactory.createConnection();
-         ((ActiveMQConnection)connectionA).setFailoverListener(new FailoverListenerImpl());
+         ((ActiveMQConnection) connectionA).setFailoverListener(new FailoverListenerImpl());
 
          // Step 5. We create JMS Sessions
          Session sessionA = connectionA.createSession(false, Session.AUTO_ACKNOWLEDGE);
@@ -102,8 +91,6 @@ public class ClientSideFailoverListerExample extends ActiveMQExample
          // Step 9. We consume messages from the session A, one at a time.
          // We reached message no 5 the first server will crash
          consume(sessionA, queue, numMessages, "A");
-
-         return true;
       }
       finally
       {
@@ -118,20 +105,23 @@ public class ClientSideFailoverListerExample extends ActiveMQExample
          {
             initialContext.close();
          }
+
+         ServerUtil.killServer(server0);
+         ServerUtil.killServer(server1);
       }
    }
 
-   private void consume(Session session, Queue queue, int numMessages, String node) throws Exception
+   private static void consume(Session session, Queue queue, int numMessages, String node) throws Exception
    {
       MessageConsumer consumer = session.createConsumer(queue);
 
       for (int i = 0; i < numMessages; i++)
       {
-         TextMessage message = (TextMessage)consumer.receive(2000);
+         TextMessage message = (TextMessage) consumer.receive(2000);
          System.out.println("Got message: " + message.getText() + " from node " + node);
          if (i == 5)
          {
-            killServer(0);
+            ServerUtil.killServer(server0);
          }
       }
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/client-side-load-balancing/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/client-side-load-balancing/pom.xml b/examples/jms/client-side-load-balancing/pom.xml
index fc4ec4c..77c8186 100644
--- a/examples/jms/client-side-load-balancing/pom.xml
+++ b/examples/jms/client-side-load-balancing/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-jms-client</artifactId>
          <version>${project.version}</version>
       </dependency>
       <dependency>
@@ -57,41 +57,82 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>create</id>
+                        <id>create0</id>
                         <goals>
                            <goal>create</goal>
                         </goals>
                         <configuration>
                            <instance>${basedir}/target/server0</instance>
                            <clustered>true</clustered>
-                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
                         </configuration>
                      </execution>
                      <execution>
-                        <id>create2</id>
+                        <id>create1</id>
                         <goals>
                            <goal>create</goal>
                         </goals>
                         <configuration>
                            <instance>${basedir}/target/server1</instance>
                            <clustered>true</clustered>
-                           <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>
                            <clustered>true</clustered>
-                           <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>
                         <id>runClient</id>
                         <goals>
@@ -99,10 +140,41 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.ClientSideLoadBalancingExample</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/client-side-load-balancing/src/main/java/org/apache/activemq/artemis/jms/example/ClientSideLoadBalancingExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/client-side-load-balancing/src/main/java/org/apache/activemq/artemis/jms/example/ClientSideLoadBalancingExample.java b/examples/jms/client-side-load-balancing/src/main/java/org/apache/activemq/artemis/jms/example/ClientSideLoadBalancingExample.java
index 287b2a7..688ba5a 100644
--- a/examples/jms/client-side-load-balancing/src/main/java/org/apache/activemq/artemis/jms/example/ClientSideLoadBalancingExample.java
+++ b/examples/jms/client-side-load-balancing/src/main/java/org/apache/activemq/artemis/jms/example/ClientSideLoadBalancingExample.java
@@ -26,8 +26,6 @@ import javax.jms.Session;
 import javax.jms.TextMessage;
 import javax.naming.InitialContext;
 
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
-
 /**
  * This example demonstrates how sessions created from a single connection can be load
  * balanced across the different nodes of the cluster.
@@ -35,15 +33,9 @@ import org.apache.activemq.artemis.common.example.ActiveMQExample;
  * In this example there are three nodes and we use a round-robin client side load-balancing
  * policy.
  */
-public class ClientSideLoadBalancingExample extends ActiveMQExample
+public class ClientSideLoadBalancingExample
 {
-   public static void main(final String[] args)
-   {
-      new ClientSideLoadBalancingExample().run(args);
-   }
-
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(final String[] args) throws Exception
    {
       InitialContext initialContext = null;
 
@@ -116,8 +108,6 @@ public class ClientSideLoadBalancingExample extends ActiveMQExample
          consume(sessionA, queue, numMessages, "A");
          consume(sessionB, queue, numMessages, "B");
          consume(sessionC, queue, numMessages, "C");
-
-         return true;
       }
       finally
       {
@@ -143,7 +133,7 @@ public class ClientSideLoadBalancingExample extends ActiveMQExample
       }
    }
 
-   private void consume(Session session, Queue queue, int numMessages, String node) throws JMSException
+   private static void consume(Session session, Queue queue, int numMessages, String node) throws JMSException
    {
       MessageConsumer consumer = session.createConsumer(queue);
 
@@ -154,6 +144,5 @@ public class ClientSideLoadBalancingExample extends ActiveMQExample
       }
 
       System.out.println("receive other message from node " + node + ": " + consumer.receive(2000));
-
    }
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/clustered-durable-subscription/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-durable-subscription/pom.xml b/examples/jms/clustered-durable-subscription/pom.xml
index a23512c..041fbe3 100644
--- a/examples/jms/clustered-durable-subscription/pom.xml
+++ b/examples/jms/clustered-durable-subscription/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>
@@ -78,15 +73,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.ClusteredDurableSubscriptionExample</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>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/clustered-durable-subscription/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredDurableSubscriptionExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-durable-subscription/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredDurableSubscriptionExample.java b/examples/jms/clustered-durable-subscription/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredDurableSubscriptionExample.java
index d850f08..31d1434 100644
--- a/examples/jms/clustered-durable-subscription/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredDurableSubscriptionExample.java
+++ b/examples/jms/clustered-durable-subscription/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredDurableSubscriptionExample.java
@@ -26,23 +26,15 @@ import javax.jms.Topic;
 import javax.naming.InitialContext;
 import java.util.Hashtable;
 
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
-
 /**
  * A simple example that shows a JMS Durable Subscription across two nodes of a cluster.
  *
  * The same durable subscription can exist on more than one node of the cluster, and messages
  * sent to the topic will be load-balanced in a round-robin fashion between the two nodes
  */
-public class ClusteredDurableSubscriptionExample extends ActiveMQExample
+public class ClusteredDurableSubscriptionExample
 {
-   public static void main(final String[] args)
-   {
-      new ClusteredDurableSubscriptionExample().run(args);
-   }
-
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(final String[] args) throws Exception
    {
       Connection connection0 = null;
 
@@ -145,8 +137,6 @@ public class ClusteredDurableSubscriptionExample extends ActiveMQExample
 
             System.out.println("Got message: " + message1.getText() + " from node 1");
          }
-
-         return true;
       }
       finally
       {
@@ -172,5 +162,4 @@ public class ClusteredDurableSubscriptionExample extends ActiveMQExample
          }
       }
    }
-
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/clustered-durable-subscription/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-durable-subscription/src/main/resources/activemq/server0/broker.xml b/examples/jms/clustered-durable-subscription/src/main/resources/activemq/server0/broker.xml
index f9b0e67..6214a63 100644
--- a/examples/jms/clustered-durable-subscription/src/main/resources/activemq/server0/broker.xml
+++ b/examples/jms/clustered-durable-subscription/src/main/resources/activemq/server0/broker.xml
@@ -29,13 +29,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
+      <bindings-directory>${data.dir:./data}/bindings</bindings-directory>
 
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
+      <journal-directory>${data.dir:./data}/journal</journal-directory>
 
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
+      <large-messages-directory>${data.dir:./data}/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-durable-subscription/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-durable-subscription/src/main/resources/activemq/server1/broker.xml b/examples/jms/clustered-durable-subscription/src/main/resources/activemq/server1/broker.xml
index 64f6d68..3d1cb2e 100644
--- a/examples/jms/clustered-durable-subscription/src/main/resources/activemq/server1/broker.xml
+++ b/examples/jms/clustered-durable-subscription/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-grouping/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-grouping/pom.xml b/examples/jms/clustered-grouping/pom.xml
index a9357cf..0f9f101 100644
--- a/examples/jms/clustered-grouping/pom.xml
+++ b/examples/jms/clustered-grouping/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.ClusteredGroupingExample</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-grouping/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredGroupingExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-grouping/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredGroupingExample.java b/examples/jms/clustered-grouping/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredGroupingExample.java
index b13681b..a60ea6b 100644
--- a/examples/jms/clustered-grouping/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredGroupingExample.java
+++ b/examples/jms/clustered-grouping/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredGroupingExample.java
@@ -26,21 +26,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.
  */
-public class ClusteredGroupingExample extends ActiveMQExample
+public class ClusteredGroupingExample
 {
-   public static void main(String[] args)
-   {
-      new ClusteredGroupingExample().run(args);
-   }
-
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(String[] args) throws Exception
    {
       Connection connection0 = null;
 
@@ -171,8 +163,6 @@ public class ClusteredGroupingExample extends ActiveMQExample
             System.out.println("Got message: " + message0.getText() + " from node 0");
 
          }
-
-         return true;
       }
       finally
       {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/clustered-grouping/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-grouping/src/main/resources/activemq/server0/broker.xml b/examples/jms/clustered-grouping/src/main/resources/activemq/server0/broker.xml
index 8b67aa5..77fa2e6 100644
--- a/examples/jms/clustered-grouping/src/main/resources/activemq/server0/broker.xml
+++ b/examples/jms/clustered-grouping/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:../data}/bindings</bindings-directory>
+      <journal-directory>${data.dir:./data}/journal</journal-directory>
 
-      <journal-directory>${data.dir:../data}/journal</journal-directory>
+      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
 
-      <large-messages-directory>${data.dir:../data}/largemessages</large-messages-directory>
-
-      <paging-directory>${data.dir:../data}/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-grouping/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-grouping/src/main/resources/activemq/server1/broker.xml b/examples/jms/clustered-grouping/src/main/resources/activemq/server1/broker.xml
index 7ab2e7e..fabd98d 100644
--- a/examples/jms/clustered-grouping/src/main/resources/activemq/server1/broker.xml
+++ b/examples/jms/clustered-grouping/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:../data}/bindings</bindings-directory>
+      <journal-directory>${data.dir:./data}/journal</journal-directory>
 
-      <journal-directory>${data.dir:../data}/journal</journal-directory>
+      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
 
-      <large-messages-directory>${data.dir:../data}/largemessages</large-messages-directory>
-
-      <paging-directory>${data.dir:../data}/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-grouping/src/main/resources/activemq/server2/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-grouping/src/main/resources/activemq/server2/broker.xml b/examples/jms/clustered-grouping/src/main/resources/activemq/server2/broker.xml
index 1776c5c..07d18fc 100644
--- a/examples/jms/clustered-grouping/src/main/resources/activemq/server2/broker.xml
+++ b/examples/jms/clustered-grouping/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>${data.dir:../data}/bindings</bindings-directory>
+      <journal-directory>${data.dir:./data}/journal</journal-directory>
 
-      <journal-directory>${data.dir:../data}/journal</journal-directory>
+      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
 
-      <large-messages-directory>${data.dir:../data}/largemessages</large-messages-directory>
-
-      <paging-directory>${data.dir:../data}/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-jgroups/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-jgroups/pom.xml b/examples/jms/clustered-jgroups/pom.xml
index b19deb3..fc90be7 100644
--- a/examples/jms/clustered-jgroups/pom.xml
+++ b/examples/jms/clustered-jgroups/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>
@@ -71,7 +66,7 @@ under the License.
                         </configuration>
                      </execution>
                      <execution>
-                        <id>create2</id>
+                        <id>create1</id>
                         <goals>
                            <goal>create</goal>
                         </goals>
@@ -82,7 +77,36 @@ under the License.
                            </libList>
                            <instance>${basedir}/target/server1</instance>
                            <configuration>${basedir}/target/classes/activemq/server1</configuration>
-                           <portOffset>1</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>
@@ -92,9 +116,29 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.ClusteredJgroupsExample</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>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/clustered-jgroups/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredJgroupsExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-jgroups/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredJgroupsExample.java b/examples/jms/clustered-jgroups/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredJgroupsExample.java
index 9d7c3dc..5321618 100644
--- a/examples/jms/clustered-jgroups/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredJgroupsExample.java
+++ b/examples/jms/clustered-jgroups/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredJgroupsExample.java
@@ -26,20 +26,12 @@ 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 clustering using jgroups.
  */
-public class ClusteredJgroupsExample extends ActiveMQExample
+public class ClusteredJgroupsExample
 {
-   public static void main(final String[] args)
-   {
-      new ClusteredJgroupsExample().run(args);
-   }
-
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(final String[] args) throws Exception
    {
       Connection connection0 = null;
 
@@ -128,8 +120,6 @@ public class ClusteredJgroupsExample extends ActiveMQExample
 
             System.out.println("Got message: " + message1.getText() + " from node 1");
          }
-
-         return true;
       }
       finally
       {
@@ -156,5 +146,4 @@ public class ClusteredJgroupsExample extends ActiveMQExample
          }
       }
    }
-
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/clustered-jgroups/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-jgroups/src/main/resources/activemq/server0/broker.xml b/examples/jms/clustered-jgroups/src/main/resources/activemq/server0/broker.xml
index 8eb8284..4af9867 100644
--- a/examples/jms/clustered-jgroups/src/main/resources/activemq/server0/broker.xml
+++ b/examples/jms/clustered-jgroups/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>
 
-      <paging-directory>server0/paging</paging-directory>
+      <journal-directory>${data.dir:./data}/journal</journal-directory>
 
-      <bindings-directory>server0/bindings</bindings-directory>
+      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
 
-      <journal-directory>server0/journal</journal-directory>
-
-      <large-messages-directory>server0/large-messages</large-messages-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-jgroups/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-jgroups/src/main/resources/activemq/server1/broker.xml b/examples/jms/clustered-jgroups/src/main/resources/activemq/server1/broker.xml
index b72e119..3393a42 100644
--- a/examples/jms/clustered-jgroups/src/main/resources/activemq/server1/broker.xml
+++ b/examples/jms/clustered-jgroups/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>
 
-      <paging-directory>server1/paging</paging-directory>
+      <journal-directory>${data.dir:./data}/journal</journal-directory>
 
-      <bindings-directory>server1/bindings</bindings-directory>
+      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
 
-      <journal-directory>server1/journal</journal-directory>
-
-      <large-messages-directory>server1/large-messages</large-messages-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-queue/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-queue/pom.xml b/examples/jms/clustered-queue/pom.xml
index d4afa59..7b42875 100644
--- a/examples/jms/clustered-queue/pom.xml
+++ b/examples/jms/clustered-queue/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,14 +62,43 @@ 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>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>
@@ -84,9 +108,29 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.ClusteredQueueExample</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>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/clustered-queue/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredQueueExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-queue/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredQueueExample.java b/examples/jms/clustered-queue/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredQueueExample.java
index 0011865..12a0a45 100644
--- a/examples/jms/clustered-queue/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredQueueExample.java
+++ b/examples/jms/clustered-queue/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredQueueExample.java
@@ -26,21 +26,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.
  */
-public class ClusteredQueueExample extends ActiveMQExample
+public class ClusteredQueueExample
 {
-   public static void main(final String[] args)
-   {
-      new ClusteredQueueExample().run(args);
-   }
-
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(final String[] args) throws Exception
    {
       Connection connection0 = null;
 
@@ -55,7 +47,7 @@ public class ClusteredQueueExample extends ActiveMQExample
          // 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);
 
@@ -68,7 +60,7 @@ public class ClusteredQueueExample extends ActiveMQExample
          // Step 4. Get an initial context for looking up JNDI from server 1
          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");
          ic1 = new InitialContext(properties);
 
          // Step 5. Look-up a JMS Connection Factory object from JNDI on server 1
@@ -129,8 +121,6 @@ public class ClusteredQueueExample extends ActiveMQExample
 
             System.out.println("Got message: " + message1.getText() + " from node 1");
          }
-
-         return true;
       }
       finally
       {
@@ -157,5 +147,4 @@ public class ClusteredQueueExample extends ActiveMQExample
          }
       }
    }
-
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/clustered-queue/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-queue/src/main/resources/activemq/server0/artemis-roles.properties b/examples/jms/clustered-queue/src/main/resources/activemq/server0/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/clustered-queue/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-queue/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-queue/src/main/resources/activemq/server0/artemis-users.properties b/examples/jms/clustered-queue/src/main/resources/activemq/server0/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/clustered-queue/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-queue/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-queue/src/main/resources/activemq/server0/broker.xml b/examples/jms/clustered-queue/src/main/resources/activemq/server0/broker.xml
index f038cfe..db97076 100644
--- a/examples/jms/clustered-queue/src/main/resources/activemq/server0/broker.xml
+++ b/examples/jms/clustered-queue/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>


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

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/multiple-failover/src/main/resources/activemq/server2/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/multiple-failover/src/main/resources/activemq/server2/artemis-roles.properties b/examples/jms/multiple-failover/src/main/resources/activemq/server2/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/multiple-failover/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/multiple-failover/src/main/resources/activemq/server2/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/multiple-failover/src/main/resources/activemq/server2/artemis-users.properties b/examples/jms/multiple-failover/src/main/resources/activemq/server2/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/multiple-failover/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/multiple-failover/src/main/resources/activemq/server2/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/multiple-failover/src/main/resources/activemq/server2/broker.xml b/examples/jms/multiple-failover/src/main/resources/activemq/server2/broker.xml
deleted file mode 100644
index c114ed2..0000000
--- a/examples/jms/multiple-failover/src/main/resources/activemq/server2/broker.xml
+++ /dev/null
@@ -1,93 +0,0 @@
-<?xml version='1.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.
--->
-
-<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-               xmlns="urn:activemq"
-               xsi:schemaLocation="urn:activemq /schema/artemis-server.xsd">
-
-   <jms xmlns="urn:activemq:jms">
-      <!--the queue used by the example-->
-      <queue name="exampleQueue"/>
-   </jms>
-
-   <core xmlns="urn:activemq:core">
-
-      <bindings-directory>../../server0/data/messaging/bindings</bindings-directory>
-
-      <journal-directory>../../server0/data/messaging/journal</journal-directory>
-
-      <large-messages-directory>../../server0/data/messaging/largemessages</large-messages-directory>
-
-      <paging-directory>../../server0/data/messaging/paging</paging-directory>
-
-      <ha-policy>
-         <shared-store>
-            <slave/>
-         </shared-store>
-      </ha-policy>
-
-      <!-- Connectors -->
-      <connectors>
-         <connector name="netty-connector">tcp://localhost:61618</connector>
-      </connectors>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61618</acceptor>
-      </acceptors>
-
-      <broadcast-groups>
-         <broadcast-group name="bg-group1">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <broadcast-period>1000</broadcast-period>
-            <connector-ref>netty-connector</connector-ref>
-         </broadcast-group>
-      </broadcast-groups>
-
-      <discovery-groups>
-         <discovery-group name="dg-group1">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <refresh-timeout>60000</refresh-timeout>
-         </discovery-group>
-      </discovery-groups>
-
-      <cluster-connections>
-         <cluster-connection name="my-cluster">
-            <address>jms</address>
-            <connector-ref>netty-connector</connector-ref>
-            <discovery-group-ref discovery-group-name="dg-group1"/>
-         </cluster-connection>
-      </cluster-connections>
-
-      <security-settings>
-         <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
-            <permission type="createDurableQueue" roles="guest"/>
-            <permission type="deleteDurableQueue" roles="guest"/>
-            <permission type="createNonDurableQueue" roles="guest"/>
-            <permission type="deleteNonDurableQueue" roles="guest"/>
-            <permission type="consume" roles="guest"/>
-            <permission type="send" roles="guest"/>
-         </security-setting>
-      </security-settings>
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/no-consumer-buffering/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/no-consumer-buffering/pom.xml b/examples/jms/no-consumer-buffering/pom.xml
index 6e4818f..19d9178 100644
--- a/examples/jms/no-consumer-buffering/pom.xml
+++ b/examples/jms/no-consumer-buffering/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>
@@ -61,9 +56,18 @@ under the License.
                         <goals>
                            <goal>create</goal>
                         </goals>
+                     </execution>
+                     <execution>
+                        <id>start</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
                         <configuration>
-                           <instance>${basedir}/target/server0</instance>
-                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                           <spawn>true</spawn>
+                           <testURI>tcp://localhost:61616</testURI>
+                           <args>
+                              <param>run</param>
+                           </args>
                         </configuration>
                      </execution>
                      <execution>
@@ -73,8 +77,16 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.NoConsumerBufferingExample</clientClass>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>stop</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
                            <args>
-                              <param>${basedir}/target/server0</param>
+                              <param>stop</param>
                            </args>
                         </configuration>
                      </execution>
@@ -91,5 +103,4 @@ under the License.
          </build>
       </profile>
    </profiles>
-
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/no-consumer-buffering/src/main/java/org/apache/activemq/artemis/jms/example/NoConsumerBufferingExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/no-consumer-buffering/src/main/java/org/apache/activemq/artemis/jms/example/NoConsumerBufferingExample.java b/examples/jms/no-consumer-buffering/src/main/java/org/apache/activemq/artemis/jms/example/NoConsumerBufferingExample.java
index b4bc203..525a9c4 100644
--- a/examples/jms/no-consumer-buffering/src/main/java/org/apache/activemq/artemis/jms/example/NoConsumerBufferingExample.java
+++ b/examples/jms/no-consumer-buffering/src/main/java/org/apache/activemq/artemis/jms/example/NoConsumerBufferingExample.java
@@ -25,21 +25,13 @@ import javax.jms.Session;
 import javax.jms.TextMessage;
 import javax.naming.InitialContext;
 
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
-
 /**
  * This example demonstrates how ActiveMQ Artemis consumers can be configured to not buffer any messages from
  * the server.
  */
-public class NoConsumerBufferingExample extends ActiveMQExample
+public class NoConsumerBufferingExample
 {
-   public static void main(final String[] args)
-   {
-      new NoConsumerBufferingExample().run(args);
-   }
-
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(final String[] args) throws Exception
    {
       Connection connection = null;
       InitialContext initialContext = null;
@@ -114,8 +106,6 @@ public class NoConsumerBufferingExample extends ActiveMQExample
 
             System.out.println("Consumed message from consumer1: " + message.getText());
          }
-
-         return true;
       }
       finally
       {
@@ -131,5 +121,4 @@ public class NoConsumerBufferingExample extends ActiveMQExample
          }
       }
    }
-
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/no-consumer-buffering/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/no-consumer-buffering/src/main/resources/activemq/server0/artemis-roles.properties b/examples/jms/no-consumer-buffering/src/main/resources/activemq/server0/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/no-consumer-buffering/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/no-consumer-buffering/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/no-consumer-buffering/src/main/resources/activemq/server0/artemis-users.properties b/examples/jms/no-consumer-buffering/src/main/resources/activemq/server0/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/no-consumer-buffering/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/no-consumer-buffering/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/no-consumer-buffering/src/main/resources/activemq/server0/broker.xml b/examples/jms/no-consumer-buffering/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index 7690094..0000000
--- a/examples/jms/no-consumer-buffering/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,60 +0,0 @@
-<?xml version='1.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.
--->
-
-<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-               xmlns="urn:activemq"
-               xsi:schemaLocation="urn:activemq /schema/artemis-server.xsd">
-
-   <jms xmlns="urn:activemq:jms">
-      <!--the queue used by the example-->
-      <queue name="exampleQueue"/>
-   </jms>
-
-   <core xmlns="urn:activemq:core">
-
-      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
-
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
-
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
-
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
-      </acceptors>
-
-      <!-- Other config -->
-
-      <security-settings>
-         <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
-            <permission type="createDurableQueue" roles="guest"/>
-            <permission type="deleteDurableQueue" roles="guest"/>
-            <permission type="createNonDurableQueue" roles="guest"/>
-            <permission type="deleteNonDurableQueue" roles="guest"/>
-            <permission type="consume" roles="guest"/>
-            <permission type="send" roles="guest"/>
-         </security-setting>
-      </security-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/non-transaction-failover/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/non-transaction-failover/pom.xml b/examples/jms/non-transaction-failover/pom.xml
index 675dc23..72d4636 100644
--- a/examples/jms/non-transaction-failover/pom.xml
+++ b/examples/jms/non-transaction-failover/pom.xml
@@ -27,7 +27,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>non-transaction-failover</artifactId>
+   <artifactId>artemis-jms-non-transaction-failover-example</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS Non Transaction Failover Example</name>
 
@@ -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,13 +57,16 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>create</id>
+                        <id>create0</id>
                         <goals>
                            <goal>create</goal>
                         </goals>
                         <configuration>
                            <instance>${basedir}/target/server0</instance>
-                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                           <sharedStore>true</sharedStore>
+                           <slave>false</slave>
+                           <dataFolder>../data</dataFolder>
+                           <failoverOnShutdown>true</failoverOnShutdown>
                         </configuration>
                      </execution>
                      <execution>
@@ -73,7 +76,10 @@ under the License.
                         </goals>
                         <configuration>
                            <instance>${basedir}/target/server1</instance>
-                           <configuration>${basedir}/target/classes/activemq/server1</configuration>
+                           <sharedStore>true</sharedStore>
+                           <slave>true</slave>
+                           <dataFolder>../data</dataFolder>
+                           <failoverOnShutdown>true</failoverOnShutdown>
                         </configuration>
                      </execution>
                      <execution>
@@ -93,7 +99,7 @@ under the License.
                   <dependencies>
                      <dependency>
                         <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>non-transaction-failover</artifactId>
+                        <artifactId>artemis-jms-non-transaction-failover-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
                    </dependencies>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/non-transaction-failover/src/main/java/org/apache/activemq/artemis/jms/example/NonTransactionFailoverExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/non-transaction-failover/src/main/java/org/apache/activemq/artemis/jms/example/NonTransactionFailoverExample.java b/examples/jms/non-transaction-failover/src/main/java/org/apache/activemq/artemis/jms/example/NonTransactionFailoverExample.java
index e690fd6..c556072 100644
--- a/examples/jms/non-transaction-failover/src/main/java/org/apache/activemq/artemis/jms/example/NonTransactionFailoverExample.java
+++ b/examples/jms/non-transaction-failover/src/main/java/org/apache/activemq/artemis/jms/example/NonTransactionFailoverExample.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.JMSException;
@@ -26,40 +28,29 @@ import javax.jms.Session;
 import javax.jms.TextMessage;
 import javax.naming.InitialContext;
 
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
-
 /**
  * A simple example that demonstrates failover of the JMS connection from one node to another
  * when the live server crashes using a JMS <em>non-transacted</em> session.
  */
-public class NonTransactionFailoverExample extends ActiveMQExample
+public class NonTransactionFailoverExample
 {
    public static void main(final String[] args) throws Exception
    {
-      new NonTransactionFailoverExample().run(args);
-   }
-
-   protected void startServers(String[] serversArgs) throws Exception
-   {
-      for (int i = 0; i < serversArgs.length; i++)
-      {
-         startServer(i, i == 0 ? 5000 : 0);
-      }
-
-      Thread.sleep(5000);
-   }
-
-   @Override
-   public boolean runExample() throws Exception
-   {
       final int numMessages = 10;
 
       Connection connection = null;
 
       InitialContext initialContext = null;
 
+      Process[] servers = new Process[2];
+
       try
       {
+         for (int i = 0; i < args.length; i++)
+         {
+            servers[i] = ServerUtil.startServer(args[i], NonTransactionFailoverExample.class.getSimpleName() + i, i, 5000);
+         }
+
          // Step 1. Get an initial context for looking up JNDI from the server #1
          initialContext = new InitialContext();
 
@@ -106,9 +97,7 @@ public class NonTransactionFailoverExample extends ActiveMQExample
 
          // Step 10. Crash server #1, the live server, and wait a little while to make sure
          // pending Acks are on the server's side
-         Thread.sleep(2000);
-         killServer(0);
-         Thread.sleep(5000);
+         ServerUtil.killServer(servers[0]);
 
          // Step 11. Acknowledging the 2nd half of the sent messages will fail as failover to the
          // backup server has occurred
@@ -128,8 +117,6 @@ public class NonTransactionFailoverExample extends ActiveMQExample
             System.out.printf("Got message: %s (redelivered?: %s)%n", message0.getText(), message0.getJMSRedelivered());
          }
          message0.acknowledge();
-
-         return true;
       }
       finally
       {
@@ -144,7 +131,11 @@ public class NonTransactionFailoverExample extends ActiveMQExample
          {
             initialContext.close();
          }
+
+         for (int i = 0; i < args.length; i++)
+         {
+            ServerUtil.killServer(servers[i]);
+         }
       }
    }
-
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/non-transaction-failover/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/non-transaction-failover/src/main/resources/activemq/server0/artemis-roles.properties b/examples/jms/non-transaction-failover/src/main/resources/activemq/server0/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/non-transaction-failover/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/non-transaction-failover/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/non-transaction-failover/src/main/resources/activemq/server0/artemis-users.properties b/examples/jms/non-transaction-failover/src/main/resources/activemq/server0/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/non-transaction-failover/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/non-transaction-failover/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/non-transaction-failover/src/main/resources/activemq/server0/broker.xml b/examples/jms/non-transaction-failover/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index 00e724b..0000000
--- a/examples/jms/non-transaction-failover/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,93 +0,0 @@
-<?xml version='1.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.
--->
-
-<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-               xmlns="urn:activemq"
-               xsi:schemaLocation="urn:activemq /schema/artemis-server.xsd">
-
-   <jms xmlns="urn:activemq:jms">
-      <!--the queue used by the example-->
-      <queue name="exampleQueue"/>
-   </jms>
-
-   <core xmlns="urn:activemq:core">
-
-      <ha-policy>
-         <shared-store>
-            <master/>
-         </shared-store>
-      </ha-policy>
-
-      <!-- Connectors -->
-
-      <connectors>
-         <connector name="netty-connector">tcp://localhost:61616</connector>
-      </connectors>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
-      </acceptors>
-
-      <broadcast-groups>
-         <broadcast-group name="bg-group1">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <broadcast-period>1000</broadcast-period>
-            <connector-ref>netty-connector</connector-ref>
-         </broadcast-group>
-      </broadcast-groups>
-
-      <discovery-groups>
-         <discovery-group name="dg-group1">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <refresh-timeout>60000</refresh-timeout>
-         </discovery-group>
-      </discovery-groups>
-
-      <cluster-connections>
-         <cluster-connection name="my-cluster">
-            <address>jms</address>
-            <connector-ref>netty-connector</connector-ref>
-            <discovery-group-ref discovery-group-name="dg-group1"/>
-         </cluster-connection>
-      </cluster-connections>
-
-      <large-messages-directory>../../server0/data/large-messages</large-messages-directory>
-      <bindings-directory>../../server0/data/bindings</bindings-directory>
-      <journal-directory>../../server0/data/journal</journal-directory>
-      <paging-directory>../../server0/data/paging</paging-directory>
-      <!-- Other config -->
-
-      <security-settings>
-         <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
-            <permission type="createDurableQueue" roles="guest"/>
-            <permission type="deleteDurableQueue" roles="guest"/>
-            <permission type="createNonDurableQueue" roles="guest"/>
-            <permission type="deleteNonDurableQueue" roles="guest"/>
-            <permission type="consume" roles="guest"/>
-            <permission type="send" roles="guest"/>
-         </security-setting>
-      </security-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/non-transaction-failover/src/main/resources/activemq/server1/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/non-transaction-failover/src/main/resources/activemq/server1/artemis-roles.properties b/examples/jms/non-transaction-failover/src/main/resources/activemq/server1/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/non-transaction-failover/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/non-transaction-failover/src/main/resources/activemq/server1/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/non-transaction-failover/src/main/resources/activemq/server1/artemis-users.properties b/examples/jms/non-transaction-failover/src/main/resources/activemq/server1/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/non-transaction-failover/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/non-transaction-failover/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/non-transaction-failover/src/main/resources/activemq/server1/broker.xml b/examples/jms/non-transaction-failover/src/main/resources/activemq/server1/broker.xml
deleted file mode 100644
index 0406b8f..0000000
--- a/examples/jms/non-transaction-failover/src/main/resources/activemq/server1/broker.xml
+++ /dev/null
@@ -1,94 +0,0 @@
-<?xml version='1.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.
--->
-
-<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-               xmlns="urn:activemq"
-               xsi:schemaLocation="urn:activemq /schema/artemis-server.xsd">
-
-   <jms xmlns="urn:activemq:jms">
-      <!--the queue used by the example-->
-      <queue name="exampleQueue"/>
-   </jms>
-
-   <core xmlns="urn:activemq:core">
-
-      <ha-policy>
-         <shared-store>
-            <slave/>
-         </shared-store>
-      </ha-policy>
-
-      <!-- Connectors -->
-
-      <connectors>
-         <connector name="netty-connector">tcp://localhost:61617</connector>
-      </connectors>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61617</acceptor>
-      </acceptors>
-
-      <broadcast-groups>
-         <broadcast-group name="bg-group1">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <broadcast-period>1000</broadcast-period>
-            <connector-ref>netty-connector</connector-ref>
-         </broadcast-group>
-      </broadcast-groups>
-
-      <discovery-groups>
-         <discovery-group name="dg-group1">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <refresh-timeout>60000</refresh-timeout>
-         </discovery-group>
-      </discovery-groups>
-
-      <cluster-connections>
-         <cluster-connection name="my-cluster">
-            <address>jms</address>
-            <connector-ref>netty-connector</connector-ref>
-            <discovery-group-ref discovery-group-name="dg-group1"/>
-         </cluster-connection>
-      </cluster-connections>
-
-      <large-messages-directory>../../server0/data/large-messages</large-messages-directory>
-      <bindings-directory>../../server0/data/bindings</bindings-directory>
-      <journal-directory>../../server0/data/journal</journal-directory>
-      <paging-directory>../../server0/data/paging</paging-directory>
-
-      <!-- Other config -->
-
-      <security-settings>
-         <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
-            <permission type="createDurableQueue" roles="guest"/>
-            <permission type="deleteDurableQueue" roles="guest"/>
-            <permission type="createNonDurableQueue" roles="guest"/>
-            <permission type="deleteNonDurableQueue" roles="guest"/>
-            <permission type="consume" roles="guest"/>
-            <permission type="send" roles="guest"/>
-         </security-setting>
-      </security-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/openwire/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/openwire/pom.xml b/examples/jms/openwire/pom.xml
index 1ee5cfc..3888f12 100644
--- a/examples/jms/openwire/pom.xml
+++ b/examples/jms/openwire/pom.xml
@@ -35,6 +35,17 @@ under the License.
       <activemq.basedir>${project.basedir}/../../..</activemq.basedir>
    </properties>
 
+   <dependencies>
+      <dependency>
+         <groupId>org.apache.geronimo.specs</groupId>
+         <artifactId>geronimo-jms_2.0_spec</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>activemq-client</artifactId>
+      </dependency>
+   </dependencies>
+
    <profiles>
       <profile>
          <id>example</id>
@@ -49,9 +60,18 @@ under the License.
                         <goals>
                            <goal>create</goal>
                         </goals>
+                     </execution>
+                     <execution>
+                        <id>start</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
                         <configuration>
-                           <instance>${basedir}/target/server0</instance>
-                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                           <spawn>true</spawn>
+                           <testURI>tcp://localhost:61616</testURI>
+                           <args>
+                              <param>run</param>
+                           </args>
                         </configuration>
                      </execution>
                      <execution>
@@ -61,8 +81,16 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.OpenWireExample</clientClass>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>stop</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
                            <args>
-                              <param>${basedir}/target/server0</param>
+                              <param>stop</param>
                            </args>
                         </configuration>
                      </execution>
@@ -79,21 +107,4 @@ under the License.
          </build>
       </profile>
    </profiles>
-   <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>
-      <dependency>
-         <groupId>org.apache.activemq</groupId>
-         <artifactId>activemq-client</artifactId>
-      </dependency>
-   </dependencies>
-
-
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/openwire/src/main/java/org/apache/activemq/artemis/jms/example/OpenWireExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/openwire/src/main/java/org/apache/activemq/artemis/jms/example/OpenWireExample.java b/examples/jms/openwire/src/main/java/org/apache/activemq/artemis/jms/example/OpenWireExample.java
index bd3b223..202e1b0 100644
--- a/examples/jms/openwire/src/main/java/org/apache/activemq/artemis/jms/example/OpenWireExample.java
+++ b/examples/jms/openwire/src/main/java/org/apache/activemq/artemis/jms/example/OpenWireExample.java
@@ -26,24 +26,19 @@ import javax.jms.TextMessage;
 
 import org.apache.activemq.ActiveMQConnectionFactory;
 import org.apache.activemq.command.ActiveMQQueue;
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
+
+import java.lang.Exception;
 
 /**
  * A simple JMS Queue example that creates a producer and consumer on a queue
  * and sends then receives a message.
  */
-public class OpenWireExample extends ActiveMQExample
+public class OpenWireExample
 {
    public static final String OWHOST = "localhost";
    public static final int OWPORT = 61616;
 
-   public static void main(final String[] args)
-   {
-      new OpenWireExample().run(args);
-   }
-
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(final String[] args) throws Exception
    {
       Connection connection = null;
 
@@ -84,8 +79,6 @@ public class OpenWireExample extends ActiveMQExample
          TextMessage messageReceived = (TextMessage) messageConsumer.receive(5000);
 
          System.out.println("Received message: " + messageReceived.getText());
-
-         return true;
       }
       finally
       {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/paging/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/paging/pom.xml b/examples/jms/paging/pom.xml
index 83103ed..954aad9 100644
--- a/examples/jms/paging/pom.xml
+++ b/examples/jms/paging/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>
@@ -61,9 +56,18 @@ under the License.
                         <goals>
                            <goal>create</goal>
                         </goals>
+                     </execution>
+                     <execution>
+                        <id>start</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
                         <configuration>
-                           <instance>${basedir}/target/server0</instance>
-                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                           <spawn>true</spawn>
+                           <testURI>tcp://localhost:61616</testURI>
+                           <args>
+                              <param>run</param>
+                           </args>
                         </configuration>
                      </execution>
                      <execution>
@@ -73,8 +77,16 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.PagingExample</clientClass>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>stop</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
                            <args>
-                              <param>${basedir}/target/server0</param>
+                              <param>stop</param>
                            </args>
                         </configuration>
                      </execution>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/paging/src/main/java/org/apache/activemq/artemis/jms/example/PagingExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/paging/src/main/java/org/apache/activemq/artemis/jms/example/PagingExample.java b/examples/jms/paging/src/main/java/org/apache/activemq/artemis/jms/example/PagingExample.java
index d627c5a..77f8eb6 100644
--- a/examples/jms/paging/src/main/java/org/apache/activemq/artemis/jms/example/PagingExample.java
+++ b/examples/jms/paging/src/main/java/org/apache/activemq/artemis/jms/example/PagingExample.java
@@ -26,20 +26,12 @@ import javax.jms.Queue;
 import javax.jms.Session;
 import javax.naming.InitialContext;
 
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
-
 /**
  * A simple JMS Queue example that creates a producer and consumer on a queue and sends then receives a message.
  */
-public class PagingExample extends ActiveMQExample
+public class PagingExample
 {
-   public static void main(final String[] args)
-   {
-      new PagingExample().run(args);
-   }
-
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(final String[] args) throws Exception
    {
       Connection connection = null;
 
@@ -133,9 +125,6 @@ public class PagingExample extends ActiveMQExample
 
             message.acknowledge();
          }
-
-         return true;
-
       }
       finally
       {
@@ -153,5 +142,4 @@ public class PagingExample extends ActiveMQExample
          }
       }
    }
-
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/perf/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/perf/pom.xml b/examples/jms/perf/pom.xml
index 2db189a..b348a70 100644
--- a/examples/jms/perf/pom.xml
+++ b/examples/jms/perf/pom.xml
@@ -38,6 +38,16 @@ under the License.
    <dependencies>
       <dependency>
          <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-server</artifactId>
+         <version>${project.version}</version>
+      </dependency>
+      <dependency>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-server</artifactId>
+         <version>${project.version}</version>
+      </dependency>
+      <dependency>
+         <groupId>org.apache.activemq</groupId>
          <artifactId>artemis-core-client</artifactId>
          <version>${project.version}</version>
       </dependency>
@@ -55,11 +65,6 @@ under the License.
          <groupId>org.apache.geronimo.specs</groupId>
          <artifactId>geronimo-jms_2.0_spec</artifactId>
       </dependency>
-      <dependency>
-         <groupId>org.apache.activemq.examples.jms</groupId>
-         <artifactId>common</artifactId>
-         <version>${project.version}</version>
-      </dependency>
    </dependencies>
 
    <profiles>
@@ -76,10 +81,6 @@ under the License.
                            <goals>
                               <goal>create</goal>
                            </goals>
-                           <configuration>
-                              <instance>${basedir}/target/server0</instance>
-                              <configuration>${basedir}/target/classes/activemq/server0</configuration>
-                           </configuration>
                         </execution>
                         <execution>
                            <id>runClient</id>
@@ -88,9 +89,6 @@ under the License.
                            </goals>
                            <configuration>
                               <clientClass>org.apache.activemq.artemis.jms.example.Server</clientClass>
-                              <args>
-                                 <param>${basedir}/target/server0</param>
-                              </args>
                            </configuration>
                         </execution>
                      </executions>
@@ -100,6 +98,11 @@ under the License.
                            <artifactId>artemis-jms-perf-example</artifactId>
                            <version>${project.version}</version>
                         </dependency>
+                        <dependency>
+                           <groupId>org.apache.activemq</groupId>
+                           <artifactId>artemis-core-client</artifactId>
+                           <version>${project.version}</version>
+                        </dependency>
                      </dependencies>
                </plugin>
             </plugins>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/pom.xml b/examples/jms/pom.xml
index 4103a8f..4c8db04 100644
--- a/examples/jms/pom.xml
+++ b/examples/jms/pom.xml
@@ -41,10 +41,9 @@ under the License.
       <profile>
          <id>release</id>
          <modules>
-            <module>common</module>
             <module>aerogear</module>
-            <module>artemis-ra-rar</module>
             <module>application-layer-failover</module>
+            <module>artemis-ra-rar</module>
             <module>bridge</module>
             <module>browser</module>
             <module>client-kickoff</module>
@@ -141,7 +140,6 @@ under the License.
             <activeByDefault>true</activeByDefault>
          </activation>
          <modules>
-            <module>common</module>
             <module>application-layer-failover</module>
             <module>bridge</module>
             <module>browser</module>
@@ -150,11 +148,14 @@ under the License.
             <module>client-side-failoverlistener</module>
             <module>clustered-durable-subscription</module>
             <module>clustered-grouping</module>
+            <module>clustered-jgroups</module>
             <module>clustered-queue</module>
             <module>clustered-standalone</module>
             <module>clustered-static-oneway</module>
             <module>clustered-static-discovery</module>
             <module>clustered-topic</module>
+            <module>colocated-failover</module>
+            <module>colocated-failover-scale-down</module>
             <module>consumer-rate-limit</module>
             <module>dead-letter</module>
             <module>delayed-redelivery</module>
@@ -163,10 +164,15 @@ under the License.
             <module>embedded</module>
             <module>embedded-simple</module>
             <module>expiry</module>
+            <module>ha-policy-autobackup</module>
             <module>http-transport</module>
             <module>interceptor</module>
+            <module>jms-auto-closeable</module>
             <module>instantiate-connection-factory</module>
             <module>jms-bridge</module>
+            <module>jms-completion-listener</module>
+            <module>jms-context</module>
+            <module>jms-shared-consumer</module>
             <module>jmx</module>
             <module>large-message</module>
             <module>last-value-queue</module>
@@ -180,27 +186,39 @@ under the License.
             <module>multiple-failover-failback</module>
             <module>no-consumer-buffering</module>
             <module>non-transaction-failover</module>
+            <module>openwire</module>
             <module>paging</module>
             <!--run this standalone-->
             <!--<module>perf</module>-->
+            <module>pre-acknowledge</module>
             <module>producer-rate-limit</module>
+            <module>proton-cpp</module>
+            <module>proton-j</module>
+            <module>proton-ruby</module>
             <module>queue</module>
             <module>queue-message-redistribution</module>
             <module>queue-requestor</module>
             <module>queue-selector</module>
             <module>reattach-node</module>
+            <module>replicated-failback</module>
+            <module>replicated-failback-static</module>
             <module>replicated-multiple-failover</module>
             <module>replicated-transaction-failover</module>
             <module>request-reply</module>
+            <module>rest</module>
+            <module>scale-down</module>
             <module>scheduled-message</module>
             <module>security</module>
             <module>send-acknowledgements</module>
             <module>spring-integration</module>
             <module>ssl-enabled</module>
+            <module>static-selector</module>
+            <module>static-selector-jms</module>
             <module>stomp</module>
             <!--this should be run standalone-->
             <!--<module>stomp-websockets</module>-->
             <module>stomp1.1</module>
+            <module>stomp1.2</module>
             <!--this needs to be run standalone as it needs manual intervention-->
             <!--<module>stop-server-failover</module>-->
             <module>symmetric-cluster</module>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/pre-acknowledge/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/pre-acknowledge/pom.xml b/examples/jms/pre-acknowledge/pom.xml
index 030d77f..b181706 100644
--- a/examples/jms/pre-acknowledge/pom.xml
+++ b/examples/jms/pre-acknowledge/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-jms-client</artifactId>
          <version>${project.version}</version>
       </dependency>
       <dependency>
@@ -61,9 +61,18 @@ under the License.
                         <goals>
                            <goal>create</goal>
                         </goals>
+                     </execution>
+                     <execution>
+                        <id>start</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
                         <configuration>
-                           <instance>${basedir}/target/server0</instance>
-                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                           <spawn>true</spawn>
+                           <testURI>tcp://localhost:61616</testURI>
+                           <args>
+                              <param>run</param>
+                           </args>
                         </configuration>
                      </execution>
                      <execution>
@@ -73,8 +82,16 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.PreacknowledgeExample</clientClass>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>stop</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
                            <args>
-                              <param>${basedir}/target/server0</param>
+                              <param>stop</param>
                            </args>
                         </configuration>
                      </execution>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/pre-acknowledge/src/main/java/org/apache/activemq/artemis/jms/example/PreacknowledgeExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/pre-acknowledge/src/main/java/org/apache/activemq/artemis/jms/example/PreacknowledgeExample.java b/examples/jms/pre-acknowledge/src/main/java/org/apache/activemq/artemis/jms/example/PreacknowledgeExample.java
index 076c989..446cec0 100644
--- a/examples/jms/pre-acknowledge/src/main/java/org/apache/activemq/artemis/jms/example/PreacknowledgeExample.java
+++ b/examples/jms/pre-acknowledge/src/main/java/org/apache/activemq/artemis/jms/example/PreacknowledgeExample.java
@@ -32,7 +32,6 @@ import javax.naming.InitialContext;
 import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
 import org.apache.activemq.artemis.api.jms.ActiveMQJMSConstants;
 import org.apache.activemq.artemis.api.jms.management.JMSManagementHelper;
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
 
 /**
  * This example demonstrates the use of ActiveMQ Artemis "pre-acknowledge" functionality where
@@ -40,15 +39,9 @@ import org.apache.activemq.artemis.common.example.ActiveMQExample;
  *
  * Please see the readme.html for more details.
  */
-public class PreacknowledgeExample extends ActiveMQExample
+public class PreacknowledgeExample
 {
-   public static void main(final String[] args)
-   {
-      new PreacknowledgeExample().run(args);
-   }
-
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(final String[] args) throws Exception
    {
       Connection connection = null;
 
@@ -98,15 +91,13 @@ public class PreacknowledgeExample extends ActiveMQExample
 
          if (count != 0)
          {
-            return false;
+            throw new IllegalStateException("Queue message count is not 0.");
          }
 
          // Step 8. Finally, receive the message
          TextMessage messageReceived = (TextMessage)messageConsumer.receive(5000);
 
          System.out.println("Received message: " + messageReceived.getText());
-
-         return true;
       }
       finally
       {
@@ -124,7 +115,7 @@ public class PreacknowledgeExample extends ActiveMQExample
 
    // To do this we send a management message to get the message count.
    // In real life you wouldn't create a new session every time you send a management message
-   private int getMessageCount(final Connection connection) throws Exception
+   private static int getMessageCount(final Connection connection) throws Exception
    {
       QueueSession session = ((QueueConnection)connection).createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/producer-rate-limit/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/producer-rate-limit/pom.xml b/examples/jms/producer-rate-limit/pom.xml
index 535a7d5..d407ea3 100644
--- a/examples/jms/producer-rate-limit/pom.xml
+++ b/examples/jms/producer-rate-limit/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>
@@ -61,9 +56,18 @@ under the License.
                         <goals>
                            <goal>create</goal>
                         </goals>
+                     </execution>
+                     <execution>
+                        <id>start</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
                         <configuration>
-                           <instance>${basedir}/target/server0</instance>
-                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                           <spawn>true</spawn>
+                           <testURI>tcp://localhost:61616</testURI>
+                           <args>
+                              <param>run</param>
+                           </args>
                         </configuration>
                      </execution>
                      <execution>
@@ -73,8 +77,16 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.ProducerRateLimitExample</clientClass>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>stop</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
                            <args>
-                              <param>${basedir}/target/server0</param>
+                              <param>stop</param>
                            </args>
                         </configuration>
                      </execution>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/producer-rate-limit/src/main/java/org/apache/activemq/artemis/jms/example/ProducerRateLimitExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/producer-rate-limit/src/main/java/org/apache/activemq/artemis/jms/example/ProducerRateLimitExample.java b/examples/jms/producer-rate-limit/src/main/java/org/apache/activemq/artemis/jms/example/ProducerRateLimitExample.java
index 3640cdc..c949122 100644
--- a/examples/jms/producer-rate-limit/src/main/java/org/apache/activemq/artemis/jms/example/ProducerRateLimitExample.java
+++ b/examples/jms/producer-rate-limit/src/main/java/org/apache/activemq/artemis/jms/example/ProducerRateLimitExample.java
@@ -25,21 +25,13 @@ import javax.jms.Session;
 import javax.jms.TextMessage;
 import javax.naming.InitialContext;
 
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
-
 /**
  * This example demonstrates how a message producer can be limited to produce messages at a maximum rate
  * specified in messages per sec.
  */
-public class ProducerRateLimitExample extends ActiveMQExample
+public class ProducerRateLimitExample
 {
-   public static void main(final String[] args)
-   {
-      new ProducerRateLimitExample().run(args);
-   }
-
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(final String[] args) throws Exception
    {
       Connection connection = null;
       InitialContext initialContext = null;
@@ -110,8 +102,6 @@ public class ProducerRateLimitExample extends ActiveMQExample
          }
 
          System.out.println("Received " + i + " messages");
-
-         return true;
       }
       finally
       {
@@ -126,5 +116,4 @@ public class ProducerRateLimitExample extends ActiveMQExample
          }
       }
    }
-
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/producer-rate-limit/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/producer-rate-limit/src/main/resources/activemq/server0/artemis-roles.properties b/examples/jms/producer-rate-limit/src/main/resources/activemq/server0/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/producer-rate-limit/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/producer-rate-limit/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/producer-rate-limit/src/main/resources/activemq/server0/artemis-users.properties b/examples/jms/producer-rate-limit/src/main/resources/activemq/server0/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/producer-rate-limit/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/producer-rate-limit/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/producer-rate-limit/src/main/resources/activemq/server0/broker.xml b/examples/jms/producer-rate-limit/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index 7690094..0000000
--- a/examples/jms/producer-rate-limit/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,60 +0,0 @@
-<?xml version='1.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.
--->
-
-<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-               xmlns="urn:activemq"
-               xsi:schemaLocation="urn:activemq /schema/artemis-server.xsd">
-
-   <jms xmlns="urn:activemq:jms">
-      <!--the queue used by the example-->
-      <queue name="exampleQueue"/>
-   </jms>
-
-   <core xmlns="urn:activemq:core">
-
-      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
-
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
-
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
-
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
-      </acceptors>
-
-      <!-- Other config -->
-
-      <security-settings>
-         <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
-            <permission type="createDurableQueue" roles="guest"/>
-            <permission type="deleteDurableQueue" roles="guest"/>
-            <permission type="createNonDurableQueue" roles="guest"/>
-            <permission type="deleteNonDurableQueue" roles="guest"/>
-            <permission type="consume" roles="guest"/>
-            <permission type="send" roles="guest"/>
-         </security-setting>
-      </security-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/proton-cpp/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/proton-cpp/pom.xml b/examples/jms/proton-cpp/pom.xml
index c5e41a4..240667d 100644
--- a/examples/jms/proton-cpp/pom.xml
+++ b/examples/jms/proton-cpp/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-jms-client</artifactId>
          <version>${project.version}</version>
       </dependency>
       <dependency>
@@ -61,9 +61,18 @@ under the License.
                         <goals>
                            <goal>create</goal>
                         </goals>
+                     </execution>
+                     <execution>
+                        <id>start</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
                         <configuration>
-                           <instance>${basedir}/target/server0</instance>
-                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                           <spawn>true</spawn>
+                           <testURI>tcp://localhost:61616</testURI>
+                           <args>
+                              <param>run</param>
+                           </args>
                         </configuration>
                      </execution>
                      <execution>
@@ -73,8 +82,16 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.ProtonCPPExample</clientClass>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>stop</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
                            <args>
-                              <param>${basedir}/target/server0</param>
+                              <param>stop</param>
                            </args>
                         </configuration>
                      </execution>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/proton-cpp/src/main/java/org/apache/activemq/artemis/jms/example/ProtonCPPExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/proton-cpp/src/main/java/org/apache/activemq/artemis/jms/example/ProtonCPPExample.java b/examples/jms/proton-cpp/src/main/java/org/apache/activemq/artemis/jms/example/ProtonCPPExample.java
index b23dc55..79c6bbc 100644
--- a/examples/jms/proton-cpp/src/main/java/org/apache/activemq/artemis/jms/example/ProtonCPPExample.java
+++ b/examples/jms/proton-cpp/src/main/java/org/apache/activemq/artemis/jms/example/ProtonCPPExample.java
@@ -30,7 +30,6 @@ import javax.naming.InitialContext;
 
 import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
 import org.apache.activemq.artemis.api.jms.management.JMSManagementHelper;
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
 
 /**
  * This example demonstrates the use of ActiveMQ Artemis "pre-acknowledge" functionality where
@@ -38,15 +37,9 @@ import org.apache.activemq.artemis.common.example.ActiveMQExample;
  *
  * Please see the readme.html for more details.
  */
-public class ProtonCPPExample extends ActiveMQExample
+public class ProtonCPPExample
 {
-   public static void main(final String[] args)
-   {
-      new ProtonCPPExample().run(args);
-   }
-
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(final String[] args) throws Exception
    {
       Connection connection = null;
 
@@ -95,8 +88,6 @@ public class ProtonCPPExample extends ActiveMQExample
             // Sending message back to client
             producerAnswer.send(session.createTextMessage("HELLO from Apache ActiveMQ Artemis"));
          }
-
-         return true;
       }
       finally
       {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/proton-cpp/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/proton-cpp/src/main/resources/activemq/server0/artemis-roles.properties b/examples/jms/proton-cpp/src/main/resources/activemq/server0/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/proton-cpp/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/proton-cpp/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/proton-cpp/src/main/resources/activemq/server0/artemis-users.properties b/examples/jms/proton-cpp/src/main/resources/activemq/server0/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/proton-cpp/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/proton-cpp/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/proton-cpp/src/main/resources/activemq/server0/broker.xml b/examples/jms/proton-cpp/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index eafc6c8..0000000
--- a/examples/jms/proton-cpp/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,61 +0,0 @@
-<?xml version='1.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.
--->
-
-<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-               xmlns="urn:activemq"
-               xsi:schemaLocation="urn:activemq /schema/artemis-server.xsd">
-
-   <jms xmlns="urn:activemq:jms">
-      <!--the queue used by the example-->
-      <queue name="exampleQueue"/>
-   </jms>
-
-   <core xmlns="urn:activemq:core">
-
-      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
-
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
-
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
-
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
-
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="proton-acceptor">tcp://localhost:61616</acceptor>
-      </acceptors>
-
-      <!-- Other config -->
-
-      <security-settings>
-         <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
-            <permission type="createDurableQueue" roles="guest"/>
-            <permission type="deleteDurableQueue" roles="guest"/>
-            <permission type="createNonDurableQueue" roles="guest"/>
-            <permission type="deleteNonDurableQueue" roles="guest"/>
-            <permission type="consume" roles="guest"/>
-            <permission type="send" roles="guest"/>
-         </security-setting>
-      </security-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/proton-j/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/proton-j/pom.xml b/examples/jms/proton-j/pom.xml
index 3001867..2cdf0c8 100644
--- a/examples/jms/proton-j/pom.xml
+++ b/examples/jms/proton-j/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.qpid</groupId>
          <artifactId>qpid-amqp-1-0-client</artifactId>
          <version>0.22</version>
@@ -62,9 +57,18 @@ under the License.
                         <goals>
                            <goal>create</goal>
                         </goals>
+                     </execution>
+                     <execution>
+                        <id>start</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
                         <configuration>
-                           <instance>${basedir}/target/server0</instance>
-                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                           <spawn>true</spawn>
+                           <testURI>tcp://localhost:61616</testURI>
+                           <args>
+                              <param>run</param>
+                           </args>
                         </configuration>
                      </execution>
                      <execution>
@@ -74,8 +78,16 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.ProtonJExample</clientClass>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>stop</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
                            <args>
-                              <param>${basedir}/target/server0</param>
+                              <param>stop</param>
                            </args>
                         </configuration>
                      </execution>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/proton-j/src/main/java/org/apache/activemq/artemis/jms/example/ProtonJExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/proton-j/src/main/java/org/apache/activemq/artemis/jms/example/ProtonJExample.java b/examples/jms/proton-j/src/main/java/org/apache/activemq/artemis/jms/example/ProtonJExample.java
index adb3303..482151d 100644
--- a/examples/jms/proton-j/src/main/java/org/apache/activemq/artemis/jms/example/ProtonJExample.java
+++ b/examples/jms/proton-j/src/main/java/org/apache/activemq/artemis/jms/example/ProtonJExample.java
@@ -23,16 +23,10 @@ import org.apache.qpid.amqp_1_0.client.Receiver;
 import org.apache.qpid.amqp_1_0.client.Sender;
 import org.apache.qpid.amqp_1_0.client.Session;
 import org.apache.qpid.amqp_1_0.type.UnsignedInteger;
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
 
-public class ProtonJExample extends ActiveMQExample
+public class ProtonJExample
 {
-   public static void main(String[] args)
-   {
-      new ProtonJExample().run(args);
-   }
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(String[] args) throws Exception
    {
       Connection connection = null;
 
@@ -71,7 +65,5 @@ public class ProtonJExample extends ActiveMQExample
             connection.close();
          }
       }
-
-      return true;
    }
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/proton-ruby/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/proton-ruby/pom.xml b/examples/jms/proton-ruby/pom.xml
index b00e308..54f2269 100644
--- a/examples/jms/proton-ruby/pom.xml
+++ b/examples/jms/proton-ruby/pom.xml
@@ -35,14 +35,6 @@ under the License.
       <activemq.basedir>${project.basedir}/../../..</activemq.basedir>
    </properties>
 
-   <dependencies>
-      <dependency>
-         <groupId>org.apache.activemq.examples.jms</groupId>
-         <artifactId>common</artifactId>
-         <version>${project.version}</version>
-      </dependency>
-   </dependencies>
-
    <profiles>
       <profile>
          <id>example</id>


[20/24] activemq-artemis git commit: ARTEMIS-178 Refactor examples to use CLI

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/clustered-grouping/src/main/resources/activemq/server1/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-grouping/src/main/resources/activemq/server1/artemis-roles.properties b/examples/jms/clustered-grouping/src/main/resources/activemq/server1/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/clustered-grouping/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/b3af4bb7/examples/jms/clustered-grouping/src/main/resources/activemq/server1/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-grouping/src/main/resources/activemq/server1/artemis-users.properties b/examples/jms/clustered-grouping/src/main/resources/activemq/server1/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/clustered-grouping/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/b3af4bb7/examples/jms/clustered-grouping/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-grouping/src/main/resources/activemq/server1/broker.xml b/examples/jms/clustered-grouping/src/main/resources/activemq/server1/broker.xml
index c544203..7ab2e7e 100644
--- a/examples/jms/clustered-grouping/src/main/resources/activemq/server1/broker.xml
+++ b/examples/jms/clustered-grouping/src/main/resources/activemq/server1/broker.xml
@@ -30,13 +30,14 @@ under the License.
    <core xmlns="urn:activemq:core">
 
 
-      <bindings-directory>${data.dir}/server1/data/messaging/bindings</bindings-directory>
+      <bindings-directory>${data.dir:../data}/bindings</bindings-directory>
 
-      <journal-directory>${data.dir}/server1/data/messaging/journal</journal-directory>
+      <journal-directory>${data.dir:../data}/journal</journal-directory>
 
-      <large-messages-directory>${data.dir}/server1/data/messaging/largemessages</large-messages-directory>
+      <large-messages-directory>${data.dir:../data}/largemessages</large-messages-directory>
+
+      <paging-directory>${data.dir:../data}/paging</paging-directory>
 
-      <paging-directory>${data.dir}/server1/data/messaging/paging</paging-directory>
 
       <!-- Connectors -->
       <connectors>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/clustered-grouping/src/main/resources/activemq/server2/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-grouping/src/main/resources/activemq/server2/artemis-roles.properties b/examples/jms/clustered-grouping/src/main/resources/activemq/server2/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/clustered-grouping/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/b3af4bb7/examples/jms/clustered-grouping/src/main/resources/activemq/server2/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-grouping/src/main/resources/activemq/server2/artemis-users.properties b/examples/jms/clustered-grouping/src/main/resources/activemq/server2/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/clustered-grouping/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/b3af4bb7/examples/jms/clustered-grouping/src/main/resources/activemq/server2/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-grouping/src/main/resources/activemq/server2/broker.xml b/examples/jms/clustered-grouping/src/main/resources/activemq/server2/broker.xml
index d9f0c6e..1776c5c 100644
--- a/examples/jms/clustered-grouping/src/main/resources/activemq/server2/broker.xml
+++ b/examples/jms/clustered-grouping/src/main/resources/activemq/server2/broker.xml
@@ -30,13 +30,14 @@ under the License.
    <core xmlns="urn:activemq:core">
 
 
-      <bindings-directory>${data.dir}/server2/data/messaging/bindings</bindings-directory>
+      <bindings-directory>${data.dir:../data}/bindings</bindings-directory>
 
-      <journal-directory>${data.dir}/server2/data/messaging/journal</journal-directory>
+      <journal-directory>${data.dir:../data}/journal</journal-directory>
 
-      <large-messages-directory>${data.dir}/server2/data/messaging/largemessages</large-messages-directory>
+      <large-messages-directory>${data.dir:../data}/largemessages</large-messages-directory>
+
+      <paging-directory>${data.dir:../data}/paging</paging-directory>
 
-      <paging-directory>${data.dir}/server2/data/messaging/paging</paging-directory>
 
       <!-- Connectors -->
       <connectors>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/clustered-jgroups/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-jgroups/pom.xml b/examples/jms/clustered-jgroups/pom.xml
index bd17e32..b19deb3 100644
--- a/examples/jms/clustered-jgroups/pom.xml
+++ b/examples/jms/clustered-jgroups/pom.xml
@@ -57,38 +57,32 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start0</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                           <systemProperties>
-                              <!-- this is to make sure the example will run fine on any box.
-                                   you may tweak this to any property you like. More information on the JGroups docs  -->
-                              <property>
-                                 <name>jgroups.bind_addr</name>
-                                 <value>::1</value>
-                              </property>
-                           </systemProperties>
+                           <libList>
+                              <!-- You need to add jgroups.jar to the server's lib -->
+                              <arg>org.jgroups:jgroups:3.6.0.Final</arg>
+                           </libList>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
                         </configuration>
                      </execution>
                      <execution>
-                        <id>start1</id>
+                        <id>create2</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
-                           <fork>true</fork>
-                           <systemProperties>
-                              <!-- this is to make sure the example will run fine on any box.
-                                   you may tweak this to any property you like. More information on the JGroups docs  -->
-                              <property>
-                                 <name>jgroups.bind_addr</name>
-                                 <value>::1</value>
-                              </property>
-                           </systemProperties>
+                           <libList>
+                              <!-- You need to add jgroups.jar to the server's lib -->
+                              <arg>org.jgroups:jgroups:3.6.0.Final</arg>
+                           </libList>
+                           <instance>${basedir}/target/server1</instance>
+                           <configuration>${basedir}/target/classes/activemq/server1</configuration>
+                           <portOffset>1</portOffset>
                         </configuration>
                      </execution>
                      <execution>
@@ -99,29 +93,11 @@ under the License.
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.ClusteredJgroupsExample</clientClass>
                            <args>
-                              <param>tcp://localhost:61616</param>
-                              <param>tcp://localhost:61617</param>
+                              <param>${basedir}/target/server0</param>
+                              <param>${basedir}/target/server1</param>
                            </args>
                         </configuration>
                      </execution>
-                     <execution>
-                        <id>stop0</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop1</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
-                        </configuration>
-                     </execution>
                   </executions>
                   <dependencies>
                      <dependency>
@@ -129,40 +105,7 @@ under the License.
                         <artifactId>clustered-jgroups</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                  </configuration>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/clustered-jgroups/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredJgroupsExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-jgroups/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredJgroupsExample.java b/examples/jms/clustered-jgroups/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredJgroupsExample.java
index db066a1..9d7c3dc 100644
--- a/examples/jms/clustered-jgroups/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredJgroupsExample.java
+++ b/examples/jms/clustered-jgroups/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredJgroupsExample.java
@@ -16,8 +16,6 @@
  */
 package org.apache.activemq.artemis.jms.example;
 
-import java.util.Hashtable;
-
 import javax.jms.Connection;
 import javax.jms.ConnectionFactory;
 import javax.jms.MessageConsumer;
@@ -26,6 +24,7 @@ import javax.jms.Queue;
 import javax.jms.Session;
 import javax.jms.TextMessage;
 import javax.naming.InitialContext;
+import java.util.Hashtable;
 
 import org.apache.activemq.artemis.common.example.ActiveMQExample;
 
@@ -55,7 +54,7 @@ public class ClusteredJgroupsExample extends ActiveMQExample
          // 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", args[0]);
+         properties.put("connectionFactory.ConnectionFactory", "tcp://localhost:61616");
          properties.put("queue.queue/exampleQueue", "exampleQueue");
          ic0 = new InitialContext(properties);
 
@@ -68,7 +67,7 @@ public class ClusteredJgroupsExample extends ActiveMQExample
          // Step 4. Get an initial context for looking up JNDI from server 1
          properties = new Hashtable<String, Object>();
          properties.put("java.naming.factory.initial", "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory");
-         properties.put("connectionFactory.ConnectionFactory", args[1]);
+         properties.put("connectionFactory.ConnectionFactory", "tcp://localhost:61617");
          ic1 = new InitialContext(properties);
 
          // Step 5. Look-up a JMS Connection Factory object from JNDI on server 1

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/clustered-jgroups/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-jgroups/src/main/resources/activemq/server0/artemis-roles.properties b/examples/jms/clustered-jgroups/src/main/resources/activemq/server0/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/clustered-jgroups/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/b3af4bb7/examples/jms/clustered-jgroups/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-jgroups/src/main/resources/activemq/server0/artemis-users.properties b/examples/jms/clustered-jgroups/src/main/resources/activemq/server0/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/clustered-jgroups/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/b3af4bb7/examples/jms/clustered-jgroups/src/main/resources/activemq/server0/test-jgroups-file_ping.xml
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-jgroups/src/main/resources/activemq/server0/test-jgroups-file_ping.xml b/examples/jms/clustered-jgroups/src/main/resources/activemq/server0/test-jgroups-file_ping.xml
index 153cbf7..5fb6ab4 100644
--- a/examples/jms/clustered-jgroups/src/main/resources/activemq/server0/test-jgroups-file_ping.xml
+++ b/examples/jms/clustered-jgroups/src/main/resources/activemq/server0/test-jgroups-file_ping.xml
@@ -47,7 +47,8 @@ under the License.
          oob_thread_pool.queue_max_size="100"
          oob_thread_pool.rejection_policy="run"/>
 
-    <FILE_PING location="../file.ping.dir"/>
+   <!-- a location that can be found by both server's running -->
+    <FILE_PING location="../../file.ping.dir"/>
     <MERGE2 max_interval="30000"
               min_interval="10000"/>
     <FD_SOCK/>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/clustered-jgroups/src/main/resources/activemq/server1/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-jgroups/src/main/resources/activemq/server1/artemis-roles.properties b/examples/jms/clustered-jgroups/src/main/resources/activemq/server1/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/clustered-jgroups/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/b3af4bb7/examples/jms/clustered-jgroups/src/main/resources/activemq/server1/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-jgroups/src/main/resources/activemq/server1/artemis-users.properties b/examples/jms/clustered-jgroups/src/main/resources/activemq/server1/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/clustered-jgroups/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/b3af4bb7/examples/jms/clustered-jgroups/src/main/resources/activemq/server1/test-jgroups-file_ping.xml
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-jgroups/src/main/resources/activemq/server1/test-jgroups-file_ping.xml b/examples/jms/clustered-jgroups/src/main/resources/activemq/server1/test-jgroups-file_ping.xml
index 7013aa5..1137496 100644
--- a/examples/jms/clustered-jgroups/src/main/resources/activemq/server1/test-jgroups-file_ping.xml
+++ b/examples/jms/clustered-jgroups/src/main/resources/activemq/server1/test-jgroups-file_ping.xml
@@ -47,7 +47,8 @@ under the License.
          oob_thread_pool.queue_max_size="100"
          oob_thread_pool.rejection_policy="run"/>
 
-    <FILE_PING location="../file.ping.dir"/>
+    <!-- a location that can be found by both server's running -->
+    <FILE_PING location="../../file.ping.dir"/>
     <MERGE2 max_interval="30000"
               min_interval="10000"/>
     <FD_SOCK/>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/clustered-queue/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-queue/pom.xml b/examples/jms/clustered-queue/pom.xml
index 2924717..d4afa59 100644
--- a/examples/jms/clustered-queue/pom.xml
+++ b/examples/jms/clustered-queue/pom.xml
@@ -57,34 +57,24 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start0</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                           <systemProperties>
-                              <property>
-                                 <name>udp-address</name>
-                                 <value>${udp-address}</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
                         </configuration>
                      </execution>
                      <execution>
-                        <id>start1</id>
+                        <id>create2</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
-                           <fork>true</fork>
-                           <systemProperties>
-                              <property>
-                                 <name>udp-address</name>
-                                 <value>${udp-address}</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server1</instance>
+                           <configuration>${basedir}/target/classes/activemq/server1</configuration>
+                           <portOffset>1</portOffset>
                         </configuration>
                      </execution>
                      <execution>
@@ -95,29 +85,11 @@ under the License.
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.ClusteredQueueExample</clientClass>
                            <args>
-                              <param>tcp://localhost:61616</param>
-                              <param>tcp://localhost:61617</param>
+                              <param>${basedir}/target/server0</param>
+                              <param>${basedir}/target/server1</param>
                            </args>
                         </configuration>
                      </execution>
-                     <execution>
-                        <id>stop0</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop1</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
-                        </configuration>
-                     </execution>
                   </executions>
                   <dependencies>
                      <dependency>
@@ -125,40 +97,7 @@ under the License.
                         <artifactId>clustered-queue</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                  </configuration>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/clustered-queue/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredQueueExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-queue/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredQueueExample.java b/examples/jms/clustered-queue/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredQueueExample.java
index 7825c5d..0011865 100644
--- a/examples/jms/clustered-queue/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredQueueExample.java
+++ b/examples/jms/clustered-queue/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredQueueExample.java
@@ -16,8 +16,6 @@
  */
 package org.apache.activemq.artemis.jms.example;
 
-import java.util.Hashtable;
-
 import javax.jms.Connection;
 import javax.jms.ConnectionFactory;
 import javax.jms.MessageConsumer;
@@ -26,6 +24,7 @@ import javax.jms.Queue;
 import javax.jms.Session;
 import javax.jms.TextMessage;
 import javax.naming.InitialContext;
+import java.util.Hashtable;
 
 import org.apache.activemq.artemis.common.example.ActiveMQExample;
 
@@ -56,7 +55,7 @@ public class ClusteredQueueExample extends ActiveMQExample
          // 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", args[0]);
+         properties.put("connectionFactory.ConnectionFactory", DEFAULT_TCP1);
          properties.put("queue.queue/exampleQueue", "exampleQueue");
          ic0 = new InitialContext(properties);
 
@@ -69,7 +68,7 @@ public class ClusteredQueueExample extends ActiveMQExample
          // Step 4. Get an initial context for looking up JNDI from server 1
          properties = new Hashtable<String, Object>();
          properties.put("java.naming.factory.initial", "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory");
-         properties.put("connectionFactory.ConnectionFactory", args[1]);
+         properties.put("connectionFactory.ConnectionFactory", DEFAULT_TCP2);
          ic1 = new InitialContext(properties);
 
          // Step 5. Look-up a JMS Connection Factory object from JNDI on server 1

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/clustered-standalone/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-standalone/pom.xml b/examples/jms/clustered-standalone/pom.xml
index b78aa01..1f2249d 100644
--- a/examples/jms/clustered-standalone/pom.xml
+++ b/examples/jms/clustered-standalone/pom.xml
@@ -57,50 +57,35 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start0</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                           <systemProperties>
-                              <property>
-                                 <name>udp-address</name>
-                                 <value>${udp-address}</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
                         </configuration>
                      </execution>
                      <execution>
-                        <id>start1</id>
+                        <id>create2</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
-                           <fork>true</fork>
-                           <systemProperties>
-                              <property>
-                                 <name>udp-address</name>
-                                 <value>${udp-address}</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server1</instance>
+                           <configuration>${basedir}/target/classes/activemq/server1</configuration>
+                           <portOffset>1</portOffset>
                         </configuration>
                      </execution>
                      <execution>
-                        <id>start2</id>
+                        <id>create3</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server2</configurationDir>
-                           <fork>true</fork>
-                           <systemProperties>
-                              <property>
-                                 <name>udp-address</name>
-                                 <value>${udp-address}</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server2</instance>
+                           <configuration>${basedir}/target/classes/activemq/server2</configuration>
+                           <portOffset>2</portOffset>
                         </configuration>
                      </execution>
                      <execution>
@@ -111,43 +96,10 @@ under the License.
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.ClusteredStandaloneExample</clientClass>
                            <args>
-                              <param>tcp://localhost:61616</param>
-                              <param>tcp://localhost:61617</param>
-                              <param>tcp://localhost:61618</param>
+                              <param>${basedir}/target/server0</param>
+                              <param>${basedir}/target/server1</param>
+                              <param>${basedir}/target/server2</param>
                            </args>
-                           <systemProperties>
-                              <property>
-                                 <name>exampleConfigDir</name>
-                                 <value>${basedir}/target/classes/activemq</value>
-                              </property>
-                           </systemProperties>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop0</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop1</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop2</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server2</configurationDir>
                         </configuration>
                      </execution>
                   </executions>
@@ -157,36 +109,6 @@ under the License.
                         <artifactId>artemis-jms-clustered-standalone-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
                </plugin>
             </plugins>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/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 5cb4812..9437a8c 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
@@ -16,8 +16,6 @@
  */
 package org.apache.activemq.artemis.jms.example;
 
-import java.util.Hashtable;
-
 import javax.jms.Connection;
 import javax.jms.ConnectionFactory;
 import javax.jms.MessageConsumer;
@@ -26,6 +24,7 @@ import javax.jms.Session;
 import javax.jms.TextMessage;
 import javax.jms.Topic;
 import javax.naming.InitialContext;
+import java.util.Hashtable;
 
 import org.apache.activemq.artemis.common.example.ActiveMQExample;
 
@@ -53,18 +52,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", args[0]);
+         properties.put("connectionFactory.ConnectionFactory", DEFAULT_TCP1);
          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", args[1]);
+         properties.put("connectionFactory.ConnectionFactory", DEFAULT_TCP2);
          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", args[2]);
+         properties.put("connectionFactory.ConnectionFactory", DEFAULT_TCP3);
          initialContext2 = new InitialContext(properties);
 
          // First we demonstrate a distributed topic.
@@ -147,7 +146,7 @@ public class ClusteredStandaloneExample extends ActiveMQExample
                return false;
             }
 
-           // System.out.println("Received message " + message2.getText());
+            System.out.println("Received message " + message2.getText());
          }
 
          producer.close();

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/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 145c6a6..597bdfb 100644
--- a/examples/jms/clustered-static-discovery/pom.xml
+++ b/examples/jms/clustered-static-discovery/pom.xml
@@ -57,42 +57,46 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start0</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
                         </configuration>
                      </execution>
                      <execution>
-                        <id>start1</id>
+                        <id>create2</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
-                           <fork>true</fork>
+                           <instance>${basedir}/target/server1</instance>
+                           <configuration>${basedir}/target/classes/activemq/server1</configuration>
+                           <portOffset>1</portOffset>
                         </configuration>
                      </execution>
                      <execution>
-                        <id>start2</id>
+                        <id>create3</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server2</configurationDir>
-                           <fork>true</fork>
+                           <instance>${basedir}/target/server2</instance>
+                           <configuration>${basedir}/target/classes/activemq/server2</configuration>
+                           <portOffset>2</portOffset>
                         </configuration>
                      </execution>
                      <execution>
-                        <id>start3</id>
+                        <id>create4</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server3</configurationDir>
-                           <fork>true</fork>
+                           <instance>${basedir}/target/server3</instance>
+                           <configuration>${basedir}/target/classes/activemq/server3</configuration>
+                           <portOffset>3</portOffset>
                         </configuration>
                      </execution>
                      <execution>
@@ -103,53 +107,11 @@ under the License.
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.StaticClusteredQueueExample</clientClass>
                            <args>
-                              <param>tcp://localhost:61616</param>
-                              <param>tcp://localhost:61617</param>
-                              <param>tcp://localhost:61618</param>
-                              <param>tcp://localhost:61619</param>
+                              <param>${basedir}/target/server0</param>
+                              <param>${basedir}/target/server1</param>
+                              <param>${basedir}/target/server2</param>
+                              <param>${basedir}/target/server3</param>
                            </args>
-                           <systemProperties>
-                              <property>
-                                 <name>exampleConfigDir</name>
-                                 <value>${basedir}/target/classes/activemq</value>
-                              </property>
-                           </systemProperties>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop0</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop1</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop2</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server2</configurationDir>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop3</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server3</configurationDir>
                         </configuration>
                      </execution>
                   </executions>
@@ -159,46 +121,7 @@ under the License.
                         <artifactId>artemis-jms-clustered-static-discovery-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <systemProperties>
-                        <property>
-                           <name>data.dir</name>
-                           <value>${basedir}/target/</value>
-                        </property>
-                     </systemProperties>
-                  </configuration>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/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 22fc066..c7c9efb 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,8 +16,6 @@
  */
 package org.apache.activemq.artemis.jms.example;
 
-import java.util.Hashtable;
-
 import javax.jms.Connection;
 import javax.jms.ConnectionFactory;
 import javax.jms.MessageConsumer;
@@ -26,6 +24,7 @@ import javax.jms.Queue;
 import javax.jms.Session;
 import javax.jms.TextMessage;
 import javax.naming.InitialContext;
+import java.util.Hashtable;
 
 import org.apache.activemq.artemis.common.example.ActiveMQExample;
 
@@ -60,7 +59,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", args[3]);
+         properties.put("connectionFactory.ConnectionFactory", DEFAULT_TCP4);
          properties.put("queue.queue/exampleQueue", "exampleQueue");
          ic0 = new InitialContext(properties);
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/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 cb8f249..1c44be4 100644
--- a/examples/jms/clustered-static-oneway/pom.xml
+++ b/examples/jms/clustered-static-oneway/pom.xml
@@ -57,32 +57,33 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start0</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
                         </configuration>
                      </execution>
                      <execution>
-                        <id>start1</id>
+                        <id>create2</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
-                           <fork>true</fork>
+                           <instance>${basedir}/target/server1</instance>
+                           <configuration>${basedir}/target/classes/activemq/server1</configuration>
                         </configuration>
                      </execution>
                      <execution>
-                        <id>start2</id>
+                        <id>create3</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server2</configurationDir>
-                           <fork>true</fork>
+                           <instance>${basedir}/target/server2</instance>
+                           <configuration>${basedir}/target/classes/activemq/server2</configuration>
                         </configuration>
                      </execution>
                      <execution>
@@ -93,43 +94,10 @@ under the License.
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.ClusterStaticOnewayExample</clientClass>
                            <args>
-                              <param>tcp://localhost:61616</param>
-                              <param>tcp://localhost:61617</param>
-                              <param>tcp://localhost:61618</param>
+                              <param>${basedir}/target/server0</param>
+                              <param>${basedir}/target/server1</param>
+                              <param>${basedir}/target/server2</param>
                            </args>
-                           <systemProperties>
-                              <property>
-                                 <name>exampleConfigDir</name>
-                                 <value>${basedir}/target/classes/activemq</value>
-                              </property>
-                           </systemProperties>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop0</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop1</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop2</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server2</configurationDir>
                         </configuration>
                      </execution>
                   </executions>
@@ -139,46 +107,7 @@ under the License.
                         <artifactId>artemis-jms-clustered-static-oneway-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <systemProperties>
-                        <property>
-                           <name>data.dir</name>
-                           <value>${basedir}/target/</value>
-                        </property>
-                     </systemProperties>
-                  </configuration>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/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 55ffa6a..fd1f4e5 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,8 +16,6 @@
  */
 package org.apache.activemq.artemis.jms.example;
 
-import java.util.Hashtable;
-
 import javax.jms.Connection;
 import javax.jms.ConnectionFactory;
 import javax.jms.MessageConsumer;
@@ -26,6 +24,7 @@ import javax.jms.Queue;
 import javax.jms.Session;
 import javax.jms.TextMessage;
 import javax.naming.InitialContext;
+import java.util.Hashtable;
 
 import org.apache.activemq.artemis.common.example.ActiveMQExample;
 
@@ -58,7 +57,7 @@ public class ClusterStaticOnewayExample extends ActiveMQExample
          // 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", args[0]);
+         properties.put("connectionFactory.ConnectionFactory", DEFAULT_TCP1);
          properties.put("queue.queue/exampleQueue", "exampleQueue");
          ic0 = new InitialContext(properties);
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/clustered-topic/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-topic/pom.xml b/examples/jms/clustered-topic/pom.xml
index 33617d5..63a7c2b 100644
--- a/examples/jms/clustered-topic/pom.xml
+++ b/examples/jms/clustered-topic/pom.xml
@@ -57,42 +57,23 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start0</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                              <property>
-                                 <name>udp-address</name>
-                                 <value>${udp-address}</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
                         </configuration>
                      </execution>
                      <execution>
-                        <id>start1</id>
+                        <id>create2</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
-                           <fork>true</fork>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                              <property>
-                                 <name>udp-address</name>
-                                 <value>${udp-address}</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server1</instance>
+                           <configuration>${basedir}/target/classes/activemq/server1</configuration>
                         </configuration>
                      </execution>
                      <execution>
@@ -103,33 +84,9 @@ under the License.
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.ClusteredTopicExample</clientClass>
                            <args>
-                              <param>tcp://localhost:61616</param>
-                              <param>tcp://localhost:61617</param>
+                              <param>${basedir}/target/server0</param>
+                              <param>${basedir}/target/server1</param>
                            </args>
-                           <systemProperties>
-                              <property>
-                                 <name>exampleConfigDir</name>
-                                 <value>${basedir}/target/classes/activemq</value>
-                              </property>
-                           </systemProperties>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop0</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop1</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
                         </configuration>
                      </execution>
                   </executions>
@@ -139,46 +96,7 @@ under the License.
                         <artifactId>artemis-jms-clustered-topic-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <systemProperties>
-                        <property>
-                           <name>data.dir</name>
-                           <value>${basedir}/target/</value>
-                        </property>
-                     </systemProperties>
-                  </configuration>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/clustered-topic/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredTopicExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-topic/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredTopicExample.java b/examples/jms/clustered-topic/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredTopicExample.java
index 61a7e84..eae9366 100644
--- a/examples/jms/clustered-topic/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredTopicExample.java
+++ b/examples/jms/clustered-topic/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredTopicExample.java
@@ -16,8 +16,6 @@
  */
 package org.apache.activemq.artemis.jms.example;
 
-import java.util.Hashtable;
-
 import javax.jms.Connection;
 import javax.jms.ConnectionFactory;
 import javax.jms.MessageConsumer;
@@ -26,6 +24,7 @@ import javax.jms.Session;
 import javax.jms.TextMessage;
 import javax.jms.Topic;
 import javax.naming.InitialContext;
+import java.util.Hashtable;
 
 import org.apache.activemq.artemis.common.example.ActiveMQExample;
 
@@ -56,7 +55,7 @@ public class ClusteredTopicExample extends ActiveMQExample
          // 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", args[0]);
+         properties.put("connectionFactory.ConnectionFactory", DEFAULT_TCP1);
          properties.put("topic.topic/exampleTopic", "exampleTopic");
          ic0 = new InitialContext(properties);
 
@@ -69,7 +68,7 @@ public class ClusteredTopicExample extends ActiveMQExample
          // Step 4. Get an initial context for looking up JNDI from server 1
          properties = new Hashtable<String, Object>();
          properties.put("java.naming.factory.initial", "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory");
-         properties.put("connectionFactory.ConnectionFactory", args[1]);
+         properties.put("connectionFactory.ConnectionFactory", DEFAULT_TCP2);
          ic1 = new InitialContext(properties);
 
          // Step 5. Look-up a JMS Connection Factory object from JNDI on server 1

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/colocated-failover-scale-down/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/colocated-failover-scale-down/pom.xml b/examples/jms/colocated-failover-scale-down/pom.xml
index ac01bed..a0778b0 100644
--- a/examples/jms/colocated-failover-scale-down/pom.xml
+++ b/examples/jms/colocated-failover-scale-down/pom.xml
@@ -57,34 +57,23 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start0</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                           <systemProperties>
-                              <property>
-                                 <name>udp-address</name>
-                                 <value>${udp-address}</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
                         </configuration>
                      </execution>
                      <execution>
-                        <id>start1</id>
+                        <id>create2</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
-                           <fork>true</fork>
-                           <systemProperties>
-                              <property>
-                                 <name>udp-address</name>
-                                 <value>${udp-address}</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server1</instance>
+                           <configuration>${basedir}/target/classes/activemq/server1</configuration>
                         </configuration>
                      </execution>
                      <execution>
@@ -95,33 +84,9 @@ under the License.
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.ColocatedFailoverScaleDownExample</clientClass>
                            <args>
-                              <param>tcp://localhost:61616</param>
-                              <param>tcp://localhost:61617</param>
+                              <param>${basedir}/target/server0</param>
+                              <param>${basedir}/target/server1</param>
                            </args>
-                            <systemProperties>
-                                <property>
-                                    <name>exampleConfigDir</name>
-                                    <value>${basedir}/target/classes/activemq</value>
-                                </property>
-                            </systemProperties>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop0</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop1</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
                         </configuration>
                      </execution>
                   </executions>
@@ -131,40 +96,7 @@ under the License.
                         <artifactId>colocated-failover-scale-down</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                  </configuration>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/colocated-failover-scale-down/src/main/java/org/apache/activemq/artemis/jms/example/ColocatedFailoverScaleDownExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/colocated-failover-scale-down/src/main/java/org/apache/activemq/artemis/jms/example/ColocatedFailoverScaleDownExample.java b/examples/jms/colocated-failover-scale-down/src/main/java/org/apache/activemq/artemis/jms/example/ColocatedFailoverScaleDownExample.java
index a794b7a..678fbf9 100644
--- a/examples/jms/colocated-failover-scale-down/src/main/java/org/apache/activemq/artemis/jms/example/ColocatedFailoverScaleDownExample.java
+++ b/examples/jms/colocated-failover-scale-down/src/main/java/org/apache/activemq/artemis/jms/example/ColocatedFailoverScaleDownExample.java
@@ -16,8 +16,6 @@
  */
 package org.apache.activemq.artemis.jms.example;
 
-import java.util.Hashtable;
-
 import javax.jms.Connection;
 import javax.jms.ConnectionFactory;
 import javax.jms.MessageConsumer;
@@ -26,6 +24,7 @@ import javax.jms.Queue;
 import javax.jms.Session;
 import javax.jms.TextMessage;
 import javax.naming.InitialContext;
+import java.util.Hashtable;
 
 import org.apache.activemq.artemis.common.example.ActiveMQExample;
 
@@ -35,7 +34,7 @@ import org.apache.activemq.artemis.common.example.ActiveMQExample;
  */
 public class ColocatedFailoverScaleDownExample extends ActiveMQExample
 {
-   public static void main(final String[] args)
+   public static void main(final String[] args) throws Exception
    {
       new ColocatedFailoverScaleDownExample().run(args);
    }
@@ -56,12 +55,12 @@ public class ColocatedFailoverScaleDownExample extends ActiveMQExample
          // Step 1. Get an initial context for looking up JNDI for both servers
          Hashtable<String, Object> properties = new Hashtable<String, Object>();
          properties.put("java.naming.factory.initial", "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory");
-         properties.put("connectionFactory.ConnectionFactory", args[1]);
+         properties.put("connectionFactory.ConnectionFactory", DEFAULT_TCP2);
          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", args[0] + "?ha=true&retryInterval=1000&retryIntervalMultiplier=1.0&reconnectAttempts=-1");
+         properties.put("connectionFactory.ConnectionFactory", DEFAULT_TCP1 + "?ha=true&retryInterval=1000&retryIntervalMultiplier=1.0&reconnectAttempts=-1");
          properties.put("queue.queue/exampleQueue", "exampleQueue");
          initialContext = new InitialContext(properties);
 
@@ -95,8 +94,8 @@ public class ColocatedFailoverScaleDownExample extends ActiveMQExample
 
          // Step 7. Crash server #0, the live server, and wait a little while to make sure
          // it has really crashed
-         Thread.sleep(2000);
          killServer(0);
+         Thread.sleep(5000);
 
 
          // Step 8. start the connection ready to receive messages

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/colocated-failover-scale-down/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/colocated-failover-scale-down/src/main/resources/activemq/server0/broker.xml b/examples/jms/colocated-failover-scale-down/src/main/resources/activemq/server0/broker.xml
index 9d6d063..8c68c8d 100644
--- a/examples/jms/colocated-failover-scale-down/src/main/resources/activemq/server0/broker.xml
+++ b/examples/jms/colocated-failover-scale-down/src/main/resources/activemq/server0/broker.xml
@@ -30,13 +30,13 @@ under the License.
    <core xmlns="urn:activemq:core">
 
 
-      <bindings-directory>target/server0/data/messaging/bindings</bindings-directory>
+      <bindings-directory>../../server0/data/messaging/bindings</bindings-directory>
 
-      <journal-directory>target/server0/data/messaging/journal</journal-directory>
+      <journal-directory>../../server0/data/messaging/journal</journal-directory>
 
-      <large-messages-directory>target/server0/data/messaging/largemessages</large-messages-directory>
+      <large-messages-directory>../../server0/data/messaging/largemessages</large-messages-directory>
 
-      <paging-directory>target/server0/data/messaging/paging</paging-directory>
+      <paging-directory>../../server0/data/messaging/paging</paging-directory>
       <!-- Connectors -->
 
       <connectors>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/colocated-failover-scale-down/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/colocated-failover-scale-down/src/main/resources/activemq/server1/broker.xml b/examples/jms/colocated-failover-scale-down/src/main/resources/activemq/server1/broker.xml
index cda407e..6ad15ef 100644
--- a/examples/jms/colocated-failover-scale-down/src/main/resources/activemq/server1/broker.xml
+++ b/examples/jms/colocated-failover-scale-down/src/main/resources/activemq/server1/broker.xml
@@ -30,13 +30,13 @@ under the License.
    <core xmlns="urn:activemq:core">
 
 
-      <bindings-directory>target/server1/data/messaging/bindings</bindings-directory>
+      <bindings-directory>../../server1/data/messaging/bindings</bindings-directory>
 
-      <journal-directory>target/server1/data/messaging/journal</journal-directory>
+      <journal-directory>../../server1/data/messaging/journal</journal-directory>
 
-      <large-messages-directory>target/server1/data/messaging/largemessages</large-messages-directory>
+      <large-messages-directory>../../server1/data/messaging/largemessages</large-messages-directory>
 
-      <paging-directory>target/server1/data/messaging/paging</paging-directory>
+      <paging-directory>../../server1/data/messaging/paging</paging-directory>
 
       <!-- Connectors -->
       <connectors>


[18/24] activemq-artemis git commit: ARTEMIS-178 Refactor examples to use CLI

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/instantiate-connection-factory/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/instantiate-connection-factory/pom.xml b/examples/jms/instantiate-connection-factory/pom.xml
index 591d4d0..17e5543 100644
--- a/examples/jms/instantiate-connection-factory/pom.xml
+++ b/examples/jms/instantiate-connection-factory/pom.xml
@@ -67,17 +67,13 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
                         </configuration>
                      </execution>
                      <execution>
@@ -88,16 +84,10 @@ under the License.
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.InstantiateConnectionFactoryExample</clientClass>
                            <args>
-                              <param>tcp://localhost:61616</param>
+                              <param>${basedir}/target/server0</param>
                            </args>
                         </configuration>
                      </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                     </execution>
                   </executions>
                   <dependencies>
                      <dependency>
@@ -105,41 +95,7 @@ under the License.
                         <artifactId>artemis-jms-instantiate-connection-factory-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                  </configuration>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/instantiate-connection-factory/src/main/java/org/apache/activemq/artemis/jms/example/InstantiateConnectionFactoryExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/instantiate-connection-factory/src/main/java/org/apache/activemq/artemis/jms/example/InstantiateConnectionFactoryExample.java b/examples/jms/instantiate-connection-factory/src/main/java/org/apache/activemq/artemis/jms/example/InstantiateConnectionFactoryExample.java
index df22bf1..85ee7d9 100644
--- a/examples/jms/instantiate-connection-factory/src/main/java/org/apache/activemq/artemis/jms/example/InstantiateConnectionFactoryExample.java
+++ b/examples/jms/instantiate-connection-factory/src/main/java/org/apache/activemq/artemis/jms/example/InstantiateConnectionFactoryExample.java
@@ -16,9 +16,6 @@
  */
 package org.apache.activemq.artemis.jms.example;
 
-import java.util.HashMap;
-import java.util.Map;
-
 import javax.jms.Connection;
 import javax.jms.ConnectionFactory;
 import javax.jms.MessageConsumer;
@@ -26,6 +23,8 @@ import javax.jms.MessageProducer;
 import javax.jms.Queue;
 import javax.jms.Session;
 import javax.jms.TextMessage;
+import java.util.HashMap;
+import java.util.Map;
 
 import org.apache.activemq.artemis.api.core.TransportConfiguration;
 import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
@@ -61,7 +60,7 @@ public class InstantiateConnectionFactoryExample extends ActiveMQExample
          // The server port etc.
 
          Map<String, Object> connectionParams = new HashMap<String, Object>();
-         connectionParams.put(TransportConstants.PORT_PROP_NAME, 61617);
+         connectionParams.put(TransportConstants.PORT_PROP_NAME, 61616);
 
          TransportConfiguration transportConfiguration = new TransportConfiguration(NettyConnectorFactory.class.getName(),
                                                                                     connectionParams);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/instantiate-connection-factory/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/instantiate-connection-factory/src/main/resources/activemq/server0/broker.xml b/examples/jms/instantiate-connection-factory/src/main/resources/activemq/server0/broker.xml
index 273b698..7690094 100644
--- a/examples/jms/instantiate-connection-factory/src/main/resources/activemq/server0/broker.xml
+++ b/examples/jms/instantiate-connection-factory/src/main/resources/activemq/server0/broker.xml
@@ -39,7 +39,7 @@ under the License.
 
       <!-- Acceptors -->
       <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61617</acceptor>
+         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
       </acceptors>
 
       <!-- Other config -->

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/interceptor/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/interceptor/pom.xml b/examples/jms/interceptor/pom.xml
index fe6708d..5d7a2a0 100644
--- a/examples/jms/interceptor/pom.xml
+++ b/examples/jms/interceptor/pom.xml
@@ -62,17 +62,13 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
                         </configuration>
                      </execution>
                      <execution>
@@ -83,16 +79,10 @@ under the License.
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.InterceptorExample</clientClass>
                            <args>
-                              <param>tcp://localhost:61616</param>
+                              <param>${basedir}/target/server0</param>
                            </args>
                         </configuration>
                      </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                     </execution>
                   </executions>
                   <dependencies>
                      <dependency>
@@ -100,41 +90,7 @@ under the License.
                         <artifactId>artemis-jms-interceptor-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
-                  </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                  </configuration>
+                   </dependencies>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/jms-auto-closeable/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/jms-auto-closeable/pom.xml b/examples/jms/jms-auto-closeable/pom.xml
index 7b2896d..6cceae6 100644
--- a/examples/jms/jms-auto-closeable/pom.xml
+++ b/examples/jms/jms-auto-closeable/pom.xml
@@ -57,17 +57,13 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
                         </configuration>
                      </execution>
                      <execution>
@@ -77,14 +73,11 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.JMSAutoCloseableExample</clientClass>
+                           <args>
+                              <param>${basedir}/target/server0</param>
+                           </args>
                         </configuration>
                      </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                     </execution>
                   </executions>
                   <dependencies>
                      <dependency>
@@ -92,41 +85,7 @@ under the License.
                         <artifactId>artemis-jms-auto-closeable-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                  </configuration>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/jms-bridge/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/jms-bridge/pom.xml b/examples/jms/jms-bridge/pom.xml
index ae0b776..54ea63e 100644
--- a/examples/jms/jms-bridge/pom.xml
+++ b/examples/jms/jms-bridge/pom.xml
@@ -62,22 +62,23 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start0</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
                         </configuration>
                      </execution>
                      <execution>
-                        <id>start1</id>
+                        <id>create2</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
-                           <fork>true</fork>
+                           <instance>${basedir}/target/server1</instance>
+                           <configuration>${basedir}/target/classes/activemq/server1</configuration>
                         </configuration>
                      </execution>
                      <execution>
@@ -88,33 +89,9 @@ under the License.
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.JMSBridgeExample</clientClass>
                            <args>
-                              <param>tcp://localhost:61616</param>
-                              <param>tcp://localhost:5455</param>
+                              <param>${basedir}/target/server0</param>
+                              <param>${basedir}/target/server1</param>
                            </args>
-                           <systemProperties>
-                              <property>
-                                 <name>exampleConfigDir</name>
-                                 <value>${basedir}/target/classes/activemq</value>
-                              </property>
-                           </systemProperties>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop0</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop1</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
                         </configuration>
                      </execution>
                   </executions>
@@ -124,46 +101,7 @@ under the License.
                         <artifactId>artemis-jms-jms-bridge-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <systemProperties>
-                        <property>
-                           <name>data.dir</name>
-                           <value>${basedir}/target/</value>
-                        </property>
-                     </systemProperties>
-                  </configuration>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/jms-bridge/src/main/java/org/apache/activemq/artemis/jms/example/JMSBridgeExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/jms-bridge/src/main/java/org/apache/activemq/artemis/jms/example/JMSBridgeExample.java b/examples/jms/jms-bridge/src/main/java/org/apache/activemq/artemis/jms/example/JMSBridgeExample.java
index d1168f5..659d37b 100644
--- a/examples/jms/jms-bridge/src/main/java/org/apache/activemq/artemis/jms/example/JMSBridgeExample.java
+++ b/examples/jms/jms-bridge/src/main/java/org/apache/activemq/artemis/jms/example/JMSBridgeExample.java
@@ -16,14 +16,6 @@
  */
 package org.apache.activemq.artemis.jms.example;
 
-import org.apache.activemq.artemis.jms.bridge.JMSBridge;
-import org.apache.activemq.artemis.jms.bridge.QualityOfServiceMode;
-import org.apache.activemq.artemis.jms.bridge.impl.JMSBridgeImpl;
-import org.apache.activemq.artemis.jms.bridge.impl.JNDIConnectionFactoryFactory;
-import org.apache.activemq.artemis.jms.bridge.impl.JNDIDestinationFactory;
-
-import java.util.Hashtable;
-
 import javax.jms.Connection;
 import javax.jms.ConnectionFactory;
 import javax.jms.MessageConsumer;
@@ -33,22 +25,32 @@ import javax.jms.Session;
 import javax.jms.TextMessage;
 import javax.jms.Topic;
 import javax.naming.InitialContext;
+import java.util.Hashtable;
+
+import org.apache.activemq.artemis.common.example.ActiveMQExample;
+import org.apache.activemq.artemis.jms.bridge.JMSBridge;
+import org.apache.activemq.artemis.jms.bridge.QualityOfServiceMode;
+import org.apache.activemq.artemis.jms.bridge.impl.JMSBridgeImpl;
+import org.apache.activemq.artemis.jms.bridge.impl.JNDIConnectionFactoryFactory;
+import org.apache.activemq.artemis.jms.bridge.impl.JNDIDestinationFactory;
 
 /**
  * An example which sends a message to a source topic and consume from a target queue.
  * The source and target destinations are located on 2 different ActiveMQ Artemis server.
  * The source and target queues are bridged by a JMS Bridge configured and running on the "target" server.
  */
-public class JMSBridgeExample
+public class JMSBridgeExample extends ActiveMQExample
 {
    public static void main(final String[] args) throws Exception
    {
-      if (args.length != 2)
-      {
-         throw new IllegalArgumentException("JMSBridgeExample needs 2 arguments: <source server> <target server>");
-      }
-      String sourceServer = args[0];
-      String targetServer = args[1];
+      new JMSBridgeExample().run(args);
+   }
+
+   @Override
+   public boolean runExample() throws Exception
+   {
+      String sourceServer = ActiveMQExample.DEFAULT_TCP1;
+      String targetServer = ActiveMQExample.DEFAULT_TCP2;
 
       System.out.println("client will publish messages to " + sourceServer +
                          " and receives message from " +
@@ -152,6 +154,8 @@ public class JMSBridgeExample
             targetConnection.close();
          }
       }
+
+      return true;
    }
 
    private static InitialContext createContext(final String server) throws Exception

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/jms-bridge/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/jms-bridge/src/main/resources/activemq/server1/broker.xml b/examples/jms/jms-bridge/src/main/resources/activemq/server1/broker.xml
index a8802d3..aada805 100644
--- a/examples/jms/jms-bridge/src/main/resources/activemq/server1/broker.xml
+++ b/examples/jms/jms-bridge/src/main/resources/activemq/server1/broker.xml
@@ -38,6 +38,7 @@ under the License.
 
       <acceptors>
          <acceptor name="netty">tcp://localhost:5455</acceptor>
+         <acceptor name="netty2">tcp://localhost:61617</acceptor>
       </acceptors>
 
       <security-settings>
@@ -50,4 +51,4 @@ under the License.
       </security-settings>
    </core>
 </configuration>
- 
+

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/jms-completion-listener/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/jms-completion-listener/pom.xml b/examples/jms/jms-completion-listener/pom.xml
index d5fc035..042b3de 100644
--- a/examples/jms/jms-completion-listener/pom.xml
+++ b/examples/jms/jms-completion-listener/pom.xml
@@ -57,17 +57,13 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
                         </configuration>
                      </execution>
                      <execution>
@@ -77,14 +73,11 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.JMSCompletionListenerExample</clientClass>
+                           <args>
+                              <param>${basedir}/target/server0</param>
+                           </args>
                         </configuration>
                      </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                     </execution>
                   </executions>
                   <dependencies>
                      <dependency>
@@ -92,41 +85,7 @@ under the License.
                         <artifactId>artemis-jms-completion-listener-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
-                  </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                  </configuration>
+                   </dependencies>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/jms-context/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/jms-context/pom.xml b/examples/jms/jms-context/pom.xml
index 55e8ab7..7363d88 100644
--- a/examples/jms/jms-context/pom.xml
+++ b/examples/jms/jms-context/pom.xml
@@ -57,17 +57,13 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
                         </configuration>
                      </execution>
                      <execution>
@@ -77,14 +73,11 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.JMSContextExample</clientClass>
+                           <args>
+                              <param>${basedir}/target/server0</param>
+                           </args>
                         </configuration>
                      </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                     </execution>
                   </executions>
                   <dependencies>
                      <dependency>
@@ -92,41 +85,7 @@ under the License.
                         <artifactId>artemis-jms-context-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                  </configuration>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/jms-shared-consumer/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/jms-shared-consumer/pom.xml b/examples/jms/jms-shared-consumer/pom.xml
index 71636ea..5939114 100644
--- a/examples/jms/jms-shared-consumer/pom.xml
+++ b/examples/jms/jms-shared-consumer/pom.xml
@@ -57,17 +57,13 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
                         </configuration>
                      </execution>
                      <execution>
@@ -78,16 +74,10 @@ under the License.
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.JMSSharedConsumerExample</clientClass>
                            <args>
-                              <param>tcp://localhost:61616</param>
+                              <param>${basedir}/target/server0</param>
                            </args>
                         </configuration>
                      </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                     </execution>
                   </executions>
                   <dependencies>
                      <dependency>
@@ -95,41 +85,7 @@ under the License.
                         <artifactId>artemis-jms-shared-consumer-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                  </configuration>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/jms-shared-consumer/src/main/java/org/apache/activemq/artemis/jms/example/JMSSharedConsumerExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/jms-shared-consumer/src/main/java/org/apache/activemq/artemis/jms/example/JMSSharedConsumerExample.java b/examples/jms/jms-shared-consumer/src/main/java/org/apache/activemq/artemis/jms/example/JMSSharedConsumerExample.java
index 4fdbe96..5c50063 100644
--- a/examples/jms/jms-shared-consumer/src/main/java/org/apache/activemq/artemis/jms/example/JMSSharedConsumerExample.java
+++ b/examples/jms/jms-shared-consumer/src/main/java/org/apache/activemq/artemis/jms/example/JMSSharedConsumerExample.java
@@ -16,13 +16,10 @@
  */
 package org.apache.activemq.artemis.jms.example;
 
-import javax.jms.CompletionListener;
 import javax.jms.ConnectionFactory;
 import javax.jms.JMSConsumer;
 import javax.jms.JMSContext;
 import javax.jms.JMSProducer;
-import javax.jms.Message;
-import javax.jms.Queue;
 import javax.jms.Topic;
 import javax.naming.InitialContext;
 
@@ -33,7 +30,7 @@ import org.apache.activemq.artemis.common.example.ActiveMQExample;
  */
 public class JMSSharedConsumerExample extends ActiveMQExample
 {
-   public static void main(final String[] args)
+   public static void main(final String[] args) throws Exception
    {
       new JMSSharedConsumerExample().run(args);
    }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/jmx/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/jmx/pom.xml b/examples/jms/jmx/pom.xml
index 28082ae..f9a3e9a 100644
--- a/examples/jms/jmx/pom.xml
+++ b/examples/jms/jmx/pom.xml
@@ -67,35 +67,13 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <!--we need to fork the server as we have system props that need set pre runtime-->
-                           <fork>true</fork>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                              <property>
-                                 <name>com.sun.management.jmxremote</name>
-                                 <value />
-                              </property>
-                              <property>
-                                 <name>com.sun.management.jmxremote.port</name>
-                                 <value>3000</value>
-                              </property>
-                              <property>
-                                 <name>com.sun.management.jmxremote.ssl</name>
-                                 <value>false</value>
-                              </property>
-                              <property>
-                                 <name>com.sun.management.jmxremote.authenticate</name>
-                                 <value>false</value>
-                              </property>
-                           </systemProperties>
+                           <!-- options used for JMX on the example -->
+                           <javaOptions>-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=3000 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false</javaOptions>
                         </configuration>
                      </execution>
                      <execution>
@@ -105,56 +83,19 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.JMXExample</clientClass>
+                           <args>
+                              <param>${basedir}/target/server0</param>
+                           </args>
                         </configuration>
                      </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                     </execution>
                   </executions>
-                  <dependencies>
+                   <dependencies>
                      <dependency>
                         <groupId>org.apache.activemq.examples.jms</groupId>
                         <artifactId>artemis-jms-jmx-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
-                  </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                  </configuration>
+                   </dependencies>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/large-message/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/large-message/pom.xml b/examples/jms/large-message/pom.xml
index afba566..dd3af5b 100644
--- a/examples/jms/large-message/pom.xml
+++ b/examples/jms/large-message/pom.xml
@@ -57,17 +57,13 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
                         </configuration>
                      </execution>
                      <execution>
@@ -77,20 +73,11 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.LargeMessageExample</clientClass>
-                           <systemProperties>
-                              <property>
-                                 <name>exampleConfigDir</name>
-                                 <value>${basedir}/target/classes/activemq</value>
-                              </property>
-                           </systemProperties>
+                           <args>
+                              <param>${basedir}/target/server0</param>
+                           </args>
                         </configuration>
                      </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                     </execution>
                   </executions>
                   <dependencies>
                      <dependency>
@@ -98,41 +85,7 @@ under the License.
                         <artifactId>artemis-jms-large-message-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
-                  </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                  </configuration>
+                   </dependencies>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/large-message/src/main/java/org/apache/activemq/artemis/jms/example/LargeMessageExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/large-message/src/main/java/org/apache/activemq/artemis/jms/example/LargeMessageExample.java b/examples/jms/large-message/src/main/java/org/apache/activemq/artemis/jms/example/LargeMessageExample.java
index 30f339d..d154ed7 100644
--- a/examples/jms/large-message/src/main/java/org/apache/activemq/artemis/jms/example/LargeMessageExample.java
+++ b/examples/jms/large-message/src/main/java/org/apache/activemq/artemis/jms/example/LargeMessageExample.java
@@ -16,14 +16,6 @@
  */
 package org.apache.activemq.artemis.jms.example;
 
-import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-
 import javax.jms.BytesMessage;
 import javax.jms.Connection;
 import javax.jms.ConnectionFactory;
@@ -32,6 +24,13 @@ import javax.jms.MessageProducer;
 import javax.jms.Queue;
 import javax.jms.Session;
 import javax.naming.InitialContext;
+import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
 
 import org.apache.activemq.artemis.common.example.ActiveMQExample;
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/last-value-queue/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/last-value-queue/pom.xml b/examples/jms/last-value-queue/pom.xml
index 43b6fd5..61f9b7b 100644
--- a/examples/jms/last-value-queue/pom.xml
+++ b/examples/jms/last-value-queue/pom.xml
@@ -57,17 +57,13 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
                         </configuration>
                      </execution>
                      <execution>
@@ -77,14 +73,11 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.LastValueQueueExample</clientClass>
+                           <args>
+                              <param>${basedir}/target/server0</param>
+                           </args>
                         </configuration>
                      </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                     </execution>
                   </executions>
                   <dependencies>
                      <dependency>
@@ -92,42 +85,8 @@ under the License.
                         <artifactId>artemis-jms-last-value-queue-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                  </configuration>
-               </plugin>
+                </plugin>
             </plugins>
          </build>
       </profile>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/management-notifications/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/management-notifications/pom.xml b/examples/jms/management-notifications/pom.xml
index 12d3248..9e023e0 100644
--- a/examples/jms/management-notifications/pom.xml
+++ b/examples/jms/management-notifications/pom.xml
@@ -57,17 +57,13 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
                         </configuration>
                      </execution>
                      <execution>
@@ -77,14 +73,11 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.ManagementNotificationExample</clientClass>
+                           <args>
+                              <param>${basedir}/target/server0</param>
+                           </args>
                         </configuration>
                      </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                     </execution>
                   </executions>
                   <dependencies>
                      <dependency>
@@ -92,42 +85,8 @@ under the License.
                         <artifactId>artemis-jms-management-notifications-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                  </configuration>
-               </plugin>
+                </plugin>
             </plugins>
          </build>
       </profile>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/management/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/management/pom.xml b/examples/jms/management/pom.xml
index 4357e0f..1797ce1 100644
--- a/examples/jms/management/pom.xml
+++ b/examples/jms/management/pom.xml
@@ -57,17 +57,13 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
                         </configuration>
                      </execution>
                      <execution>
@@ -77,14 +73,11 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.ManagementExample</clientClass>
+                           <args>
+                              <param>${basedir}/target/server0</param>
+                           </args>
                         </configuration>
                      </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                     </execution>
                   </executions>
                   <dependencies>
                      <dependency>
@@ -92,41 +85,7 @@ under the License.
                         <artifactId>artemis-jms-management-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                  </configuration>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/message-counters/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/message-counters/pom.xml b/examples/jms/message-counters/pom.xml
index 1c7ac18..f4d8753 100644
--- a/examples/jms/message-counters/pom.xml
+++ b/examples/jms/message-counters/pom.xml
@@ -62,35 +62,15 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <!--we need to fork the server as we have system props that need set pre runtime-->
-                           <fork>true</fork>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                              <property>
-                                 <name>com.sun.management.jmxremote</name>
-                                 <value />
-                              </property>
-                              <property>
-                                 <name>com.sun.management.jmxremote.port</name>
-                                 <value>3001</value>
-                              </property>
-                              <property>
-                                 <name>com.sun.management.jmxremote.ssl</name>
-                                 <value>false</value>
-                              </property>
-                              <property>
-                                 <name>com.sun.management.jmxremote.authenticate</name>
-                                 <value>false</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                           <!-- options used for JMX on the example -->
+                           <javaOptions>-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=3001 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false</javaOptions>
                         </configuration>
                      </execution>
                      <execution>
@@ -100,14 +80,11 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.MessageCounterExample</clientClass>
+                           <args>
+                              <param>${basedir}/target/server0</param>
+                           </args>
                         </configuration>
                      </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                     </execution>
                   </executions>
                   <dependencies>
                      <dependency>
@@ -115,41 +92,7 @@ under the License.
                         <artifactId>artemis-jms-message-counters-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
-                  </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                  </configuration>
+                   </dependencies>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/message-group/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/message-group/pom.xml b/examples/jms/message-group/pom.xml
index 29410c7..e2e6b14 100644
--- a/examples/jms/message-group/pom.xml
+++ b/examples/jms/message-group/pom.xml
@@ -57,17 +57,13 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
                         </configuration>
                      </execution>
                      <execution>
@@ -77,14 +73,11 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.MessageGroupExample</clientClass>
+                           <args>
+                              <param>${basedir}/target/server0</param>
+                           </args>
                         </configuration>
                      </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                     </execution>
                   </executions>
                   <dependencies>
                      <dependency>
@@ -92,42 +85,8 @@ under the License.
                         <artifactId>artemis-jms-message-group-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                  </configuration>
-               </plugin>
+                </plugin>
             </plugins>
          </build>
       </profile>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/message-group2/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/message-group2/pom.xml b/examples/jms/message-group2/pom.xml
index a88c45c..54258f9 100644
--- a/examples/jms/message-group2/pom.xml
+++ b/examples/jms/message-group2/pom.xml
@@ -57,17 +57,13 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
                         </configuration>
                      </execution>
                      <execution>
@@ -77,14 +73,11 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.MessageGroup2Example</clientClass>
+                           <args>
+                              <param>${basedir}/target/server0</param>
+                           </args>
                         </configuration>
                      </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                     </execution>
                   </executions>
                   <dependencies>
                      <dependency>
@@ -92,41 +85,7 @@ under the License.
                         <artifactId>artemis-jms-message-group2-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                  </configuration>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/message-priority/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/message-priority/pom.xml b/examples/jms/message-priority/pom.xml
index 805380c..5b35473 100644
--- a/examples/jms/message-priority/pom.xml
+++ b/examples/jms/message-priority/pom.xml
@@ -57,17 +57,13 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
                         </configuration>
                      </execution>
                      <execution>
@@ -77,14 +73,11 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.MessagePriorityExample</clientClass>
+                           <args>
+                              <param>${basedir}/target/server0</param>
+                           </args>
                         </configuration>
                      </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                     </execution>
                   </executions>
                   <dependencies>
                      <dependency>
@@ -92,41 +85,7 @@ under the License.
                         <artifactId>artemis-jms-message-priority-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
-                  </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                  </configuration>
+                   </dependencies>
                </plugin>
             </plugins>
          </build>


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

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/replicated-multiple-failover/src/main/resources/activemq/server2/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/replicated-multiple-failover/src/main/resources/activemq/server2/artemis-users.properties b/examples/jms/replicated-multiple-failover/src/main/resources/activemq/server2/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/replicated-multiple-failover/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/replicated-multiple-failover/src/main/resources/activemq/server2/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/replicated-multiple-failover/src/main/resources/activemq/server2/broker.xml b/examples/jms/replicated-multiple-failover/src/main/resources/activemq/server2/broker.xml
index 804f63f..fbbd45f 100644
--- a/examples/jms/replicated-multiple-failover/src/main/resources/activemq/server2/broker.xml
+++ b/examples/jms/replicated-multiple-failover/src/main/resources/activemq/server2/broker.xml
@@ -29,13 +29,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>${data.dir}/server2/data/messaging/bindings</bindings-directory>
+      <bindings-directory>${data.dir:./data}/bindings</bindings-directory>
 
-      <journal-directory>${data.dir}/server2/data/messaging/journal</journal-directory>
+      <journal-directory>${data.dir:./data}/journal</journal-directory>
 
-      <large-messages-directory>${data.dir}/server2/data/messaging/largemessages</large-messages-directory>
+      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir}/server2/data/messaging/paging</paging-directory>
+      <paging-directory>${data.dir:./data}/paging</paging-directory>
 
       <ha-policy>
          <replication>
@@ -43,6 +43,7 @@ under the License.
          </replication>
       </ha-policy>
 
+      <!-- Connectors -->
       <connectors>
          <connector name="netty-connector">tcp://localhost:61618</connector>
       </connectors>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/replicated-transaction-failover/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/replicated-transaction-failover/pom.xml b/examples/jms/replicated-transaction-failover/pom.xml
index b6def66..2c10c66 100644
--- a/examples/jms/replicated-transaction-failover/pom.xml
+++ b/examples/jms/replicated-transaction-failover/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>
@@ -68,7 +68,7 @@ under the License.
                         </configuration>
                      </execution>
                      <execution>
-                        <id>create2</id>
+                        <id>create1</id>
                         <goals>
                            <goal>create</goal>
                         </goals>
@@ -104,5 +104,4 @@ under the License.
          </build>
       </profile>
    </profiles>
-
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/replicated-transaction-failover/src/main/java/org/apache/activemq/artemis/jms/example/ReplicatedTransactionFailoverExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/replicated-transaction-failover/src/main/java/org/apache/activemq/artemis/jms/example/ReplicatedTransactionFailoverExample.java b/examples/jms/replicated-transaction-failover/src/main/java/org/apache/activemq/artemis/jms/example/ReplicatedTransactionFailoverExample.java
index f202e2e..dcc89d2 100644
--- a/examples/jms/replicated-transaction-failover/src/main/java/org/apache/activemq/artemis/jms/example/ReplicatedTransactionFailoverExample.java
+++ b/examples/jms/replicated-transaction-failover/src/main/java/org/apache/activemq/artemis/jms/example/ReplicatedTransactionFailoverExample.java
@@ -16,6 +16,9 @@
  */
 package org.apache.activemq.artemis.jms.example;
 
+import org.apache.activemq.artemis.api.core.Message;
+import org.apache.activemq.artemis.util.ServerUtil;
+
 import javax.jms.Connection;
 import javax.jms.ConnectionFactory;
 import javax.jms.MessageConsumer;
@@ -26,29 +29,23 @@ import javax.jms.TextMessage;
 import javax.jms.TransactionRolledBackException;
 import javax.naming.InitialContext;
 
-import org.apache.activemq.artemis.api.core.Message;
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
-
 /**
  * A simple example that demonstrates failover of the JMS connection from one node to another
  * when the live server crashes using a JMS <em>transacted</em> session and replication.
  */
-public class ReplicatedTransactionFailoverExample extends ActiveMQExample
+public class ReplicatedTransactionFailoverExample
 {
+   private static Process server0;
+
+   private static Process server1;
 
    // You need to guarantee uniqueIDs when using duplicate detection
    // It needs to be unique even after a restart
    // as these IDs are stored on the journal for control
    // We recommend some sort of UUID, but for this example the Current Time as string would be enough
-   String uniqueID = Long.toString(System.currentTimeMillis());
-
-   public static void main(final String[] args)
-   {
-      new ReplicatedTransactionFailoverExample().run(args);
-   }
+   private static String uniqueID = Long.toString(System.currentTimeMillis());
 
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(final String[] args) throws Exception
    {
       final int numMessages = 10;
 
@@ -58,6 +55,9 @@ public class ReplicatedTransactionFailoverExample extends ActiveMQExample
 
       try
       {
+         server0 = ServerUtil.startServer(args[0], ReplicatedTransactionFailoverExample.class.getSimpleName() + "0", 0, 5000);
+         server1 = ServerUtil.startServer(args[1], ReplicatedTransactionFailoverExample.class.getSimpleName() + "1", 1, 5000);
+
          // Step 1. Get an initial context for looking up JNDI from the server #1
          initialContext = new InitialContext();
 
@@ -108,9 +108,7 @@ public class ReplicatedTransactionFailoverExample extends ActiveMQExample
 
             if (message0 == null)
             {
-               System.err.println("Example failed - message wasn't received");
-
-               return false;
+               throw new IllegalStateException("Example failed - message wasn't received");
             }
 
             System.out.println("Got message: " + message0.getText());
@@ -119,8 +117,6 @@ public class ReplicatedTransactionFailoverExample extends ActiveMQExample
          session.commit();
 
          System.out.println("Other message on the server? " + consumer.receive(5000));
-
-         return true;
       }
       finally
       {
@@ -135,10 +131,13 @@ public class ReplicatedTransactionFailoverExample extends ActiveMQExample
          {
             initialContext.close();
          }
+
+         ServerUtil.killServer(server0);
+         ServerUtil.killServer(server1);
       }
    }
 
-   private void sendMessages(final Session session,
+   private static void sendMessages(final Session session,
                              final MessageProducer producer,
                              final int numMessages,
                              final boolean killServer) throws Exception
@@ -160,10 +159,7 @@ public class ReplicatedTransactionFailoverExample extends ActiveMQExample
 
       if (killServer)
       {
-         Thread.sleep(5000);
-
-         killServer(0);
-
+         ServerUtil.killServer(server0);
       }
 
       // We send the remaining half of messages

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/replicated-transaction-failover/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/replicated-transaction-failover/src/main/resources/activemq/server0/artemis-roles.properties b/examples/jms/replicated-transaction-failover/src/main/resources/activemq/server0/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/replicated-transaction-failover/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/replicated-transaction-failover/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/replicated-transaction-failover/src/main/resources/activemq/server0/artemis-users.properties b/examples/jms/replicated-transaction-failover/src/main/resources/activemq/server0/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/replicated-transaction-failover/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/replicated-transaction-failover/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/replicated-transaction-failover/src/main/resources/activemq/server0/broker.xml b/examples/jms/replicated-transaction-failover/src/main/resources/activemq/server0/broker.xml
index 597f828..9233f17 100644
--- a/examples/jms/replicated-transaction-failover/src/main/resources/activemq/server0/broker.xml
+++ b/examples/jms/replicated-transaction-failover/src/main/resources/activemq/server0/broker.xml
@@ -29,13 +29,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
+      <bindings-directory>${data.dir:./data}/bindings</bindings-directory>
 
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
+      <journal-directory>${data.dir:./data}/journal</journal-directory>
 
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
+      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
+      <paging-directory>${data.dir:./data}/paging</paging-directory>
 
       <ha-policy>
          <replication>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/replicated-transaction-failover/src/main/resources/activemq/server1/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/replicated-transaction-failover/src/main/resources/activemq/server1/artemis-roles.properties b/examples/jms/replicated-transaction-failover/src/main/resources/activemq/server1/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/replicated-transaction-failover/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/replicated-transaction-failover/src/main/resources/activemq/server1/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/replicated-transaction-failover/src/main/resources/activemq/server1/artemis-users.properties b/examples/jms/replicated-transaction-failover/src/main/resources/activemq/server1/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/replicated-transaction-failover/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/replicated-transaction-failover/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/replicated-transaction-failover/src/main/resources/activemq/server1/broker.xml b/examples/jms/replicated-transaction-failover/src/main/resources/activemq/server1/broker.xml
index cdefc88..848525e 100644
--- a/examples/jms/replicated-transaction-failover/src/main/resources/activemq/server1/broker.xml
+++ b/examples/jms/replicated-transaction-failover/src/main/resources/activemq/server1/broker.xml
@@ -29,13 +29,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>${data.dir}/server1/data/messaging/bindings</bindings-directory>
+      <bindings-directory>${data.dir:./data}/bindings</bindings-directory>
 
-      <journal-directory>${data.dir}/server1/data/messaging/journal</journal-directory>
+      <journal-directory>${data.dir:./data}/journal</journal-directory>
 
-      <large-messages-directory>${data.dir}/server1/data/messaging/largemessages</large-messages-directory>
+      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir}/server1/data/messaging/paging</paging-directory>
+      <paging-directory>${data.dir:./data}/paging</paging-directory>
 
       <ha-policy>
          <replication>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/request-reply/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/request-reply/pom.xml b/examples/jms/request-reply/pom.xml
index 5880d9d..e8849d8 100644
--- a/examples/jms/request-reply/pom.xml
+++ b/examples/jms/request-reply/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>
@@ -61,9 +56,18 @@ under the License.
                         <goals>
                            <goal>create</goal>
                         </goals>
+                     </execution>
+                     <execution>
+                        <id>start</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
                         <configuration>
-                           <instance>${basedir}/target/server0</instance>
-                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                           <spawn>true</spawn>
+                           <testURI>tcp://localhost:61616</testURI>
+                           <args>
+                              <param>run</param>
+                           </args>
                         </configuration>
                      </execution>
                      <execution>
@@ -73,8 +77,16 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.RequestReplyExample</clientClass>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>stop</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
                            <args>
-                              <param>${basedir}/target/server0</param>
+                              <param>stop</param>
                            </args>
                         </configuration>
                      </execution>
@@ -91,5 +103,4 @@ under the License.
          </build>
       </profile>
    </profiles>
-
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/request-reply/src/main/java/org/apache/activemq/artemis/jms/example/RequestReplyExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/request-reply/src/main/java/org/apache/activemq/artemis/jms/example/RequestReplyExample.java b/examples/jms/request-reply/src/main/java/org/apache/activemq/artemis/jms/example/RequestReplyExample.java
index 751f2da..7e9093f 100644
--- a/examples/jms/request-reply/src/main/java/org/apache/activemq/artemis/jms/example/RequestReplyExample.java
+++ b/examples/jms/request-reply/src/main/java/org/apache/activemq/artemis/jms/example/RequestReplyExample.java
@@ -33,8 +33,6 @@ import javax.jms.TemporaryQueue;
 import javax.jms.TextMessage;
 import javax.naming.InitialContext;
 
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
-
 /**
  * A simple JMS example that shows how to use Request/Replay style messaging.
  *
@@ -43,18 +41,11 @@ import org.apache.activemq.artemis.common.example.ActiveMQExample;
  *
  * Or better still use the correlation id, and just store the requests in a map, then you don't need a temporary queue at all
  */
-public class RequestReplyExample extends ActiveMQExample
+public class RequestReplyExample
 {
-   private final Map<String, TextMessage> requestMap = new HashMap<String, TextMessage>();
-
-   public static void main(final String[] args)
-   {
-      new RequestReplyExample().run(args);
-   }
-
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(final String[] args) throws Exception
    {
+      final Map<String, TextMessage> requestMap = new HashMap<String, TextMessage>();
       Connection connection = null;
       InitialContext initialContext = null;
 
@@ -129,8 +120,6 @@ public class RequestReplyExample extends ActiveMQExample
 
          // Step 19. Shutdown the request server
          server.shutdown();
-
-         return true;
       }
       finally
       {
@@ -146,79 +135,78 @@ public class RequestReplyExample extends ActiveMQExample
          }
       }
    }
+}
 
-   private class SimpleRequestServer implements MessageListener
-   {
-      private Connection connection;
+class SimpleRequestServer implements MessageListener
+{
+   private Connection connection;
 
-      private Session session;
+   private Session session;
 
-      MessageProducer replyProducer;
+   MessageProducer replyProducer;
 
-      MessageConsumer requestConsumer;
+   MessageConsumer requestConsumer;
 
-      public void start() throws Exception
-      {
-         // Get an initial context to perform the JNDI lookup.
-         InitialContext initialContext = new InitialContext();
+   public void start() throws Exception
+   {
+      // Get an initial context to perform the JNDI lookup.
+      InitialContext initialContext = new InitialContext();
 
-         // Lookup the queue to receive the request message
-         Queue requestQueue = (Queue)initialContext.lookup("queue/exampleQueue");
+      // Lookup the queue to receive the request message
+      Queue requestQueue = (Queue)initialContext.lookup("queue/exampleQueue");
 
-         // Lookup for the Connection Factory
-         ConnectionFactory cfact = (ConnectionFactory)initialContext.lookup("ConnectionFactory");
+      // Lookup for the Connection Factory
+      ConnectionFactory cfact = (ConnectionFactory)initialContext.lookup("ConnectionFactory");
 
-         // Create a connection
-         connection = cfact.createConnection();
+      // Create a connection
+      connection = cfact.createConnection();
 
-         // Start the connection;
-         connection.start();
+      // Start the connection;
+      connection.start();
 
-         // Create a session
-         session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+      // Create a session
+      session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
 
-         // Create a producer to send the reply message
-         replyProducer = session.createProducer(null);
+      // Create a producer to send the reply message
+      replyProducer = session.createProducer(null);
 
-         // Create the request comsumer
-         requestConsumer = session.createConsumer(requestQueue);
+      // Create the request comsumer
+      requestConsumer = session.createConsumer(requestQueue);
 
-         // register the listener
-         requestConsumer.setMessageListener(this);
-      }
+      // register the listener
+      requestConsumer.setMessageListener(this);
+   }
 
-      public void onMessage(final Message request)
+   public void onMessage(final Message request)
+   {
+      try
       {
-         try
-         {
-            System.out.println("Received request message: " + ((TextMessage)request).getText());
+         System.out.println("Received request message: " + ((TextMessage)request).getText());
 
-            // Extract the ReplyTo destination
-            Destination replyDestination = request.getJMSReplyTo();
+         // Extract the ReplyTo destination
+         Destination replyDestination = request.getJMSReplyTo();
 
-            System.out.println("Reply to queue: " + replyDestination);
+         System.out.println("Reply to queue: " + replyDestination);
 
-            // Create the reply message
-            TextMessage replyMessage = session.createTextMessage("A reply message");
+         // Create the reply message
+         TextMessage replyMessage = session.createTextMessage("A reply message");
 
-            // Set the CorrelationID, using message id.
-            replyMessage.setJMSCorrelationID(request.getJMSMessageID());
+         // Set the CorrelationID, using message id.
+         replyMessage.setJMSCorrelationID(request.getJMSMessageID());
 
-            // Send out the reply message
-            replyProducer.send(replyDestination, replyMessage);
+         // Send out the reply message
+         replyProducer.send(replyDestination, replyMessage);
 
-            System.out.println("Reply sent");
-         }
-         catch (JMSException e)
-         {
-            e.printStackTrace();
-         }
+         System.out.println("Reply sent");
       }
-
-      public void shutdown() throws JMSException
+      catch (JMSException e)
       {
-         connection.close();
+         e.printStackTrace();
       }
    }
 
+   public void shutdown() throws JMSException
+   {
+      connection.close();
+   }
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/scale-down/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/scale-down/pom.xml b/examples/jms/scale-down/pom.xml
index 5a1cd36..596273b 100644
--- a/examples/jms/scale-down/pom.xml
+++ b/examples/jms/scale-down/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>
@@ -68,7 +68,7 @@ under the License.
                         </configuration>
                      </execution>
                      <execution>
-                        <id>create2</id>
+                        <id>create1</id>
                         <goals>
                            <goal>create</goal>
                         </goals>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/scale-down/src/main/java/org/apache/activemq/artemis/jms/example/ScaleDownExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/scale-down/src/main/java/org/apache/activemq/artemis/jms/example/ScaleDownExample.java b/examples/jms/scale-down/src/main/java/org/apache/activemq/artemis/jms/example/ScaleDownExample.java
index f370491..73adf33 100644
--- a/examples/jms/scale-down/src/main/java/org/apache/activemq/artemis/jms/example/ScaleDownExample.java
+++ b/examples/jms/scale-down/src/main/java/org/apache/activemq/artemis/jms/example/ScaleDownExample.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,17 @@ 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 a colocated server
  *
  */
-public class ScaleDownExample extends ActiveMQExample
+public class ScaleDownExample
 {
-   public static void main(final String[] args)
-   {
-      new ScaleDownExample().run(args);
-   }
+   private static Process server0;
+
+   private static Process server1;
 
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(final String[] args) throws Exception
    {
       final int numMessages = 30;
 
@@ -52,16 +50,19 @@ public class ScaleDownExample extends ActiveMQExample
 
       try
       {
+         server0 = ServerUtil.startServer(args[0], ScaleDownExample.class.getSimpleName() + "0", 0, 5000);
+         server1 = ServerUtil.startServer(args[1], ScaleDownExample.class.getSimpleName() + "1", 1, 5000);
+
          // Step 1. Get an initial context for looking up JNDI for both servers
          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 + "?ha=true&retryInterval=1000&retryIntervalMultiplier=1.0&reconnectAttempts=-1");
+         properties.put("connectionFactory.ConnectionFactory", "tcp://localhost:61616?ha=true&retryInterval=1000&retryIntervalMultiplier=1.0&reconnectAttempts=-1");
          properties.put("queue.queue/exampleQueue", "exampleQueue");
          initialContext = 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 + "?ha=true&retryInterval=1000&retryIntervalMultiplier=1.0&reconnectAttempts=-1");
+         properties.put("connectionFactory.ConnectionFactory", "tcp://localhost:61617?ha=true&retryInterval=1000&retryIntervalMultiplier=1.0&reconnectAttempts=-1");
          initialContext1 = new InitialContext(properties);
 
          // Step 2. Look up the JMS resources from JNDI
@@ -92,12 +93,8 @@ public class ScaleDownExample extends ActiveMQExample
             System.out.println("Sent message: " + message.getText());
          }
 
-         // Step 7. Crash server #1, the live server, and wait a little while to make sure
-         // it has really crashed
-         Thread.sleep(5000);
-         killServer(1);
-         Thread.sleep(5000);
-
+         // Step 7. Crash server #1
+         ServerUtil.killServer(server1);
 
          // Step 8. start the connection ready to receive messages
          connection.start();
@@ -114,8 +111,6 @@ public class ScaleDownExample extends ActiveMQExample
             System.out.println("Got message: " + message0.getText());
          }
          message0.acknowledge();
-
-         return true;
       }
       finally
       {
@@ -139,7 +134,9 @@ public class ScaleDownExample extends ActiveMQExample
          {
             initialContext1.close();
          }
+
+         ServerUtil.killServer(server0);
+         ServerUtil.killServer(server1);
       }
    }
-
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/scale-down/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/scale-down/src/main/resources/activemq/server0/artemis-roles.properties b/examples/jms/scale-down/src/main/resources/activemq/server0/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/scale-down/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/scale-down/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/scale-down/src/main/resources/activemq/server0/artemis-users.properties b/examples/jms/scale-down/src/main/resources/activemq/server0/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/scale-down/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/scale-down/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/scale-down/src/main/resources/activemq/server0/broker.xml b/examples/jms/scale-down/src/main/resources/activemq/server0/broker.xml
index b2e1887..1a08c9d 100644
--- a/examples/jms/scale-down/src/main/resources/activemq/server0/broker.xml
+++ b/examples/jms/scale-down/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:../data}/bindings</bindings-directory>
+      <journal-directory>${data.dir:./data}/journal</journal-directory>
 
-      <journal-directory>${data.dir:../data}/journal</journal-directory>
+      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
 
-      <large-messages-directory>${data.dir:../data}/largemessages</large-messages-directory>
-
-      <paging-directory>${data.dir:../data}/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/scale-down/src/main/resources/activemq/server1/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/scale-down/src/main/resources/activemq/server1/artemis-roles.properties b/examples/jms/scale-down/src/main/resources/activemq/server1/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/scale-down/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/scale-down/src/main/resources/activemq/server1/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/scale-down/src/main/resources/activemq/server1/artemis-users.properties b/examples/jms/scale-down/src/main/resources/activemq/server1/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/scale-down/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/scale-down/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/scale-down/src/main/resources/activemq/server1/broker.xml b/examples/jms/scale-down/src/main/resources/activemq/server1/broker.xml
index e198399..87dd4aa 100644
--- a/examples/jms/scale-down/src/main/resources/activemq/server1/broker.xml
+++ b/examples/jms/scale-down/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:../data}/bindings</bindings-directory>
+      <journal-directory>${data.dir:./data}/journal</journal-directory>
 
-      <journal-directory>${data.dir:../data}/journal</journal-directory>
+      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
 
-      <large-messages-directory>${data.dir:../data}/largemessages</large-messages-directory>
-
-      <paging-directory>${data.dir:../data}/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/scheduled-message/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/scheduled-message/pom.xml b/examples/jms/scheduled-message/pom.xml
index 676e557..cfda2ac 100644
--- a/examples/jms/scheduled-message/pom.xml
+++ b/examples/jms/scheduled-message/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-core-client</artifactId>
          <version>${project.version}</version>
       </dependency>
       <dependency>
@@ -61,9 +61,18 @@ under the License.
                         <goals>
                            <goal>create</goal>
                         </goals>
+                     </execution>
+                     <execution>
+                        <id>start</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
                         <configuration>
-                           <instance>${basedir}/target/server0</instance>
-                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                           <spawn>true</spawn>
+                           <testURI>tcp://localhost:61616</testURI>
+                           <args>
+                              <param>run</param>
+                           </args>
                         </configuration>
                      </execution>
                      <execution>
@@ -73,8 +82,16 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.ScheduledMessageExample</clientClass>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>stop</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
                            <args>
-                              <param>${basedir}/target/server0</param>
+                              <param>stop</param>
                            </args>
                         </configuration>
                      </execution>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/scheduled-message/src/main/java/org/apache/activemq/artemis/jms/example/ScheduledMessageExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/scheduled-message/src/main/java/org/apache/activemq/artemis/jms/example/ScheduledMessageExample.java b/examples/jms/scheduled-message/src/main/java/org/apache/activemq/artemis/jms/example/ScheduledMessageExample.java
index 2fa38bf..ffc99d8 100644
--- a/examples/jms/scheduled-message/src/main/java/org/apache/activemq/artemis/jms/example/ScheduledMessageExample.java
+++ b/examples/jms/scheduled-message/src/main/java/org/apache/activemq/artemis/jms/example/ScheduledMessageExample.java
@@ -29,17 +29,10 @@ import javax.jms.TextMessage;
 import javax.naming.InitialContext;
 
 import org.apache.activemq.artemis.api.core.Message;
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
 
-public class ScheduledMessageExample extends ActiveMQExample
+public class ScheduledMessageExample
 {
-   public static void main(final String[] args)
-   {
-      new ScheduledMessageExample().run(args);
-   }
-
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(final String[] args) throws Exception
    {
       Connection connection = null;
       InitialContext initialContext = null;
@@ -89,8 +82,6 @@ public class ScheduledMessageExample extends ActiveMQExample
 
          System.out.println("Received message: " + messageReceived.getText());
          System.out.println("Time of receive: " + formatter.format(new Date()));
-
-         return true;
       }
       finally
       {
@@ -105,5 +96,4 @@ public class ScheduledMessageExample extends ActiveMQExample
          }
       }
    }
-
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/scheduled-message/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/scheduled-message/src/main/resources/activemq/server0/artemis-roles.properties b/examples/jms/scheduled-message/src/main/resources/activemq/server0/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/scheduled-message/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/scheduled-message/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/scheduled-message/src/main/resources/activemq/server0/artemis-users.properties b/examples/jms/scheduled-message/src/main/resources/activemq/server0/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/scheduled-message/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/scheduled-message/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/scheduled-message/src/main/resources/activemq/server0/broker.xml b/examples/jms/scheduled-message/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index 7690094..0000000
--- a/examples/jms/scheduled-message/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,60 +0,0 @@
-<?xml version='1.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.
--->
-
-<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-               xmlns="urn:activemq"
-               xsi:schemaLocation="urn:activemq /schema/artemis-server.xsd">
-
-   <jms xmlns="urn:activemq:jms">
-      <!--the queue used by the example-->
-      <queue name="exampleQueue"/>
-   </jms>
-
-   <core xmlns="urn:activemq:core">
-
-      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
-
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
-
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
-
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
-      </acceptors>
-
-      <!-- Other config -->
-
-      <security-settings>
-         <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
-            <permission type="createDurableQueue" roles="guest"/>
-            <permission type="deleteDurableQueue" roles="guest"/>
-            <permission type="createNonDurableQueue" roles="guest"/>
-            <permission type="deleteNonDurableQueue" roles="guest"/>
-            <permission type="consume" roles="guest"/>
-            <permission type="send" roles="guest"/>
-         </security-setting>
-      </security-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/security/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/security/pom.xml b/examples/jms/security/pom.xml
index 88330b1..a58e177 100644
--- a/examples/jms/security/pom.xml
+++ b/examples/jms/security/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>
@@ -61,9 +56,20 @@ under the License.
                         <goals>
                            <goal>create</goal>
                         </goals>
+                     </execution>
+                     <execution>
+                        <id>start</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
                         <configuration>
-                           <instance>${basedir}/target/server0</instance>
-                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                           <spawn>true</spawn>
+                           <testURI>tcp://localhost:61616</testURI>
+                           <testUser>bill</testUser>
+                           <testPassword>activemq</testPassword>
+                           <args>
+                              <param>run</param>
+                           </args>
                         </configuration>
                      </execution>
                      <execution>
@@ -73,8 +79,16 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.SecurityExample</clientClass>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>stop</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
                            <args>
-                              <param>${basedir}/target/server0</param>
+                              <param>stop</param>
                            </args>
                         </configuration>
                      </execution>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/security/src/main/java/org/apache/activemq/artemis/jms/example/SecurityExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/security/src/main/java/org/apache/activemq/artemis/jms/example/SecurityExample.java b/examples/jms/security/src/main/java/org/apache/activemq/artemis/jms/example/SecurityExample.java
index eb7ffc0..fc83fe7 100644
--- a/examples/jms/security/src/main/java/org/apache/activemq/artemis/jms/example/SecurityExample.java
+++ b/examples/jms/security/src/main/java/org/apache/activemq/artemis/jms/example/SecurityExample.java
@@ -27,20 +27,13 @@ import javax.jms.TextMessage;
 import javax.jms.Topic;
 import javax.naming.InitialContext;
 
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
-
-public class SecurityExample extends ActiveMQExample
+public class SecurityExample
 {
-   private boolean result = true;
-
-   public static void main(final String[] args)
-   {
-      new SecurityExample().run(args);
-   }
 
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(final String[] args) throws Exception
    {
+      boolean result = true;
+      Connection failConnection = null;
       Connection billConnection = null;
       Connection andrewConnection = null;
       Connection frankConnection = null;
@@ -63,7 +56,7 @@ public class SecurityExample extends ActiveMQExample
          // Step 4. Try to create a JMS Connection without user/password. It will fail.
          try
          {
-            cf.createConnection();
+            failConnection = cf.createConnection();
             result = false;
          }
          catch (JMSSecurityException e)
@@ -136,12 +129,14 @@ public class SecurityExample extends ActiveMQExample
          // Step 18. Check permissions on news.us.usTopic for sam: can't send but can receive
          checkUserReceiveNoSend(usTopic, samConnection, "sam", frankConnection);
          System.out.println("-------------------------------------------------------------------------------------");
-
-         return result;
       }
       finally
       {
          // Step 19. Be sure to close our JMS resources!
+         if (failConnection != null)
+         {
+            failConnection.close();
+         }
          if (billConnection != null)
          {
             billConnection.close();
@@ -168,7 +163,7 @@ public class SecurityExample extends ActiveMQExample
    }
 
    // Check the user can receive message but cannot send message.
-   private void checkUserReceiveNoSend(final Topic topic,
+   private static void checkUserReceiveNoSend(final Topic topic,
                                        final Connection connection,
                                        final String user,
                                        final Connection sendingConn) throws JMSException
@@ -181,12 +176,11 @@ public class SecurityExample extends ActiveMQExample
       try
       {
          producer.send(msg);
-         System.out.println("Security setting is broken! User " + user +
+         throw new IllegalStateException("Security setting is broken! User " + user +
                             " can send message [" +
                             msg.getText() +
                             "] to topic " +
                             topic);
-         result = false;
       }
       catch (JMSException e)
       {
@@ -206,8 +200,7 @@ public class SecurityExample extends ActiveMQExample
       }
       else
       {
-         System.out.println("Security setting is broken! User " + user + " cannot receive message from topic " + topic);
-         result = false;
+         throw new IllegalStateException("Security setting is broken! User " + user + " cannot receive message from topic " + topic);
       }
 
       session1.close();
@@ -215,7 +208,7 @@ public class SecurityExample extends ActiveMQExample
    }
 
    // Check the user can send message but cannot receive message
-   private void checkUserSendNoReceive(final Topic topic,
+   private static void checkUserSendNoReceive(final Topic topic,
                                        final Connection connection,
                                        final String user,
                                        final Connection receivingConn) throws JMSException
@@ -244,12 +237,11 @@ public class SecurityExample extends ActiveMQExample
       }
       else
       {
-         System.out.println("Security setting is broken! User " + user +
+         throw new IllegalStateException("Security setting is broken! User " + user +
                             " cannot send message [" +
                             msg.getText() +
                             "] to topic " +
                             topic);
-         result = false;
       }
 
       session.close();
@@ -257,7 +249,7 @@ public class SecurityExample extends ActiveMQExample
    }
 
    // Check the user has neither send nor receive permission on topic
-   private void checkUserNoSendNoReceive(final Topic topic, final Connection connection, final String user) throws JMSException
+   private static void checkUserNoSendNoReceive(final Topic topic, final Connection connection, final String user) throws JMSException
    {
       Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
       MessageProducer producer = session.createProducer(topic);
@@ -275,12 +267,11 @@ public class SecurityExample extends ActiveMQExample
       try
       {
          producer.send(msg);
-         System.out.println("Security setting is broken! User " + user +
+         throw new IllegalStateException("Security setting is broken! User " + user +
                             " can send message [" +
                             msg.getText() +
                             "] to topic " +
                             topic);
-         result = false;
       }
       catch (JMSException e)
       {
@@ -291,7 +282,7 @@ public class SecurityExample extends ActiveMQExample
    }
 
    // Check the user connection has both send and receive permissions on the topic
-   private void checkUserSendAndReceive(final Topic topic, final Connection connection, final String user) throws JMSException
+   private static void checkUserSendAndReceive(final Topic topic, final Connection connection, final String user) throws JMSException
    {
       Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
       TextMessage msg = session.createTextMessage("hello-world-4");
@@ -306,13 +297,12 @@ public class SecurityExample extends ActiveMQExample
       }
       else
       {
-         System.out.println("Error! User " + user + " cannot receive the message! ");
-         result = false;
+         throw new IllegalStateException("Error! User " + user + " cannot receive the message! ");
       }
       session.close();
    }
 
-   private Connection createConnection(final String username, final String password, final ConnectionFactory cf) throws JMSException
+   private static Connection createConnection(final String username, final String password, final ConnectionFactory cf) throws JMSException
    {
       return cf.createConnection(username, password);
    }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/send-acknowledgements/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/send-acknowledgements/pom.xml b/examples/jms/send-acknowledgements/pom.xml
index 7aa59cf..6d22b09 100644
--- a/examples/jms/send-acknowledgements/pom.xml
+++ b/examples/jms/send-acknowledgements/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-jms-client</artifactId>
          <version>${project.version}</version>
       </dependency>
       <dependency>
@@ -61,9 +61,18 @@ under the License.
                         <goals>
                            <goal>create</goal>
                         </goals>
+                     </execution>
+                     <execution>
+                        <id>start</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
                         <configuration>
-                           <instance>${basedir}/target/server0</instance>
-                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                           <spawn>true</spawn>
+                           <testURI>tcp://localhost:61616</testURI>
+                           <args>
+                              <param>run</param>
+                           </args>
                         </configuration>
                      </execution>
                      <execution>
@@ -73,8 +82,16 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.SendAcknowledgementsExample</clientClass>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>stop</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
                            <args>
-                              <param>${basedir}/target/server0</param>
+                              <param>stop</param>
                            </args>
                         </configuration>
                      </execution>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/send-acknowledgements/src/main/java/org/apache/activemq/artemis/jms/example/SendAcknowledgementsExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/send-acknowledgements/src/main/java/org/apache/activemq/artemis/jms/example/SendAcknowledgementsExample.java b/examples/jms/send-acknowledgements/src/main/java/org/apache/activemq/artemis/jms/example/SendAcknowledgementsExample.java
index 03fb866..99fb0ba 100644
--- a/examples/jms/send-acknowledgements/src/main/java/org/apache/activemq/artemis/jms/example/SendAcknowledgementsExample.java
+++ b/examples/jms/send-acknowledgements/src/main/java/org/apache/activemq/artemis/jms/example/SendAcknowledgementsExample.java
@@ -27,7 +27,6 @@ import javax.naming.InitialContext;
 import org.apache.activemq.artemis.api.core.Message;
 import org.apache.activemq.artemis.api.core.client.ClientSession;
 import org.apache.activemq.artemis.api.core.client.SendAcknowledgementHandler;
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
 import org.apache.activemq.artemis.jms.client.ActiveMQSession;
 
 /**
@@ -37,15 +36,9 @@ import org.apache.activemq.artemis.jms.client.ActiveMQSession;
  * to the stream of messages being sent to the server.
  * For more information please see the readme.html file
  */
-public class SendAcknowledgementsExample extends ActiveMQExample
+public class SendAcknowledgementsExample
 {
-   public static void main(final String[] args)
-   {
-      new SendAcknowledgementsExample().run(args);
-   }
-
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(final String[] args) throws Exception
    {
       Connection connection = null;
       InitialContext initialContext = null;
@@ -101,8 +94,6 @@ public class SendAcknowledgementsExample extends ActiveMQExample
 
             System.out.println("Sent message " + i);
          }
-
-         return true;
       }
       finally
       {
@@ -118,5 +109,4 @@ public class SendAcknowledgementsExample extends ActiveMQExample
          }
       }
    }
-
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/send-acknowledgements/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/send-acknowledgements/src/main/resources/activemq/server0/artemis-roles.properties b/examples/jms/send-acknowledgements/src/main/resources/activemq/server0/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/send-acknowledgements/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/send-acknowledgements/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/send-acknowledgements/src/main/resources/activemq/server0/artemis-users.properties b/examples/jms/send-acknowledgements/src/main/resources/activemq/server0/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/send-acknowledgements/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/send-acknowledgements/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/send-acknowledgements/src/main/resources/activemq/server0/broker.xml b/examples/jms/send-acknowledgements/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index 7690094..0000000
--- a/examples/jms/send-acknowledgements/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,60 +0,0 @@
-<?xml version='1.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.
--->
-
-<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-               xmlns="urn:activemq"
-               xsi:schemaLocation="urn:activemq /schema/artemis-server.xsd">
-
-   <jms xmlns="urn:activemq:jms">
-      <!--the queue used by the example-->
-      <queue name="exampleQueue"/>
-   </jms>
-
-   <core xmlns="urn:activemq:core">
-
-      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
-
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
-
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
-
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
-      </acceptors>
-
-      <!-- Other config -->
-
-      <security-settings>
-         <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
-            <permission type="createDurableQueue" roles="guest"/>
-            <permission type="deleteDurableQueue" roles="guest"/>
-            <permission type="createNonDurableQueue" roles="guest"/>
-            <permission type="deleteNonDurableQueue" roles="guest"/>
-            <permission type="consume" roles="guest"/>
-            <permission type="send" roles="guest"/>
-         </security-setting>
-      </security-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/spring-integration/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/spring-integration/pom.xml b/examples/jms/spring-integration/pom.xml
index 25ae488..fcc6d9f 100644
--- a/examples/jms/spring-integration/pom.xml
+++ b/examples/jms/spring-integration/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.activemq</groupId>
          <artifactId>artemis-spring-integration</artifactId>
          <version>${project.version}</version>
@@ -72,9 +67,6 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.SpringExample</clientClass>
-                           <args>
-                              <param>${basedir}/target/server0</param>
-                           </args>
                         </configuration>
                      </execution>
                   </executions>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/ssl-enabled/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/ssl-enabled/pom.xml b/examples/jms/ssl-enabled/pom.xml
index 47989bf..7c6e4f8 100644
--- a/examples/jms/ssl-enabled/pom.xml
+++ b/examples/jms/ssl-enabled/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>
@@ -61,9 +56,18 @@ under the License.
                         <goals>
                            <goal>create</goal>
                         </goals>
+                     </execution>
+                     <execution>
+                        <id>start</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
                         <configuration>
-                           <instance>${basedir}/target/server0</instance>
-                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                           <spawn>true</spawn>
+                           <testURI>tcp://localhost:5500?sslEnabled=true&amp;trustStorePath=activemq/server0/activemq.example.truststore&amp;trustStorePassword=activemqexample</testURI>
+                           <args>
+                              <param>run</param>
+                           </args>
                         </configuration>
                      </execution>
                      <execution>
@@ -73,8 +77,16 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.SSLExample</clientClass>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>stop</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
                            <args>
-                              <param>${basedir}/target/server0</param>
+                              <param>stop</param>
                            </args>
                         </configuration>
                      </execution>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/ssl-enabled/src/main/java/org/apache/activemq/artemis/jms/example/SSLExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/ssl-enabled/src/main/java/org/apache/activemq/artemis/jms/example/SSLExample.java b/examples/jms/ssl-enabled/src/main/java/org/apache/activemq/artemis/jms/example/SSLExample.java
index 11f5a91..a43e4c0 100644
--- a/examples/jms/ssl-enabled/src/main/java/org/apache/activemq/artemis/jms/example/SSLExample.java
+++ b/examples/jms/ssl-enabled/src/main/java/org/apache/activemq/artemis/jms/example/SSLExample.java
@@ -25,20 +25,12 @@ import javax.jms.Session;
 import javax.jms.TextMessage;
 import javax.naming.InitialContext;
 
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
-
 /**
  * A simple JMS Queue example that uses SSL secure transport.
  */
-public class SSLExample extends ActiveMQExample
+public class SSLExample
 {
-   public static void main(final String[] args)
-   {
-      new SSLExample().run(args);
-   }
-
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(final String[] args) throws Exception
    {
       Connection connection = null;
       InitialContext initialContext = null;
@@ -82,8 +74,6 @@ public class SSLExample extends ActiveMQExample
          System.out.println("Received message: " + messageReceived.getText());
 
          initialContext.close();
-
-         return true;
       }
       finally
       {
@@ -98,5 +88,4 @@ public class SSLExample extends ActiveMQExample
          }
       }
    }
-
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/static-selector-jms/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/static-selector-jms/pom.xml b/examples/jms/static-selector-jms/pom.xml
index 750af00..02b8fb7 100644
--- a/examples/jms/static-selector-jms/pom.xml
+++ b/examples/jms/static-selector-jms/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>
@@ -61,9 +56,18 @@ under the License.
                         <goals>
                            <goal>create</goal>
                         </goals>
+                     </execution>
+                     <execution>
+                        <id>start</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
                         <configuration>
-                           <instance>${basedir}/target/server0</instance>
-                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                           <spawn>true</spawn>
+                           <testURI>tcp://localhost:61616</testURI>
+                           <args>
+                              <param>run</param>
+                           </args>
                         </configuration>
                      </execution>
                      <execution>
@@ -73,8 +77,16 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.StaticSelectorJMSExample</clientClass>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>stop</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
                            <args>
-                              <param>${basedir}/target/server0</param>
+                              <param>stop</param>
                            </args>
                         </configuration>
                      </execution>
@@ -91,6 +103,4 @@ under the License.
          </build>
       </profile>
    </profiles>
-
-
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/static-selector-jms/src/main/java/org/apache/activemq/artemis/jms/example/StaticSelectorJMSExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/static-selector-jms/src/main/java/org/apache/activemq/artemis/jms/example/StaticSelectorJMSExample.java b/examples/jms/static-selector-jms/src/main/java/org/apache/activemq/artemis/jms/example/StaticSelectorJMSExample.java
index 16c22e5..0f06417 100644
--- a/examples/jms/static-selector-jms/src/main/java/org/apache/activemq/artemis/jms/example/StaticSelectorJMSExample.java
+++ b/examples/jms/static-selector-jms/src/main/java/org/apache/activemq/artemis/jms/example/StaticSelectorJMSExample.java
@@ -27,24 +27,16 @@ import javax.jms.Queue;
 import javax.jms.Session;
 import javax.jms.TextMessage;
 import javax.naming.InitialContext;
-
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
+import java.util.concurrent.atomic.AtomicBoolean;
 
 /**
  * A simple JMS example that shows how static message selectors work when using JMS config.
  */
-public class StaticSelectorJMSExample extends ActiveMQExample
+public class StaticSelectorJMSExample
 {
-   private volatile boolean result = true;
-
-   public static void main(final String[] args)
-   {
-      new StaticSelectorJMSExample().run(args);
-   }
-
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(final String[] args) throws Exception
    {
+      AtomicBoolean result = new AtomicBoolean(true);
       Connection connection = null;
       InitialContext initialContext = null;
       try
@@ -73,7 +65,7 @@ public class StaticSelectorJMSExample extends ActiveMQExample
 
          // Step 8. Create a JMS Message Consumer that receives 'red' messages
          MessageConsumer redConsumer = session.createConsumer(queue);
-         redConsumer.setMessageListener(new SimpleMessageListener("red"));
+         redConsumer.setMessageListener(new SimpleMessageListener("red", result));
 
          // Step 9. Create five messages with different 'color' properties
          TextMessage redMessage1 = session.createTextMessage("Red-1");
@@ -101,7 +93,8 @@ public class StaticSelectorJMSExample extends ActiveMQExample
          // Step 11. Waiting for the message listener to check the received messages.
          Thread.sleep(5000);
 
-         return result;
+         if (!result.get())
+            throw new IllegalStateException();
       }
       finally
       {
@@ -116,38 +109,39 @@ public class StaticSelectorJMSExample extends ActiveMQExample
          }
       }
    }
+}
 
-   public class SimpleMessageListener implements MessageListener
-   {
-      private final String name;
+class SimpleMessageListener implements MessageListener
+{
+   private final String name;
+   private AtomicBoolean result;
 
-      public SimpleMessageListener(final String listener)
-      {
-         name = listener;
-      }
+   public SimpleMessageListener(final String listener, AtomicBoolean result)
+   {
+      name = listener;
+      this.result = result;
+   }
 
-      public void onMessage(final Message msg)
+   public void onMessage(final Message msg)
+   {
+      TextMessage textMessage = (TextMessage)msg;
+      try
       {
-         TextMessage textMessage = (TextMessage)msg;
-         try
+         String colorProp = msg.getStringProperty("color");
+         System.out.println("Receiver " + name +
+                                    " receives message [" +
+                                    textMessage.getText() +
+                                    "] with color property: " +
+                                    colorProp);
+         if (colorProp != null && !colorProp.equals(name))
          {
-            String colorProp = msg.getStringProperty("color");
-            System.out.println("Receiver " + name +
-                               " receives message [" +
-                               textMessage.getText() +
-                               "] with color property: " +
-                               colorProp);
-            if (colorProp != null && !colorProp.equals(name))
-            {
-               result = false;
-            }
-         }
-         catch (JMSException e)
-         {
-            e.printStackTrace();
-            result = false;
+            result.set(false);
          }
       }
+      catch (JMSException e)
+      {
+         e.printStackTrace();
+         result.set(false);
+      }
    }
-
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/static-selector-jms/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/static-selector-jms/src/main/resources/activemq/server0/broker.xml b/examples/jms/static-selector-jms/src/main/resources/activemq/server0/broker.xml
index 7442fac..cdeb534 100644
--- a/examples/jms/static-selector-jms/src/main/resources/activemq/server0/broker.xml
+++ b/examples/jms/static-selector-jms/src/main/resources/activemq/server0/broker.xml
@@ -31,13 +31,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
+      <bindings-directory>${data.dir:../data}/bindings</bindings-directory>
 
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
+      <journal-directory>${data.dir:../data}/journal</journal-directory>
 
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
+      <large-messages-directory>${data.dir:../data}/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
+      <paging-directory>${data.dir:../data}/paging</paging-directory>
 
       <!-- Acceptors -->
       <acceptors>


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

Posted by cl...@apache.org.
Continuing work on ARTEMIS-178


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/54d0d2b4
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/54d0d2b4
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/54d0d2b4

Branch: refs/heads/master
Commit: 54d0d2b4efdf2df9b89dbde8e8d8f94938401f5e
Parents: b3af4bb
Author: jbertram <jb...@apache.org>
Authored: Mon Jul 6 14:42:36 2015 -0500
Committer: jbertram <jb...@apache.org>
Committed: Wed Jul 29 16:00:41 2015 -0500

----------------------------------------------------------------------
 .../activemq/artemis/cli/commands/Create.java   |  15 +
 .../artemis/cli/process/ProcessBuilder.java     |  12 +-
 .../activemq/artemis/util/ServerUtil.java       | 207 ++++++++++++++
 .../cli/commands/etc/shared-store-settings.txt  |   4 +-
 .../jms/server/impl/JMSServerManagerImpl.java   |   3 +-
 .../artemis/maven/ActiveMQCreatePlugin.java     |  23 +-
 .../artemis/maven/ArtemisCLIPlugin.java         |  52 ++--
 examples/core/embedded/pom.xml                  |   2 -
 examples/core/perf/pom.xml                      |  27 +-
 .../main/resources/activemq/server0/broker.xml  |  69 +++++
 .../hornetq-configuration-messaging-lab.xml     |  53 ++++
 .../perf/src/main/resources/server0/broker.xml  |  67 -----
 .../hornetq-configuration-messaging-lab.xml     |  53 ----
 examples/core/vertx-connector/pom.xml           | 131 ++++-----
 .../main/resources/activemq/server0/broker.xml  |  81 ++++++
 .../resources/server0/artemis-roles.properties  |  17 --
 .../resources/server0/artemis-users.properties  |  17 --
 .../src/main/resources/server0/broker.xml       |  81 ------
 examples/jms/aerogear/pom.xml                   |  50 +---
 .../main/resources/activemq/server0/broker.xml  |   9 +-
 examples/jms/application-layer-failover/pom.xml |   8 +-
 .../ApplicationLayerFailoverExample.java        |  73 ++---
 examples/jms/bridge/pom.xml                     |  91 +++---
 .../artemis/jms/example/BridgeExample.java      |  35 +--
 examples/jms/browser/pom.xml                    |  28 +-
 .../jms/example/QueueBrowserExample.java        |  15 +-
 examples/jms/client-kickoff/pom.xml             |  28 +-
 .../jms/example/ClientKickoffExample.java       |  23 +-
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 .../jms/client-side-failoverlistener/pom.xml    |  19 +-
 .../ClientSideFailoverListerExample.java        |  54 ++--
 examples/jms/client-side-load-balancing/pom.xml |  96 ++++++-
 .../example/ClientSideLoadBalancingExample.java |  17 +-
 .../jms/clustered-durable-subscription/pom.xml  |  63 ++++-
 .../ClusteredDurableSubscriptionExample.java    |  15 +-
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 .../main/resources/activemq/server1/broker.xml  |   9 +-
 examples/jms/clustered-grouping/pom.xml         |  95 ++++++-
 .../jms/example/ClusteredGroupingExample.java   |  14 +-
 .../main/resources/activemq/server0/broker.xml  |   9 +-
 .../main/resources/activemq/server1/broker.xml  |   9 +-
 .../main/resources/activemq/server2/broker.xml  |   9 +-
 examples/jms/clustered-jgroups/pom.xml          |  62 ++++-
 .../jms/example/ClusteredJgroupsExample.java    |  15 +-
 .../main/resources/activemq/server0/broker.xml  |   9 +-
 .../main/resources/activemq/server1/broker.xml  |   9 +-
 examples/jms/clustered-queue/pom.xml            |  64 ++++-
 .../jms/example/ClusteredQueueExample.java      |  19 +-
 .../activemq/server0/artemis-roles.properties   |  17 --
 .../activemq/server0/artemis-users.properties   |  17 --
 .../main/resources/activemq/server0/broker.xml  |   9 +-
 .../activemq/server1/artemis-roles.properties   |  17 --
 .../activemq/server1/artemis-users.properties   |  17 --
 examples/jms/clustered-standalone/pom.xml       |  95 ++++++-
 .../jms/example/ClusteredStandaloneExample.java |  27 +-
 .../activemq/server0/artemis-roles.properties   |  17 --
 .../activemq/server0/artemis-users.properties   |  17 --
 .../main/resources/activemq/server0/broker.xml  |   9 +-
 .../activemq/server1/artemis-roles.properties   |  17 --
 .../activemq/server1/artemis-users.properties   |  17 --
 .../main/resources/activemq/server1/broker.xml  |   9 +-
 .../activemq/server2/artemis-roles.properties   |  17 --
 .../activemq/server2/artemis-users.properties   |  17 --
 .../main/resources/activemq/server2/broker.xml  |   9 +-
 examples/jms/clustered-static-discovery/pom.xml | 125 ++++++++-
 .../example/StaticClusteredQueueExample.java    |  29 +-
 .../activemq/server0/artemis-roles.properties   |  17 --
 .../activemq/server0/artemis-users.properties   |  17 --
 .../main/resources/activemq/server0/broker.xml  |   9 +-
 .../activemq/server1/artemis-roles.properties   |  17 --
 .../activemq/server1/artemis-users.properties   |  17 --
 .../main/resources/activemq/server1/broker.xml  |   9 +-
 .../activemq/server2/artemis-roles.properties   |  17 --
 .../activemq/server2/artemis-users.properties   |  17 --
 .../main/resources/activemq/server2/broker.xml  |   9 +-
 .../activemq/server3/artemis-roles.properties   |  17 --
 .../activemq/server3/artemis-users.properties   |  17 --
 .../main/resources/activemq/server3/broker.xml  |   9 +-
 examples/jms/clustered-static-oneway/pom.xml    |  93 ++++++-
 .../jms/example/ClusterStaticOnewayExample.java |  32 +--
 .../activemq/server0/artemis-roles.properties   |  17 --
 .../activemq/server0/artemis-users.properties   |  17 --
 .../main/resources/activemq/server0/broker.xml  |   9 +-
 .../activemq/server1/artemis-roles.properties   |  17 --
 .../activemq/server1/artemis-users.properties   |  17 --
 .../main/resources/activemq/server1/broker.xml  |   9 +-
 .../activemq/server2/artemis-roles.properties   |  17 --
 .../activemq/server2/artemis-users.properties   |  17 --
 .../main/resources/activemq/server2/broker.xml  |   9 +-
 examples/jms/clustered-topic/pom.xml            |  63 ++++-
 .../jms/example/ClusteredTopicExample.java      |  19 +-
 .../activemq/server0/artemis-roles.properties   |  17 --
 .../activemq/server0/artemis-users.properties   |  17 --
 .../main/resources/activemq/server0/broker.xml  |   9 +-
 .../activemq/server1/artemis-roles.properties   |  17 --
 .../activemq/server1/artemis-users.properties   |  17 --
 .../main/resources/activemq/server1/broker.xml  |   9 +-
 .../jms/colocated-failover-scale-down/pom.xml   |   8 +-
 .../ColocatedFailoverScaleDownExample.java      |  37 +--
 .../activemq/server0/artemis-roles.properties   |  17 --
 .../activemq/server0/artemis-users.properties   |  17 --
 .../main/resources/activemq/server0/broker.xml  |  13 +-
 .../activemq/server1/artemis-roles.properties   |  17 --
 .../activemq/server1/artemis-users.properties   |  17 --
 .../main/resources/activemq/server1/broker.xml  |   9 +-
 examples/jms/colocated-failover/pom.xml         |   9 +-
 .../jms/example/ColocatedFailoverExample.java   |  44 +--
 .../activemq/server0/artemis-roles.properties   |  17 --
 .../activemq/server0/artemis-users.properties   |  17 --
 .../main/resources/activemq/server0/broker.xml  |  13 +-
 .../activemq/server1/artemis-roles.properties   |  17 --
 .../activemq/server1/artemis-users.properties   |  17 --
 .../main/resources/activemq/server1/broker.xml  |   9 +-
 examples/jms/common/pom.xml                     |  65 -----
 .../artemis/common/example/ActiveMQExample.java | 274 -------------------
 .../artemis/common/example/DummyXid.java        | 208 --------------
 .../artemis/common/example/ExampleUtil.java     | 122 ---------
 examples/jms/consumer-rate-limit/pom.xml        |  28 +-
 examples/jms/consumer-rate-limit/readme.html    |  46 ++--
 .../jms/example/ConsumerRateLimitExample.java   |  18 +-
 .../activemq/server0/artemis-roles.properties   |  17 --
 .../activemq/server0/artemis-users.properties   |  17 --
 .../main/resources/activemq/server0/broker.xml  |  60 ----
 examples/jms/dead-letter/pom.xml                |  28 +-
 .../artemis/jms/example/DeadLetterExample.java  |  19 +-
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 examples/jms/delayed-redelivery/pom.xml         |  28 +-
 .../jms/example/DelayedRedeliveryExample.java   |  27 +-
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 examples/jms/divert/pom.xml                     |  62 ++++-
 .../artemis/jms/example/DivertExample.java      |  27 +-
 .../main/resources/activemq/server0/broker.xml  |  11 +-
 .../main/resources/activemq/server1/broker.xml  |   8 +-
 examples/jms/durable-subscription/pom.xml       |  28 +-
 .../jms/example/DurableSubscriptionExample.java |  14 +-
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 examples/jms/embedded-simple/pom.xml            |   5 -
 .../artemis/jms/example/EmbeddedExample.java    | 105 +++----
 examples/jms/embedded/pom.xml                   |   5 -
 .../artemis/jms/example/EmbeddedExample.java    | 144 +++++-----
 examples/jms/expiry/pom.xml                     |  28 +-
 .../artemis/jms/example/ExpiryExample.java      |  15 +-
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 examples/jms/ha-policy-autobackup/pom.xml       |   4 +-
 .../jms/example/HAPolicyAutoBackupExample.java  |  43 ++-
 .../activemq/server0/artemis-roles.properties   |  17 --
 .../activemq/server0/artemis-users.properties   |  17 --
 .../activemq/server1/artemis-roles.properties   |  17 --
 .../activemq/server1/artemis-users.properties   |  17 --
 examples/jms/http-transport/pom.xml             |  28 +-
 .../jms/example/HttpTransportExample.java       |  15 +-
 .../main/resources/activemq/server0/broker.xml  |  10 +-
 .../jms/instantiate-connection-factory/pom.xml  |  28 +-
 .../InstantiateConnectionFactoryExample.java    |  14 +-
 .../activemq/server0/artemis-roles.properties   |  17 --
 .../activemq/server0/artemis-users.properties   |  17 --
 .../main/resources/activemq/server0/broker.xml  |  60 ----
 examples/jms/interceptor/pom.xml                |  28 +-
 .../artemis/jms/example/InterceptorExample.java |  23 +-
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 examples/jms/jms-auto-closeable/pom.xml         |  28 +-
 .../jms/example/JMSAutoCloseableExample.java    |  21 +-
 .../activemq/server0/artemis-roles.properties   |  17 --
 .../activemq/server0/artemis-users.properties   |  17 --
 .../main/resources/activemq/server0/broker.xml  |  59 ----
 examples/jms/jms-bridge/pom.xml                 |  67 ++++-
 .../artemis/jms/example/JMSBridgeExample.java   |  55 ++--
 .../main/resources/activemq/server0/broker.xml  |  10 +-
 .../main/resources/activemq/server1/broker.xml  |  11 +-
 examples/jms/jms-completion-listener/pom.xml    |  28 +-
 .../example/JMSCompletionListenerExample.java   |  19 +-
 .../activemq/server0/artemis-roles.properties   |  17 --
 .../activemq/server0/artemis-users.properties   |  17 --
 .../main/resources/activemq/server0/broker.xml  |  60 ----
 examples/jms/jms-context/pom.xml                |  28 +-
 .../artemis/jms/example/JMSContextExample.java  |  15 +-
 .../activemq/server0/artemis-roles.properties   |  17 --
 .../activemq/server0/artemis-users.properties   |  17 --
 .../main/resources/activemq/server0/broker.xml  |  60 ----
 examples/jms/jms-shared-consumer/pom.xml        |  28 +-
 .../jms/example/JMSSharedConsumerExample.java   |  12 +-
 .../main/resources/activemq/server0/broker.xml  |  11 +-
 examples/jms/jmx/pom.xml                        |  28 +-
 .../artemis/jms/example/JMXExample.java         |  16 +-
 examples/jms/large-message/pom.xml              |   8 +-
 .../jms/example/LargeMessageExample.java        |  36 +--
 .../activemq/server0/artemis-roles.properties   |  17 --
 .../activemq/server0/artemis-users.properties   |  17 --
 .../main/resources/activemq/server0/broker.xml  |  60 ----
 examples/jms/last-value-queue/pom.xml           |  28 +-
 .../jms/example/LastValueQueueExample.java      |  15 +-
 examples/jms/management-notifications/pom.xml   |  28 +-
 .../example/ManagementNotificationExample.java  |  14 +-
 examples/jms/management/pom.xml                 |  27 +-
 .../artemis/jms/example/ManagementExample.java  |  13 +-
 examples/jms/message-counters/pom.xml           |  30 +-
 .../jms/example/MessageCounterExample.java      |  17 +-
 examples/jms/message-group/pom.xml              |  28 +-
 .../jms/example/MessageGroupExample.java        |  63 ++---
 .../activemq/server0/artemis-roles.properties   |  17 --
 .../activemq/server0/artemis-users.properties   |  17 --
 .../main/resources/activemq/server0/broker.xml  |  60 ----
 examples/jms/message-group2/pom.xml             |  28 +-
 .../jms/example/MessageGroup2Example.java       |  65 ++---
 .../activemq/server0/artemis-roles.properties   |  17 --
 .../activemq/server0/artemis-users.properties   |  17 --
 .../main/resources/activemq/server0/broker.xml  |  60 ----
 examples/jms/message-priority/pom.xml           |  28 +-
 .../jms/example/MessagePriorityExample.java     |  72 +++--
 .../activemq/server0/artemis-roles.properties   |  17 --
 .../activemq/server0/artemis-users.properties   |  17 --
 .../main/resources/activemq/server0/broker.xml  |  60 ----
 examples/jms/multiple-failover-failback/pom.xml |  20 +-
 .../MultipleFailoverFailbackExample.java        |  44 ++-
 .../activemq/server0/artemis-roles.properties   |  17 --
 .../activemq/server0/artemis-users.properties   |  17 --
 .../main/resources/activemq/server0/broker.xml  |  93 -------
 .../activemq/server1/artemis-roles.properties   |  17 --
 .../activemq/server1/artemis-users.properties   |  17 --
 .../main/resources/activemq/server1/broker.xml  |  93 -------
 .../activemq/server2/artemis-roles.properties   |  17 --
 .../activemq/server2/artemis-users.properties   |  17 --
 .../main/resources/activemq/server2/broker.xml  |  94 -------
 examples/jms/multiple-failover/pom.xml          |  20 +-
 .../jms/example/MultipleFailoverExample.java    |  47 ++--
 .../activemq/server0/artemis-roles.properties   |  17 --
 .../activemq/server0/artemis-users.properties   |  17 --
 .../main/resources/activemq/server0/broker.xml  |  95 -------
 .../activemq/server1/artemis-roles.properties   |  17 --
 .../activemq/server1/artemis-users.properties   |  17 --
 .../main/resources/activemq/server1/broker.xml  |  93 -------
 .../activemq/server2/artemis-roles.properties   |  17 --
 .../activemq/server2/artemis-users.properties   |  17 --
 .../main/resources/activemq/server2/broker.xml  |  93 -------
 examples/jms/no-consumer-buffering/pom.xml      |  29 +-
 .../jms/example/NoConsumerBufferingExample.java |  15 +-
 .../activemq/server0/artemis-roles.properties   |  17 --
 .../activemq/server0/artemis-users.properties   |  17 --
 .../main/resources/activemq/server0/broker.xml  |  60 ----
 examples/jms/non-transaction-failover/pom.xml   |  20 +-
 .../example/NonTransactionFailoverExample.java  |  41 ++-
 .../activemq/server0/artemis-roles.properties   |  17 --
 .../activemq/server0/artemis-users.properties   |  17 --
 .../main/resources/activemq/server0/broker.xml  |  93 -------
 .../activemq/server1/artemis-roles.properties   |  17 --
 .../activemq/server1/artemis-users.properties   |  17 --
 .../main/resources/activemq/server1/broker.xml  |  94 -------
 examples/jms/openwire/pom.xml                   |  51 ++--
 .../artemis/jms/example/OpenWireExample.java    |  15 +-
 examples/jms/paging/pom.xml                     |  28 +-
 .../artemis/jms/example/PagingExample.java      |  16 +-
 examples/jms/perf/pom.xml                       |  27 +-
 examples/jms/pom.xml                            |  24 +-
 examples/jms/pre-acknowledge/pom.xml            |  27 +-
 .../jms/example/PreacknowledgeExample.java      |  17 +-
 examples/jms/producer-rate-limit/pom.xml        |  28 +-
 .../jms/example/ProducerRateLimitExample.java   |  15 +-
 .../activemq/server0/artemis-roles.properties   |  17 --
 .../activemq/server0/artemis-users.properties   |  17 --
 .../main/resources/activemq/server0/broker.xml  |  60 ----
 examples/jms/proton-cpp/pom.xml                 |  27 +-
 .../artemis/jms/example/ProtonCPPExample.java   |  13 +-
 .../activemq/server0/artemis-roles.properties   |  17 --
 .../activemq/server0/artemis-users.properties   |  17 --
 .../main/resources/activemq/server0/broker.xml  |  61 -----
 examples/jms/proton-j/pom.xml                   |  28 +-
 .../artemis/jms/example/ProtonJExample.java     |  12 +-
 examples/jms/proton-ruby/pom.xml                |   8 -
 .../jms/queue-message-redistribution/pom.xml    |  63 ++++-
 .../QueueMessageRedistributionExample.java      |  19 +-
 .../main/resources/activemq/server0/broker.xml  |   9 +-
 .../main/resources/activemq/server1/broker.xml  |   9 +-
 examples/jms/queue-requestor/pom.xml            |  28 +-
 .../jms/example/QueueRequestorExample.java      |  14 +-
 examples/jms/queue-selector/pom.xml             |  28 +-
 .../jms/example/QueueSelectorExample.java       |  99 ++++---
 .../activemq/server0/artemis-roles.properties   |  17 --
 .../activemq/server0/artemis-users.properties   |  17 --
 .../main/resources/activemq/server0/broker.xml  |  59 ----
 examples/jms/queue/pom.xml                      |  28 +-
 .../artemis/jms/example/QueueExample.java       |  14 +-
 examples/jms/reattach-node/pom.xml              |  27 +-
 .../artemis/jms/example/ReattachExample.java    |  19 +-
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 examples/jms/replicated-failback-static/pom.xml |   9 +-
 .../ReplicatedFailbackStaticExample.java        |  34 ++-
 .../activemq/server0/artemis-roles.properties   |  17 --
 .../activemq/server0/artemis-users.properties   |  17 --
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 .../activemq/server1/artemis-roles.properties   |  17 --
 .../activemq/server1/artemis-users.properties   |  17 --
 .../main/resources/activemq/server1/broker.xml  |   8 +-
 examples/jms/replicated-failback/pom.xml        |   9 +-
 .../jms/example/ReplicatedFailbackExample.java  |  38 +--
 .../activemq/server0/artemis-roles.properties   |  17 --
 .../activemq/server0/artemis-users.properties   |  17 --
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 .../activemq/server1/artemis-roles.properties   |  17 --
 .../activemq/server1/artemis-users.properties   |  17 --
 .../main/resources/activemq/server1/broker.xml  |   8 +-
 .../jms/replicated-multiple-failover/pom.xml    |  20 +-
 .../ReplicatedMultipleFailoverExample.java      |  38 +--
 .../activemq/server0/artemis-roles.properties   |  17 --
 .../activemq/server0/artemis-users.properties   |  17 --
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 .../activemq/server1/artemis-roles.properties   |  17 --
 .../activemq/server1/artemis-users.properties   |  17 --
 .../main/resources/activemq/server1/broker.xml  |   8 +-
 .../activemq/server2/artemis-roles.properties   |  17 --
 .../activemq/server2/artemis-users.properties   |  17 --
 .../main/resources/activemq/server2/broker.xml  |   9 +-
 .../jms/replicated-transaction-failover/pom.xml |   9 +-
 .../ReplicatedTransactionFailoverExample.java   |  40 ++-
 .../activemq/server0/artemis-roles.properties   |  17 --
 .../activemq/server0/artemis-users.properties   |  17 --
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 .../activemq/server1/artemis-roles.properties   |  17 --
 .../activemq/server1/artemis-users.properties   |  17 --
 .../main/resources/activemq/server1/broker.xml  |   8 +-
 examples/jms/request-reply/pom.xml              |  29 +-
 .../jms/example/RequestReplyExample.java        | 114 ++++----
 examples/jms/scale-down/pom.xml                 |   8 +-
 .../artemis/jms/example/ScaleDownExample.java   |  37 ++-
 .../activemq/server0/artemis-roles.properties   |  17 --
 .../activemq/server0/artemis-users.properties   |  17 --
 .../main/resources/activemq/server0/broker.xml  |   9 +-
 .../activemq/server1/artemis-roles.properties   |  17 --
 .../activemq/server1/artemis-users.properties   |  17 --
 .../main/resources/activemq/server1/broker.xml  |   9 +-
 examples/jms/scheduled-message/pom.xml          |  27 +-
 .../jms/example/ScheduledMessageExample.java    |  14 +-
 .../activemq/server0/artemis-roles.properties   |  17 --
 .../activemq/server0/artemis-users.properties   |  17 --
 .../main/resources/activemq/server0/broker.xml  |  60 ----
 examples/jms/security/pom.xml                   |  30 +-
 .../artemis/jms/example/SecurityExample.java    |  48 ++--
 examples/jms/send-acknowledgements/pom.xml      |  27 +-
 .../example/SendAcknowledgementsExample.java    |  14 +-
 .../activemq/server0/artemis-roles.properties   |  17 --
 .../activemq/server0/artemis-users.properties   |  17 --
 .../main/resources/activemq/server0/broker.xml  |  60 ----
 examples/jms/spring-integration/pom.xml         |   8 -
 examples/jms/ssl-enabled/pom.xml                |  28 +-
 .../artemis/jms/example/SSLExample.java         |  15 +-
 examples/jms/static-selector-jms/pom.xml        |  30 +-
 .../jms/example/StaticSelectorJMSExample.java   |  74 +++--
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 examples/jms/static-selector/pom.xml            |  28 +-
 .../jms/example/StaticSelectorExample.java      |  75 +++--
 examples/jms/stomp-websockets/pom.xml           |  28 +-
 .../jms/example/StompWebSocketExample.java      |  14 +-
 .../activemq/server0/artemis-roles.properties   |  17 --
 .../activemq/server0/artemis-users.properties   |  17 --
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 examples/jms/stomp/pom.xml                      |  28 +-
 .../artemis/jms/example/StompExample.java       |  37 +--
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 examples/jms/stomp1.1/pom.xml                   |  28 +-
 .../artemis/jms/example/StompExample.java       |  40 +--
 .../activemq/server0/artemis-roles.properties   |  17 --
 .../activemq/server0/artemis-users.properties   |  17 --
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 examples/jms/stomp1.2/pom.xml                   |  28 +-
 .../artemis/jms/example/StompExample.java       |  42 +--
 .../activemq/server0/artemis-roles.properties   |  17 --
 .../activemq/server0/artemis-users.properties   |  17 --
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 examples/jms/stop-server-failover/pom.xml       |  75 ++++-
 .../jms/example/StopServerFailoverExample.java  |  20 +-
 .../activemq/server0/artemis-roles.properties   |  17 --
 .../activemq/server0/artemis-users.properties   |  17 --
 .../main/resources/activemq/server0/broker.xml  |  94 -------
 .../activemq/server1/artemis-roles.properties   |  17 --
 .../activemq/server1/artemis-users.properties   |  17 --
 .../main/resources/activemq/server1/broker.xml  |  94 -------
 examples/jms/symmetric-cluster/pom.xml          | 173 +++++++++++-
 .../jms/example/SymmetricClusterExample.java    |  27 +-
 .../activemq/server0/artemis-roles.properties   |  17 --
 .../activemq/server0/artemis-users.properties   |  17 --
 .../main/resources/activemq/server0/broker.xml  |   9 +-
 .../activemq/server1/artemis-roles.properties   |  17 --
 .../activemq/server1/artemis-users.properties   |  17 --
 .../main/resources/activemq/server1/broker.xml  |   9 +-
 .../activemq/server2/artemis-roles.properties   |  17 --
 .../activemq/server2/artemis-users.properties   |  17 --
 .../main/resources/activemq/server2/broker.xml  |   9 +-
 .../activemq/server3/artemis-roles.properties   |  17 --
 .../activemq/server3/artemis-users.properties   |  17 --
 .../main/resources/activemq/server3/broker.xml  |   9 +-
 .../activemq/server4/artemis-roles.properties   |  17 --
 .../activemq/server4/artemis-users.properties   |  17 --
 .../main/resources/activemq/server4/broker.xml  |   9 +-
 .../activemq/server5/artemis-roles.properties   |  17 --
 .../activemq/server5/artemis-users.properties   |  17 --
 .../main/resources/activemq/server5/broker.xml  |  13 +-
 examples/jms/temp-queue/pom.xml                 |  28 +-
 .../jms/example/TemporaryQueueExample.java      |  14 +-
 .../activemq/server0/artemis-roles.properties   |  17 --
 .../activemq/server0/artemis-users.properties   |  17 --
 .../main/resources/activemq/server0/broker.xml  |  17 +-
 examples/jms/topic-hierarchies/pom.xml          |  27 +-
 .../jms/example/TopicHierarchyExample.java      |  16 +-
 .../activemq/server0/artemis-roles.properties   |  17 --
 .../activemq/server0/artemis-users.properties   |  17 --
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 examples/jms/topic-selector-example1/pom.xml    |  28 +-
 .../jms/example/TopicSelectorExample1.java      |  31 +--
 .../activemq/server0/artemis-roles.properties   |  17 --
 .../activemq/server0/artemis-users.properties   |  17 --
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 examples/jms/topic-selector-example2/pom.xml    |  28 +-
 .../jms/example/TopicSelectorExample2.java      | 100 ++++---
 .../activemq/server0/artemis-roles.properties   |  17 --
 .../activemq/server0/artemis-users.properties   |  17 --
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 examples/jms/topic/pom.xml                      |  29 +-
 .../artemis/jms/example/TopicExample.java       |  14 +-
 .../activemq/server0/artemis-roles.properties   |  17 --
 .../activemq/server0/artemis-users.properties   |  17 --
 .../main/resources/activemq/server0/broker.xml  |   9 +-
 examples/jms/transaction-failover/pom.xml       |   8 +-
 .../jms/example/TransactionFailoverExample.java |  40 ++-
 .../activemq/server0/artemis-roles.properties   |  17 --
 .../activemq/server0/artemis-users.properties   |  17 --
 .../main/resources/activemq/server0/broker.xml  |  12 +-
 .../activemq/server1/artemis-roles.properties   |  17 --
 .../activemq/server1/artemis-users.properties   |  17 --
 .../main/resources/activemq/server1/broker.xml  |  12 +-
 examples/jms/transactional/pom.xml              |  28 +-
 .../jms/example/TransactionalExample.java       |  17 +-
 .../activemq/server0/artemis-roles.properties   |  17 --
 .../activemq/server0/artemis-users.properties   |  17 --
 .../main/resources/activemq/server0/broker.xml  |  60 ----
 examples/jms/xa-heuristic/pom.xml               |  34 ++-
 .../activemq/artemis/jms/example/DummyXid.java  | 208 ++++++++++++++
 .../artemis/jms/example/XAHeuristicExample.java |  84 +++---
 .../activemq/server0/artemis-roles.properties   |  17 --
 .../activemq/server0/artemis-users.properties   |  17 --
 .../main/resources/activemq/server0/broker.xml  |  60 ----
 examples/jms/xa-receive/pom.xml                 |  29 +-
 .../activemq/artemis/jms/example/DummyXid.java  | 208 ++++++++++++++
 .../artemis/jms/example/XAReceiveExample.java   |  29 +-
 .../activemq/server0/artemis-roles.properties   |  17 --
 .../activemq/server0/artemis-users.properties   |  17 --
 .../main/resources/activemq/server0/broker.xml  |  60 ----
 examples/jms/xa-send/pom.xml                    |  65 ++---
 .../activemq/artemis/jms/example/DummyXid.java  | 208 ++++++++++++++
 .../artemis/jms/example/XASendExample.java      |  85 +++---
 .../activemq/server0/artemis-roles.properties   |  17 --
 .../activemq/server0/artemis-users.properties   |  17 --
 .../main/resources/activemq/server0/broker.xml  |  60 ----
 451 files changed, 4938 insertions(+), 8666 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java
----------------------------------------------------------------------
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 580b411..7495ce2 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
@@ -121,6 +121,9 @@ public class Create extends InputAbstract
    @Option(name = "--slave", description = "Valid for shared store or replication: this is a slave server?")
    boolean slave;
 
+   @Option(name = "--failover-on-shutdown", description = "Valid for shared store: will shutdown trigger a failover? (Default: false)")
+   boolean failoverOnShutodwn;
+
    @Option(name = "--cluster-user", description = "The cluster user to use for clustering. (Default: input)")
    String clusterUser = null;
 
@@ -424,6 +427,16 @@ public class Create extends InputAbstract
       this.slave = slave;
    }
 
+   public boolean isFailoverOnShutodwn()
+   {
+      return failoverOnShutodwn;
+   }
+
+   public void setFailoverOnShutodwn(boolean failoverOnShutodwn)
+   {
+      this.failoverOnShutodwn = failoverOnShutodwn;
+   }
+
    public Boolean getAllowAnonymous()
    {
       return allowAnonymous;
@@ -494,6 +507,8 @@ public class Create extends InputAbstract
 
       filters.put("${master-slave}", isSlave() ? "slave" : "master");
 
+      filters.put("${failover-on-shutdown}", isFailoverOnShutodwn() ? "true" : "false");
+
       if (replicated)
       {
          clustered = true;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/process/ProcessBuilder.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/process/ProcessBuilder.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/process/ProcessBuilder.java
index 05d09d5..eaf4865 100644
--- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/process/ProcessBuilder.java
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/process/ProcessBuilder.java
@@ -36,7 +36,7 @@ public class ProcessBuilder
          {
             for (Process p : processes)
             {
-               if (p.isAlive())
+//               if (p.isAlive())
                {
                   p.destroy();
                }
@@ -53,7 +53,7 @@ public class ProcessBuilder
    {
       for (Process p: processes)
       {
-         if (!p.isAlive())
+//         if (!p.isAlive())
          {
             processes.remove(p);
          }
@@ -93,14 +93,14 @@ public class ProcessBuilder
 
       ProcessLogger outputLogger = new ProcessLogger(true,
                                                      process.getInputStream(),
-                                                     logname + "::Out",
+                                                     logname,
                                                      false);
       outputLogger.start();
 
       // Adding a reader to System.err, so the VM won't hang on a System.err.println as identified on this forum thread:
       ProcessLogger errorLogger = new ProcessLogger(true,
                                                     process.getErrorStream(),
-                                                    logname + "::Err",
+                                                    logname,
                                                     true);
       errorLogger.start();
 
@@ -172,11 +172,11 @@ public class ProcessBuilder
                {
                   if (sendToErr)
                   {
-                     System.err.println(logName + " err:" + line);
+                     System.err.println(logName + "-err:" + line);
                   }
                   else
                   {
-                     System.out.println(logName + " out:" + line);
+                     System.out.println(logName + "-out:" + line);
                   }
                }
             }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/artemis-cli/src/main/java/org/apache/activemq/artemis/util/ServerUtil.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/util/ServerUtil.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/util/ServerUtil.java
new file mode 100644
index 0000000..9b384cd
--- /dev/null
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/util/ServerUtil.java
@@ -0,0 +1,207 @@
+/**
+ * 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.
+ */
+
+package org.apache.activemq.artemis.util;
+
+import org.apache.activemq.artemis.api.core.TransportConfiguration;
+import org.apache.activemq.artemis.api.core.client.ClientSession;
+import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
+import org.apache.activemq.artemis.api.jms.JMSFactoryType;
+import org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnectorFactory;
+import org.apache.activemq.artemis.jms.client.ActiveMQConnection;
+import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
+
+import javax.jms.Connection;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.HashMap;
+
+public class ServerUtil
+{
+   public static Process startServer(String artemisInstance, String serverName) throws Exception
+   {
+      return startServer(artemisInstance, serverName, 0, 0);
+   }
+
+   public static Process startServer(String artemisInstance, String serverName, int id, int timeout) throws Exception
+   {
+      boolean IS_WINDOWS = System.getProperty("os.name").toLowerCase().trim().startsWith("win");
+
+      ProcessBuilder builder = null;
+      if (IS_WINDOWS)
+      {
+         builder = new ProcessBuilder("cmd", "/c", "artemis.cmd", "run");
+      }
+      else
+      {
+         builder = new ProcessBuilder("./artemis", "run");
+      }
+
+      builder.directory(new File(artemisInstance + "/bin"));
+
+      final Process process = builder.start();
+      Runtime.getRuntime().addShutdownHook(new Thread()
+      {
+         public void run()
+         {
+            process.destroy();
+         }
+      });
+
+      ProcessLogger outputLogger = new ProcessLogger(true,
+                                                     process.getInputStream(),
+                                                     serverName,
+                                                     false);
+      outputLogger.start();
+
+      // Adding a reader to System.err, so the VM won't hang on a System.err.println as identified on this forum thread:
+      // http://www.jboss.org/index.html?module=bb&op=viewtopic&t=151815
+      ProcessLogger errorLogger = new ProcessLogger(true,
+                                                    process.getErrorStream(),
+                                                    serverName,
+                                                    true);
+      errorLogger.start();
+
+      // wait for start
+      if (timeout != 0)
+      {
+         waitForServerToStart(id, timeout);
+      }
+
+      return process;
+   }
+
+   public static void waitForServerToStart(int id, int timeout) throws InterruptedException
+   {
+      long realTimeout = System.currentTimeMillis() + timeout;
+      while (System.currentTimeMillis() < realTimeout)
+      {
+         try
+         {
+            HashMap<String, Object> params = new HashMap<String, Object>();
+            params.put("host", "localhost");
+            params.put("port", 61616 + id);
+            TransportConfiguration transportConfiguration = new TransportConfiguration(NettyConnectorFactory.class.getName(), params);
+            ActiveMQConnectionFactory cf = ActiveMQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, transportConfiguration);
+            cf.createConnection().close();
+            System.out.println("server " + id + " started");
+         }
+         catch (Exception e)
+         {
+            System.out.println("awaiting server " + id + " start at " + (61616 + id));
+            Thread.sleep(500);
+            continue;
+         }
+         break;
+      }
+   }
+
+   public static void killServer(final Process server) throws Exception
+   {
+      if (server != null)
+      {
+         System.out.println("**********************************");
+         System.out.println("Killing server " + server);
+         System.out.println("**********************************");
+         server.destroy();
+         server.waitFor();
+         Thread.sleep(1000);
+      }
+   }
+
+   public static int getServer(Connection connection)
+   {
+      ClientSession session = ((ActiveMQConnection) connection).getInitialSession();
+      TransportConfiguration transportConfiguration = session.getSessionFactory().getConnectorConfiguration();
+      String port = (String) transportConfiguration.getParams().get("port");
+      return Integer.valueOf(port) - 61616;
+   }
+
+   public static  Connection getServerConnection(int server, Connection... connections)
+   {
+      for (Connection connection : connections)
+      {
+         ClientSession session = ((ActiveMQConnection) connection).getInitialSession();
+         TransportConfiguration transportConfiguration = session.getSessionFactory().getConnectorConfiguration();
+         String port = (String) transportConfiguration.getParams().get("port");
+         if (Integer.valueOf(port) == server + 61616)
+         {
+            return connection;
+         }
+      }
+      return null;
+   }
+
+
+   /**
+    * Redirect the input stream to a logger (as debug logs)
+    */
+   static class ProcessLogger extends Thread
+   {
+      private final InputStream is;
+
+      private final String logName;
+
+      private final boolean print;
+
+      private final boolean sendToErr;
+
+      ProcessLogger(final boolean print,
+                    final InputStream is,
+                    final String logName,
+                    final boolean sendToErr) throws ClassNotFoundException
+      {
+         this.is = is;
+         this.print = print;
+         this.logName = logName;
+         this.sendToErr = sendToErr;
+         setDaemon(false);
+      }
+
+      @Override
+      public void run()
+      {
+         try
+         {
+            InputStreamReader isr = new InputStreamReader(is);
+            BufferedReader br = new BufferedReader(isr);
+            String line;
+            while ((line = br.readLine()) != null)
+            {
+               if (print)
+               {
+                  if (sendToErr)
+                  {
+                     System.err.println(logName + "-err:" + line);
+                  }
+                  else
+                  {
+                     System.out.println(logName + "-out:" + line);
+                  }
+               }
+            }
+         }
+         catch (IOException e)
+         {
+            // ok, stream closed
+         }
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/shared-store-settings.txt
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/shared-store-settings.txt b/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/shared-store-settings.txt
index 750dbc1..120df7f 100644
--- a/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/shared-store-settings.txt
+++ b/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/shared-store-settings.txt
@@ -1,6 +1,8 @@
 
       <ha-policy>
          <shared-store>
-            <${master-slave}/>
+            <${master-slave}>
+               <failover-on-shutdown>${failover-on-shutdown}</failover-on-shutdown>
+            </${master-slave}>
          </shared-store>
       </ha-policy>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/impl/JMSServerManagerImpl.java
----------------------------------------------------------------------
diff --git a/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/impl/JMSServerManagerImpl.java b/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/impl/JMSServerManagerImpl.java
index 6a4856b..6c257c8 100644
--- a/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/impl/JMSServerManagerImpl.java
+++ b/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/impl/JMSServerManagerImpl.java
@@ -1850,7 +1850,8 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
       else
       {
          ActiveMQJMSServerLogger.LOGGER.serverCachingCommand(runnable);
-         cachedCommands.add(runnable);
+         if (!cachedCommands.contains(runnable))
+            cachedCommands.add(runnable);
          return false;
       }
    }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/ActiveMQCreatePlugin.java
----------------------------------------------------------------------
diff --git a/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/ActiveMQCreatePlugin.java b/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/ActiveMQCreatePlugin.java
index 5fca4a3..78154b6 100644
--- a/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/ActiveMQCreatePlugin.java
+++ b/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/ActiveMQCreatePlugin.java
@@ -104,9 +104,15 @@ public class ActiveMQCreatePlugin extends AbstractMojo
    @Parameter(defaultValue = "false")
    private boolean slave;
 
-   @Parameter(defaultValue = "../data")
+   @Parameter(defaultValue = "./data")
    String dataFolder;
 
+   @Parameter(defaultValue = "false")
+   private boolean failoverOnShutdown;
+
+   @Parameter(defaultValue = "ON_DEMAND")
+   private String messageLoadBalancing;
+
    @Component
    private RepositorySystem repositorySystem;
 
@@ -162,6 +168,10 @@ public class ActiveMQCreatePlugin extends AbstractMojo
 
    public void execute() throws MojoExecutionException, MojoFailureException
    {
+      if (System.getProperty("bypassAddress") != null)
+      {
+         System.out.println("BYPASSADDRESS");
+      }
       getLog().info("Local " + localRepository);
       MavenProject project = (MavenProject) getPluginContext().get("project");
 
@@ -224,19 +234,20 @@ public class ActiveMQCreatePlugin extends AbstractMojo
          add(listCommands, "--replicated");
       }
 
-      if (replicated)
+      if (sharedStore)
       {
          add(listCommands, "--shared-store");
       }
 
-      if (replicated)
+      if (clustered)
       {
-         add(listCommands, "--shared-store");
+         add(listCommands, "--clustered");
+         add(listCommands, "--message-load-balancing", messageLoadBalancing);
       }
 
-      if (clustered)
+      if (failoverOnShutdown)
       {
-         add(listCommands, "--clustered");
+         add(listCommands, "--failover-on-shutdown");
       }
 
       add(listCommands, "--verbose");

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/ArtemisCLIPlugin.java
----------------------------------------------------------------------
diff --git a/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/ArtemisCLIPlugin.java b/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/ArtemisCLIPlugin.java
index 79aad50..1fd4614 100644
--- a/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/ArtemisCLIPlugin.java
+++ b/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/ArtemisCLIPlugin.java
@@ -16,12 +16,6 @@
  */
 package org.apache.activemq.artemis.maven;
 
-import java.io.File;
-import java.nio.file.Files;
-import java.nio.file.LinkOption;
-import java.nio.file.Path;
-import java.util.Map;
-
 import org.apache.activemq.artemis.cli.Artemis;
 import org.apache.activemq.artemis.cli.commands.Run;
 import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
@@ -34,19 +28,19 @@ import org.apache.maven.plugins.annotations.Mojo;
 import org.apache.maven.plugins.annotations.Parameter;
 import org.apache.maven.project.MavenProject;
 
+import java.io.File;
+import java.nio.file.Files;
+import java.nio.file.LinkOption;
+import java.nio.file.Path;
+
 @Mojo(name = "cli", defaultPhase = LifecyclePhase.VERIFY)
 public class ArtemisCLIPlugin extends AbstractMojo
-
 {
+   private PluginDescriptor descriptor;
 
-   @Parameter
+   @Parameter(defaultValue = "server")
    String name;
 
-   /**
-    * The plugin descriptor
-    */
-   private PluginDescriptor descriptor;
-
    @Parameter(defaultValue = "${activemq.basedir}", required = true)
    private File home;
 
@@ -62,8 +56,17 @@ public class ArtemisCLIPlugin extends AbstractMojo
    @Parameter
    private boolean spawn = false;
 
+   @Parameter(defaultValue = "10000")
+   private long spawnTimeout;
+
    @Parameter
-   private boolean testServer;
+   private String testURI = null;
+
+   @Parameter
+   private String testUser = null;
+
+   @Parameter
+   private String testPassword = null;
 
 
    /**
@@ -120,13 +123,11 @@ public class ArtemisCLIPlugin extends AbstractMojo
          }
       }
 
-      Map properties = getPluginContext();
-
       try
       {
          if (spawn)
          {
-            final Process process = org.apache.activemq.artemis.cli.process.ProcessBuilder.build("server", location, true, args);
+            final Process process = org.apache.activemq.artemis.cli.process.ProcessBuilder.build(name, location, true, args);
             Runtime.getRuntime().addShutdownHook(new Thread()
             {
                public void run()
@@ -135,14 +136,21 @@ public class ArtemisCLIPlugin extends AbstractMojo
                }
             });
 
-            if (testServer)
+            if (testURI != null)
             {
-               for (int tryNr = 0; tryNr < 20; tryNr++)
+               long timeout = System.currentTimeMillis() + spawnTimeout;
+               while (System.currentTimeMillis() <= timeout)
                {
-                  try
+                  try (ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory(testURI))
                   {
-                     ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory();
-                     cf.createConnection().close();
+                     if (testUser != null && testPassword != null)
+                     {
+                        cf.createConnection(testUser, testPassword).close();
+                     }
+                     else
+                     {
+                        cf.createConnection().close();
+                     }
                      getLog().info("Server started");
                   }
                   catch (Exception e)

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/core/embedded/pom.xml
----------------------------------------------------------------------
diff --git a/examples/core/embedded/pom.xml b/examples/core/embedded/pom.xml
index 1390c6a..8453105 100644
--- a/examples/core/embedded/pom.xml
+++ b/examples/core/embedded/pom.xml
@@ -86,6 +86,4 @@ under the License.
          </build>
       </profile>
    </profiles>
-
-
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/core/perf/pom.xml
----------------------------------------------------------------------
diff --git a/examples/core/perf/pom.xml b/examples/core/perf/pom.xml
index 5600953..0681d2a 100644
--- a/examples/core/perf/pom.xml
+++ b/examples/core/perf/pom.xml
@@ -52,11 +52,6 @@ under the License.
          <version>${netty.version}</version>
       </dependency>
       <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>
@@ -64,7 +59,7 @@ under the License.
 
    <profiles>
       <profile>
-         <id>default</id>
+         <id>server</id>
          <build>
             <plugins>
                <plugin>
@@ -72,26 +67,16 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start</id>
+                        <id>create0</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <waitOnStart>true</waitOnStart>
-                           <configurationDir>${basedir}/target/classes/server0</configurationDir>
-                           <systemProperties>
-                              <property>
-                                 <name>build.directory</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
                         </configuration>
                      </execution>
                   </executions>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <configurationDir>${basedir}/target/classes/server0</configurationDir>
-                  </configuration>
                   <dependencies>
                      <dependency>
                         <groupId>org.apache.activemq.examples.core</groupId>
@@ -175,6 +160,4 @@ under the License.
          </build>
       </profile>
    </profiles>
-
-
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/core/perf/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/core/perf/src/main/resources/activemq/server0/broker.xml b/examples/core/perf/src/main/resources/activemq/server0/broker.xml
new file mode 100644
index 0000000..8876d42
--- /dev/null
+++ b/examples/core/perf/src/main/resources/activemq/server0/broker.xml
@@ -0,0 +1,69 @@
+<?xml version='1.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.
+-->
+
+<configuration xmlns="urn:activemq"
+            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="urn:activemq /schema/artemis-server.xsd">
+   <core xmlns="urn:activemq:core">
+
+      <bindings-directory>${data.dir:./data}/bindings</bindings-directory>
+
+      <journal-directory>${data.dir:./data}/journal</journal-directory>
+
+      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
+
+      <paging-directory>${data.dir:./data}/paging</paging-directory>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61616?tcpNoDelay=false;tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576</acceptor>
+      </acceptors>
+
+      <security-enabled>false</security-enabled>
+
+      <persistence-enabled>true</persistence-enabled>
+
+      <journal-sync-non-transactional>true</journal-sync-non-transactional>
+      <journal-sync-transactional>true</journal-sync-transactional>
+      <journal-type>ASYNCIO</journal-type>
+      <journal-min-files>20</journal-min-files>
+      <journal-buffer-timeout>20000</journal-buffer-timeout>
+      <log-journal-write-rate>false</log-journal-write-rate>
+      <run-sync-speed-test>false</run-sync-speed-test>
+
+      <!-- <perf-blast-pages>5000</perf-blast-pages> -->
+
+      <queues>
+         <queue name="perfQueue">
+            <address>perfAddress</address>
+         </queue>
+      </queues>
+
+   <!--
+      <address-settings>
+         <address-setting match="perfAddress">
+            <max-size-bytes>10485760</max-size-bytes>
+            <address-full-policy>BLOCK</address-full-policy>
+         </address-setting>
+      </address-settings>
+   -->
+   </core>
+
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/core/perf/src/main/resources/activemq/server0/hornetq-configuration-messaging-lab.xml
----------------------------------------------------------------------
diff --git a/examples/core/perf/src/main/resources/activemq/server0/hornetq-configuration-messaging-lab.xml b/examples/core/perf/src/main/resources/activemq/server0/hornetq-configuration-messaging-lab.xml
new file mode 100644
index 0000000..74b120e
--- /dev/null
+++ b/examples/core/perf/src/main/resources/activemq/server0/hornetq-configuration-messaging-lab.xml
@@ -0,0 +1,53 @@
+<?xml version='1.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.
+-->
+
+<configuration xmlns="urn:activemq"
+            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="urn:activemq /schema/artemis-server.xsd">
+   <core xmlns="urn:activemq:core">
+      <bindings-directory>${build.directory}/server0/data/messaging/bindings</bindings-directory>
+
+      <journal-directory>${build.directory}/server0/data/messaging/journal</journal-directory>
+
+      <large-messages-directory>${build.directory}/server0/data/messaging/largemessages</large-messages-directory>
+
+      <paging-directory>${build.directory}/server0/data/messaging/paging</paging-directory>
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://172.16.8.10:61616?tcpNoDelay=false;tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576</acceptor>
+      </acceptors>
+
+      <security-enabled>false</security-enabled>
+
+      <persistence-enabled>true</persistence-enabled>
+
+      <large-messages-directory>/activemq-data/large-messages</large-messages-directory>
+      <bindings-directory>/activemq-data/bindings</bindings-directory>
+      <journal-directory>/activemq-data/journal</journal-directory>
+      <paging-directory>/activemq-data/paging</paging-directory>
+
+      <queues>
+         <queue name="perfQueue">
+            <address>perfAddress</address>
+         </queue>
+      </queues>
+   </core>
+
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/core/perf/src/main/resources/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/core/perf/src/main/resources/server0/broker.xml b/examples/core/perf/src/main/resources/server0/broker.xml
deleted file mode 100644
index 6896640..0000000
--- a/examples/core/perf/src/main/resources/server0/broker.xml
+++ /dev/null
@@ -1,67 +0,0 @@
-<?xml version='1.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.
--->
-
-<configuration xmlns="urn:activemq"
-            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-            xsi:schemaLocation="urn:activemq /schema/artemis-server.xsd">
-   <core xmlns="urn:activemq:core">
-      <bindings-directory>target/server0/data/messaging/bindings</bindings-directory>
-
-      <journal-directory>target/server0/data/messaging/journal</journal-directory>
-
-      <large-messages-directory>target/server0/data/messaging/largemessages</large-messages-directory>
-
-      <paging-directory>target/server0/data/messaging/paging</paging-directory>
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61616?tcpNoDelay=false;tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576</acceptor>
-      </acceptors>
-
-      <security-enabled>false</security-enabled>
-
-      <persistence-enabled>true</persistence-enabled>
-
-      <journal-sync-non-transactional>true</journal-sync-non-transactional>
-      <journal-sync-transactional>true</journal-sync-transactional>
-      <journal-type>ASYNCIO</journal-type>
-      <journal-min-files>20</journal-min-files>
-      <journal-buffer-timeout>20000</journal-buffer-timeout>
-      <log-journal-write-rate>false</log-journal-write-rate>
-      <run-sync-speed-test>false</run-sync-speed-test>
-
-      <!-- <perf-blast-pages>5000</perf-blast-pages> -->
-
-      <queues>
-         <queue name="perfQueue">
-            <address>perfAddress</address>
-         </queue>
-      </queues>
-
-   <!--
-      <address-settings>
-         <address-setting match="perfAddress">
-            <max-size-bytes>10485760</max-size-bytes>
-            <address-full-policy>BLOCK</address-full-policy>
-         </address-setting>
-      </address-settings>
-   -->
-   </core>
-
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/core/perf/src/main/resources/server0/hornetq-configuration-messaging-lab.xml
----------------------------------------------------------------------
diff --git a/examples/core/perf/src/main/resources/server0/hornetq-configuration-messaging-lab.xml b/examples/core/perf/src/main/resources/server0/hornetq-configuration-messaging-lab.xml
deleted file mode 100644
index 74b120e..0000000
--- a/examples/core/perf/src/main/resources/server0/hornetq-configuration-messaging-lab.xml
+++ /dev/null
@@ -1,53 +0,0 @@
-<?xml version='1.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.
--->
-
-<configuration xmlns="urn:activemq"
-            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-            xsi:schemaLocation="urn:activemq /schema/artemis-server.xsd">
-   <core xmlns="urn:activemq:core">
-      <bindings-directory>${build.directory}/server0/data/messaging/bindings</bindings-directory>
-
-      <journal-directory>${build.directory}/server0/data/messaging/journal</journal-directory>
-
-      <large-messages-directory>${build.directory}/server0/data/messaging/largemessages</large-messages-directory>
-
-      <paging-directory>${build.directory}/server0/data/messaging/paging</paging-directory>
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://172.16.8.10:61616?tcpNoDelay=false;tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576</acceptor>
-      </acceptors>
-
-      <security-enabled>false</security-enabled>
-
-      <persistence-enabled>true</persistence-enabled>
-
-      <large-messages-directory>/activemq-data/large-messages</large-messages-directory>
-      <bindings-directory>/activemq-data/bindings</bindings-directory>
-      <journal-directory>/activemq-data/journal</journal-directory>
-      <paging-directory>/activemq-data/paging</paging-directory>
-
-      <queues>
-         <queue name="perfQueue">
-            <address>perfAddress</address>
-         </queue>
-      </queues>
-   </core>
-
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/core/vertx-connector/pom.xml
----------------------------------------------------------------------
diff --git a/examples/core/vertx-connector/pom.xml b/examples/core/vertx-connector/pom.xml
index 4a2e1fa..8d8ba8e 100644
--- a/examples/core/vertx-connector/pom.xml
+++ b/examples/core/vertx-connector/pom.xml
@@ -61,24 +61,29 @@ under the License.
          <groupId>org.apache.geronimo.specs</groupId>
          <artifactId>geronimo-jms_2.0_spec</artifactId>
       </dependency>
-    <dependency>
-      <groupId>io.vertx</groupId>
-      <artifactId>vertx-core</artifactId>
-      <version>${vertx.version}</version>
-      <scope>provided</scope>
-    </dependency>
-    <dependency>
-      <groupId>io.vertx</groupId>
-      <artifactId>vertx-platform</artifactId>
-      <version>${vertx.version}</version>
-      <scope>provided</scope>
-    </dependency>
-    <dependency>
-      <groupId>io.vertx</groupId>
-      <artifactId>vertx-hazelcast</artifactId>
-      <version>${vertx.version}</version>
-      <scope>provided</scope>
-    </dependency>
+      <dependency>
+         <groupId>io.vertx</groupId>
+         <artifactId>vertx-core</artifactId>
+         <version>${vertx.version}</version>
+         <scope>provided</scope>
+      </dependency>
+      <dependency>
+         <groupId>io.vertx</groupId>
+         <artifactId>vertx-platform</artifactId>
+         <version>${vertx.version}</version>
+         <scope>provided</scope>
+      </dependency>
+      <dependency>
+         <groupId>io.vertx</groupId>
+         <artifactId>vertx-hazelcast</artifactId>
+         <version>${vertx.version}</version>
+         <scope>provided</scope>
+      </dependency>
+      <dependency>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-vertx-integration</artifactId>
+         <version>${project.version}</version>
+      </dependency>
 
    </dependencies>
    <profiles>
@@ -89,37 +94,41 @@ under the License.
                <plugin>
                   <groupId>org.apache.activemq</groupId>
                   <artifactId>artemis-maven-plugin</artifactId>
-            <executions>
-               <execution>
-                  <id>start</id>
-                  <goals>
-                     <goal>start</goal>
-                  </goals>
-                  <configuration>
-                     <systemProperties>
-                        <property>
-                           <name>build.directory</name>
-                           <value>${basedir}/target/</value>
-                        </property>
-                     </systemProperties>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>runClient</id>
-                  <goals>
-                     <goal>runClient</goal>
-                  </goals>
-                  <configuration>
-                     <clientClass>org.apache.activemq.artemis.core.example.VertxConnectorExample</clientClass>
-                  </configuration>
-               </execution>
-               <execution>
-                  <id>stop</id>
-                  <goals>
-                     <goal>stop</goal>
-                  </goals>
-               </execution>
-            </executions>
+                  <executions>
+                     <execution>
+                        <id>create0</id>
+                        <goals>
+                           <goal>create</goal>
+                        </goals>
+                        <configuration>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                        </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>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>runClient</id>
+                        <goals>
+                           <goal>runClient</goal>
+                        </goals>
+                        <configuration>
+                           <clientClass>org.apache.activemq.artemis.core.example.VertxConnectorExample</clientClass>
+                        </configuration>
+                     </execution>
+                  </executions>
                   <dependencies>
                      <dependency>
                         <groupId>org.apache.activemq.examples.core</groupId>
@@ -157,30 +166,24 @@ under the License.
                         <version>${netty.version}</version>
                      </dependency>
                      <dependency>
-                       <groupId>io.vertx</groupId>
-                       <artifactId>vertx-core</artifactId>
-                       <version>${vertx.version}</version>
+                        <groupId>io.vertx</groupId>
+                        <artifactId>vertx-core</artifactId>
+                        <version>${vertx.version}</version>
                      </dependency>
                      <dependency>
-                       <groupId>io.vertx</groupId>
-                       <artifactId>vertx-platform</artifactId>
-                       <version>${vertx.version}</version>
+                        <groupId>io.vertx</groupId>
+                        <artifactId>vertx-platform</artifactId>
+                        <version>${vertx.version}</version>
                      </dependency>
                      <dependency>
-                       <groupId>io.vertx</groupId>
-                       <artifactId>vertx-hazelcast</artifactId>
-                       <version>${vertx.version}</version>
+                        <groupId>io.vertx</groupId>
+                        <artifactId>vertx-hazelcast</artifactId>
+                        <version>${vertx.version}</version>
                      </dependency>
                   </dependencies>
-            <configuration>
-               <waitOnStart>false</waitOnStart>
-               <configurationDir>${basedir}/target/classes/server0</configurationDir>
-            </configuration>
                </plugin>
             </plugins>
          </build>
       </profile>
    </profiles>
-
-
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/core/vertx-connector/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/core/vertx-connector/src/main/resources/activemq/server0/broker.xml b/examples/core/vertx-connector/src/main/resources/activemq/server0/broker.xml
new file mode 100644
index 0000000..9be6726
--- /dev/null
+++ b/examples/core/vertx-connector/src/main/resources/activemq/server0/broker.xml
@@ -0,0 +1,81 @@
+<?xml version='1.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.
+-->
+
+<configuration xmlns="urn:activemq"
+            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="urn:activemq /schema/artemis-server.xsd">
+   <jms xmlns="urn:activemq:jms">
+      <!--the queue used by the example-->
+      <queue name="exampleQueue"/>
+   </jms>
+   <core xmlns="urn:activemq:core">
+      <bindings-directory>target/server0/data/messaging/bindings</bindings-directory>
+
+      <journal-directory>target/server0/data/messaging/journal</journal-directory>
+
+      <large-messages-directory>target/server0/data/messaging/largemessages</large-messages-directory>
+
+      <paging-directory>target/server0/data/messaging/paging</paging-directory>
+      <!-- Connectors -->
+
+      <connectors>
+         <connector name="netty-connector">tcp://localhost:61616</connector>
+      </connectors>
+
+      <!-- Acceptors -->
+      <acceptors>
+         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
+      </acceptors>
+
+      <!-- Other config -->
+
+      <security-settings>
+         <!--security for example queue-->
+         <security-setting match="queue.vertxQueue">
+            <permission type="consume" roles="guest"/>
+            <permission type="send" roles="guest"/>
+         </security-setting>
+      </security-settings>
+
+      <queues>
+         <queue name="queue.vertxQueue">
+            <address>queue.vertxQueue</address>
+         </queue>
+      </queues>
+
+      <connector-services>
+         <connector-service name="my-incoming-vertx">
+            <factory-class>org.apache.activemq.artemis.integration.vertx.VertxIncomingConnectorServiceFactory</factory-class>
+            <param key="queue" value="queue.vertxQueue"/>
+            <param key="host" value="localhost"/>
+            <param key="port" value="0"/>
+            <param key="vertx-address" value="incoming.vertx.address"/>
+         </connector-service>
+         <connector-service name="my-outgoing-vertx">
+            <factory-class>org.apache.activemq.artemis.integration.vertx.VertxOutgoingConnectorServiceFactory</factory-class>
+            <param key="queue" value="queue.vertxQueue"/>
+            <param key="host" value="localhost"/>
+            <param key="port" value="0"/>
+            <param key="vertx-address" value="outgoing.vertx.address"/>
+         </connector-service>
+      </connector-services>
+   </core>
+
+</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/core/vertx-connector/src/main/resources/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/core/vertx-connector/src/main/resources/server0/artemis-roles.properties b/examples/core/vertx-connector/src/main/resources/server0/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/core/vertx-connector/src/main/resources/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/core/vertx-connector/src/main/resources/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/core/vertx-connector/src/main/resources/server0/artemis-users.properties b/examples/core/vertx-connector/src/main/resources/server0/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/core/vertx-connector/src/main/resources/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/core/vertx-connector/src/main/resources/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/core/vertx-connector/src/main/resources/server0/broker.xml b/examples/core/vertx-connector/src/main/resources/server0/broker.xml
deleted file mode 100644
index 9be6726..0000000
--- a/examples/core/vertx-connector/src/main/resources/server0/broker.xml
+++ /dev/null
@@ -1,81 +0,0 @@
-<?xml version='1.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.
--->
-
-<configuration xmlns="urn:activemq"
-            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-            xsi:schemaLocation="urn:activemq /schema/artemis-server.xsd">
-   <jms xmlns="urn:activemq:jms">
-      <!--the queue used by the example-->
-      <queue name="exampleQueue"/>
-   </jms>
-   <core xmlns="urn:activemq:core">
-      <bindings-directory>target/server0/data/messaging/bindings</bindings-directory>
-
-      <journal-directory>target/server0/data/messaging/journal</journal-directory>
-
-      <large-messages-directory>target/server0/data/messaging/largemessages</large-messages-directory>
-
-      <paging-directory>target/server0/data/messaging/paging</paging-directory>
-      <!-- Connectors -->
-
-      <connectors>
-         <connector name="netty-connector">tcp://localhost:61616</connector>
-      </connectors>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
-      </acceptors>
-
-      <!-- Other config -->
-
-      <security-settings>
-         <!--security for example queue-->
-         <security-setting match="queue.vertxQueue">
-            <permission type="consume" roles="guest"/>
-            <permission type="send" roles="guest"/>
-         </security-setting>
-      </security-settings>
-
-      <queues>
-         <queue name="queue.vertxQueue">
-            <address>queue.vertxQueue</address>
-         </queue>
-      </queues>
-
-      <connector-services>
-         <connector-service name="my-incoming-vertx">
-            <factory-class>org.apache.activemq.artemis.integration.vertx.VertxIncomingConnectorServiceFactory</factory-class>
-            <param key="queue" value="queue.vertxQueue"/>
-            <param key="host" value="localhost"/>
-            <param key="port" value="0"/>
-            <param key="vertx-address" value="incoming.vertx.address"/>
-         </connector-service>
-         <connector-service name="my-outgoing-vertx">
-            <factory-class>org.apache.activemq.artemis.integration.vertx.VertxOutgoingConnectorServiceFactory</factory-class>
-            <param key="queue" value="queue.vertxQueue"/>
-            <param key="host" value="localhost"/>
-            <param key="port" value="0"/>
-            <param key="vertx-address" value="outgoing.vertx.address"/>
-         </connector-service>
-      </connector-services>
-   </core>
-
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/aerogear/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/aerogear/pom.xml b/examples/jms/aerogear/pom.xml
index f99707b..a42a6e8 100644
--- a/examples/jms/aerogear/pom.xml
+++ b/examples/jms/aerogear/pom.xml
@@ -28,10 +28,9 @@ under the License.
    </parent>
 
    <properties>
-      <endpoint />
-      <applicationid />
-      <mastersecret />
-      <mavenVersion>2.2.1</mavenVersion>
+      <endpoint/>
+      <applicationid/>
+      <mastersecret/>
       <activemq.basedir>${project.basedir}/../../..</activemq.basedir>
    </properties>
 
@@ -45,43 +44,6 @@ under the License.
          <artifactId>artemis-cli</artifactId>
          <version>${project.version}</version>
       </dependency>
-
-      <!-- maven -->
-      <dependency>
-         <groupId>org.apache.maven</groupId>
-         <artifactId>maven-artifact</artifactId>
-         <version>${mavenVersion}</version>
-      </dependency>
-      <dependency>
-         <groupId>org.apache.maven</groupId>
-         <artifactId>maven-plugin-api</artifactId>
-         <version>${mavenVersion}</version>
-      </dependency>
-      <dependency>
-         <groupId>org.apache.maven</groupId>
-         <artifactId>maven-project</artifactId>
-         <version>${mavenVersion}</version>
-      </dependency>
-      <dependency>
-         <groupId>org.apache.maven</groupId>
-         <artifactId>maven-model</artifactId>
-         <version>${mavenVersion}</version>
-      </dependency>
-      <dependency>
-         <groupId>org.apache.maven</groupId>
-         <artifactId>maven-core</artifactId>
-         <version>${mavenVersion}</version>
-      </dependency>
-      <dependency>
-         <groupId>org.apache.maven</groupId>
-         <artifactId>maven-artifact-manager</artifactId>
-         <version>${mavenVersion}</version>
-      </dependency>
-      <dependency>
-         <groupId>org.apache.maven</groupId>
-         <artifactId>maven-repository-metadata</artifactId>
-         <version>${mavenVersion}</version>
-      </dependency>
    </dependencies>
 
    <profiles>
@@ -122,8 +84,7 @@ under the License.
                         </goals>
                         <configuration>
                            <spawn>true</spawn>
-                           <testServer>true</testServer>
-                           <!-- this list was extracted from mvn dependency:tree on integration/aerogear -->
+                           <testURI>tcp://localhost:61616</testURI>
                            <args>
                               <param>run</param>
                            </args>
@@ -136,9 +97,6 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.AerogearExample</clientClass>
-                           <args>
-                              <param>${basedir}/target/server0</param>
-                           </args>
                         </configuration>
                      </execution>
                      <execution>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/aerogear/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/aerogear/src/main/resources/activemq/server0/broker.xml b/examples/jms/aerogear/src/main/resources/activemq/server0/broker.xml
index 90c93e6..5c389c8 100644
--- a/examples/jms/aerogear/src/main/resources/activemq/server0/broker.xml
+++ b/examples/jms/aerogear/src/main/resources/activemq/server0/broker.xml
@@ -29,13 +29,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>${data.dir:../data}/bindings</bindings-directory>
+      <bindings-directory>${data.dir:./data}/bindings</bindings-directory>
 
-      <journal-directory>${data.dir:../data}/journal</journal-directory>
+      <journal-directory>${data.dir:./data}/journal</journal-directory>
 
-      <large-messages-directory>${data.dir:../data}/largemessages</large-messages-directory>
+      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir:../data}/paging</paging-directory>
+      <paging-directory>${data.dir:./data}/paging</paging-directory>
 
       <!-- Acceptors -->
       <acceptors>
@@ -73,6 +73,5 @@ under the License.
             <permission type="send" roles="guest"/>
          </security-setting>
       </security-settings>
-
    </core>
 </configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/application-layer-failover/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/application-layer-failover/pom.xml b/examples/jms/application-layer-failover/pom.xml
index 9f4abb5..65d217d 100644
--- a/examples/jms/application-layer-failover/pom.xml
+++ b/examples/jms/application-layer-failover/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>
@@ -66,7 +66,7 @@ under the License.
                         </configuration>
                      </execution>
                      <execution>
-                        <id>create2</id>
+                        <id>create1</id>
                         <goals>
                            <goal>create</goal>
                         </goals>


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

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/symmetric-cluster/src/main/resources/activemq/server2/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/symmetric-cluster/src/main/resources/activemq/server2/artemis-roles.properties b/examples/jms/symmetric-cluster/src/main/resources/activemq/server2/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/symmetric-cluster/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/symmetric-cluster/src/main/resources/activemq/server2/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/symmetric-cluster/src/main/resources/activemq/server2/artemis-users.properties b/examples/jms/symmetric-cluster/src/main/resources/activemq/server2/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/symmetric-cluster/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/symmetric-cluster/src/main/resources/activemq/server2/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/symmetric-cluster/src/main/resources/activemq/server2/broker.xml b/examples/jms/symmetric-cluster/src/main/resources/activemq/server2/broker.xml
index 30f33a0..a188e71 100644
--- a/examples/jms/symmetric-cluster/src/main/resources/activemq/server2/broker.xml
+++ b/examples/jms/symmetric-cluster/src/main/resources/activemq/server2/broker.xml
@@ -30,14 +30,13 @@ under the License.
 
    <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 -->
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/symmetric-cluster/src/main/resources/activemq/server3/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/symmetric-cluster/src/main/resources/activemq/server3/artemis-roles.properties b/examples/jms/symmetric-cluster/src/main/resources/activemq/server3/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/symmetric-cluster/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/symmetric-cluster/src/main/resources/activemq/server3/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/symmetric-cluster/src/main/resources/activemq/server3/artemis-users.properties b/examples/jms/symmetric-cluster/src/main/resources/activemq/server3/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/symmetric-cluster/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/symmetric-cluster/src/main/resources/activemq/server3/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/symmetric-cluster/src/main/resources/activemq/server3/broker.xml b/examples/jms/symmetric-cluster/src/main/resources/activemq/server3/broker.xml
index afda21b..43ab47c 100644
--- a/examples/jms/symmetric-cluster/src/main/resources/activemq/server3/broker.xml
+++ b/examples/jms/symmetric-cluster/src/main/resources/activemq/server3/broker.xml
@@ -30,14 +30,13 @@ under the License.
 
    <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 -->
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/symmetric-cluster/src/main/resources/activemq/server4/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/symmetric-cluster/src/main/resources/activemq/server4/artemis-roles.properties b/examples/jms/symmetric-cluster/src/main/resources/activemq/server4/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/symmetric-cluster/src/main/resources/activemq/server4/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/symmetric-cluster/src/main/resources/activemq/server4/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/symmetric-cluster/src/main/resources/activemq/server4/artemis-users.properties b/examples/jms/symmetric-cluster/src/main/resources/activemq/server4/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/symmetric-cluster/src/main/resources/activemq/server4/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/symmetric-cluster/src/main/resources/activemq/server4/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/symmetric-cluster/src/main/resources/activemq/server4/broker.xml b/examples/jms/symmetric-cluster/src/main/resources/activemq/server4/broker.xml
index 321d57b..ce4afab 100644
--- a/examples/jms/symmetric-cluster/src/main/resources/activemq/server4/broker.xml
+++ b/examples/jms/symmetric-cluster/src/main/resources/activemq/server4/broker.xml
@@ -30,14 +30,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
+      <bindings-directory>${data.dir:./data}/bindings</bindings-directory>
 
-      <bindings-directory>${data.dir}/server4/data/messaging/bindings</bindings-directory>
+      <journal-directory>${data.dir:./data}/journal</journal-directory>
 
-      <journal-directory>${data.dir}/server4/data/messaging/journal</journal-directory>
+      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
 
-      <large-messages-directory>${data.dir}/server4/data/messaging/largemessages</large-messages-directory>
-
-      <paging-directory>${data.dir}/server4/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/symmetric-cluster/src/main/resources/activemq/server5/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/symmetric-cluster/src/main/resources/activemq/server5/artemis-roles.properties b/examples/jms/symmetric-cluster/src/main/resources/activemq/server5/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/symmetric-cluster/src/main/resources/activemq/server5/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/symmetric-cluster/src/main/resources/activemq/server5/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/symmetric-cluster/src/main/resources/activemq/server5/artemis-users.properties b/examples/jms/symmetric-cluster/src/main/resources/activemq/server5/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/symmetric-cluster/src/main/resources/activemq/server5/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/symmetric-cluster/src/main/resources/activemq/server5/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/symmetric-cluster/src/main/resources/activemq/server5/broker.xml b/examples/jms/symmetric-cluster/src/main/resources/activemq/server5/broker.xml
index abbe9ad..d23612a 100644
--- a/examples/jms/symmetric-cluster/src/main/resources/activemq/server5/broker.xml
+++ b/examples/jms/symmetric-cluster/src/main/resources/activemq/server5/broker.xml
@@ -30,23 +30,22 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
+      <bindings-directory>${data.dir:./data}/bindings</bindings-directory>
 
-      <bindings-directory>${data.dir}/server5/data/messaging/bindings</bindings-directory>
+      <journal-directory>${data.dir:./data}/journal</journal-directory>
 
-      <journal-directory>${data.dir}/server5/data/messaging/journal</journal-directory>
+      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
 
-      <large-messages-directory>${data.dir}/server5/data/messaging/largemessages</large-messages-directory>
-
-      <paging-directory>${data.dir}/server5/data/messaging/paging</paging-directory>
+      <paging-directory>${data.dir:./data}/paging</paging-directory>
 
       <!-- Connectors -->
       <connectors>
-         <connector name="netty-connector">tcp://localhost:5450</connector>
+         <connector name="netty-connector">tcp://localhost:61621</connector>
       </connectors>
 
       <!-- Acceptors -->
       <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:5450</acceptor>
+         <acceptor name="netty-acceptor">tcp://localhost:61621</acceptor>
       </acceptors>
 
       <!-- Clustering configuration -->

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/temp-queue/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/temp-queue/pom.xml b/examples/jms/temp-queue/pom.xml
index b213088..1599fcc 100644
--- a/examples/jms/temp-queue/pom.xml
+++ b/examples/jms/temp-queue/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>
@@ -61,9 +56,18 @@ under the License.
                         <goals>
                            <goal>create</goal>
                         </goals>
+                     </execution>
+                     <execution>
+                        <id>start</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
                         <configuration>
-                           <instance>${basedir}/target/server0</instance>
-                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                           <spawn>true</spawn>
+                           <testURI>tcp://localhost:61616</testURI>
+                           <args>
+                              <param>run</param>
+                           </args>
                         </configuration>
                      </execution>
                      <execution>
@@ -73,8 +77,16 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.TemporaryQueueExample</clientClass>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>stop</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
                            <args>
-                              <param>${basedir}/target/server0</param>
+                              <param>stop</param>
                            </args>
                         </configuration>
                      </execution>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/temp-queue/src/main/java/org/apache/activemq/artemis/jms/example/TemporaryQueueExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/temp-queue/src/main/java/org/apache/activemq/artemis/jms/example/TemporaryQueueExample.java b/examples/jms/temp-queue/src/main/java/org/apache/activemq/artemis/jms/example/TemporaryQueueExample.java
index cd39f7f..a2f7d38 100644
--- a/examples/jms/temp-queue/src/main/java/org/apache/activemq/artemis/jms/example/TemporaryQueueExample.java
+++ b/examples/jms/temp-queue/src/main/java/org/apache/activemq/artemis/jms/example/TemporaryQueueExample.java
@@ -26,20 +26,12 @@ import javax.jms.TemporaryQueue;
 import javax.jms.TextMessage;
 import javax.naming.InitialContext;
 
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
-
 /**
  * A simple JMS example that shows how to use temporary queues.
  */
-public class TemporaryQueueExample extends ActiveMQExample
+public class TemporaryQueueExample
 {
-   public static void main(final String[] args)
-   {
-      new TemporaryQueueExample().run(args);
-   }
-
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(final String[] args) throws Exception
    {
       Connection connection = null;
       InitialContext initialContext = null;
@@ -115,8 +107,6 @@ public class TemporaryQueueExample extends ActiveMQExample
          {
             System.out.println("Exception got when trying to access a temp queue outside its scope: " + e);
          }
-
-         return true;
       }
       finally
       {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/temp-queue/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/temp-queue/src/main/resources/activemq/server0/artemis-roles.properties b/examples/jms/temp-queue/src/main/resources/activemq/server0/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/temp-queue/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/temp-queue/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/temp-queue/src/main/resources/activemq/server0/artemis-users.properties b/examples/jms/temp-queue/src/main/resources/activemq/server0/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/temp-queue/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/temp-queue/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/temp-queue/src/main/resources/activemq/server0/broker.xml b/examples/jms/temp-queue/src/main/resources/activemq/server0/broker.xml
index d595086..f1c14b2 100644
--- a/examples/jms/temp-queue/src/main/resources/activemq/server0/broker.xml
+++ b/examples/jms/temp-queue/src/main/resources/activemq/server0/broker.xml
@@ -29,19 +29,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
+      <bindings-directory>${data.dir:./data}/bindings</bindings-directory>
 
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
+      <journal-directory>${data.dir:./data}/journal</journal-directory>
 
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
+      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
-
-
-      <!-- Connectors -->
-      <connectors>
-         <connector name="netty-connector">tcp://localhost:61616</connector>
-      </connectors>
+      <paging-directory>${data.dir:./data}/paging</paging-directory>
 
       <!-- Acceptors -->
       <acceptors>
@@ -49,8 +43,6 @@ under the License.
       </acceptors>
 
       <!-- Other config -->
-
-
       <security-settings>
          <!--security for example queues -->
          <security-setting match="jms.queue.#">
@@ -69,6 +61,5 @@ under the License.
             <permission type="send" roles="guest"/>
          </security-setting>
       </security-settings>
-
    </core>
 </configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/topic-hierarchies/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/topic-hierarchies/pom.xml b/examples/jms/topic-hierarchies/pom.xml
index 087570e..250abd3 100644
--- a/examples/jms/topic-hierarchies/pom.xml
+++ b/examples/jms/topic-hierarchies/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-jms-client</artifactId>
          <version>${project.version}</version>
       </dependency>
       <dependency>
@@ -61,9 +61,18 @@ under the License.
                         <goals>
                            <goal>create</goal>
                         </goals>
+                     </execution>
+                     <execution>
+                        <id>start</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
                         <configuration>
-                           <instance>${basedir}/target/server0</instance>
-                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                           <spawn>true</spawn>
+                           <testURI>tcp://localhost:61616</testURI>
+                           <args>
+                              <param>run</param>
+                           </args>
                         </configuration>
                      </execution>
                      <execution>
@@ -73,8 +82,16 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.TopicHierarchyExample</clientClass>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>stop</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
                            <args>
-                              <param>${basedir}/target/server0</param>
+                              <param>stop</param>
                            </args>
                         </configuration>
                      </execution>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/topic-hierarchies/src/main/java/org/apache/activemq/artemis/jms/example/TopicHierarchyExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/topic-hierarchies/src/main/java/org/apache/activemq/artemis/jms/example/TopicHierarchyExample.java b/examples/jms/topic-hierarchies/src/main/java/org/apache/activemq/artemis/jms/example/TopicHierarchyExample.java
index 34fe27d..f2385ba 100644
--- a/examples/jms/topic-hierarchies/src/main/java/org/apache/activemq/artemis/jms/example/TopicHierarchyExample.java
+++ b/examples/jms/topic-hierarchies/src/main/java/org/apache/activemq/artemis/jms/example/TopicHierarchyExample.java
@@ -27,22 +27,15 @@ import javax.jms.Topic;
 import javax.naming.InitialContext;
 
 import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
 
 /**
  * This example demonstrates how a JMS TopicSubscriber can be created to subscribe to a wild-card Topic.
  *
  * For more information please see the readme.html
  */
-public class TopicHierarchyExample extends ActiveMQExample
+public class TopicHierarchyExample
 {
-   public static void main(final String[] args)
-   {
-      new TopicHierarchyExample().run(args);
-   }
-
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(final String[] args) throws Exception
    {
       Connection connection = null;
       InitialContext initialContext = null;
@@ -113,12 +106,10 @@ public class TopicHierarchyExample extends ActiveMQExample
 
          if (message != null)
          {
-            return false;
+            throw new IllegalStateException("Message was not null.");
          }
 
          System.out.println("Didn't received any more message: " + message);
-
-         return true;
       }
       finally
       {
@@ -133,5 +124,4 @@ public class TopicHierarchyExample extends ActiveMQExample
          }
       }
    }
-
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/topic-hierarchies/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/topic-hierarchies/src/main/resources/activemq/server0/artemis-roles.properties b/examples/jms/topic-hierarchies/src/main/resources/activemq/server0/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/topic-hierarchies/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/topic-hierarchies/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/topic-hierarchies/src/main/resources/activemq/server0/artemis-users.properties b/examples/jms/topic-hierarchies/src/main/resources/activemq/server0/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/topic-hierarchies/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/topic-hierarchies/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/topic-hierarchies/src/main/resources/activemq/server0/broker.xml b/examples/jms/topic-hierarchies/src/main/resources/activemq/server0/broker.xml
index 1f94195..ac065f6 100644
--- a/examples/jms/topic-hierarchies/src/main/resources/activemq/server0/broker.xml
+++ b/examples/jms/topic-hierarchies/src/main/resources/activemq/server0/broker.xml
@@ -40,13 +40,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
+      <bindings-directory>${data.dir:./data}/bindings</bindings-directory>
 
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
+      <journal-directory>${data.dir:./data}/journal</journal-directory>
 
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
+      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
+      <paging-directory>${data.dir:./data}/paging</paging-directory>
 
       <!-- Acceptors -->
       <acceptors>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/topic-selector-example1/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/topic-selector-example1/pom.xml b/examples/jms/topic-selector-example1/pom.xml
index 7526dd5..bbf95ee 100644
--- a/examples/jms/topic-selector-example1/pom.xml
+++ b/examples/jms/topic-selector-example1/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>
@@ -61,9 +56,18 @@ under the License.
                         <goals>
                            <goal>create</goal>
                         </goals>
+                     </execution>
+                     <execution>
+                        <id>start</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
                         <configuration>
-                           <instance>${basedir}/target/server0</instance>
-                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                           <spawn>true</spawn>
+                           <testURI>tcp://localhost:61616</testURI>
+                           <args>
+                              <param>run</param>
+                           </args>
                         </configuration>
                      </execution>
                      <execution>
@@ -73,8 +77,16 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.TopicSelectorExample1</clientClass>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>stop</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
                            <args>
-                              <param>${basedir}/target/server0</param>
+                              <param>stop</param>
                            </args>
                         </configuration>
                      </execution>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/topic-selector-example1/src/main/java/org/apache/activemq/artemis/jms/example/TopicSelectorExample1.java
----------------------------------------------------------------------
diff --git a/examples/jms/topic-selector-example1/src/main/java/org/apache/activemq/artemis/jms/example/TopicSelectorExample1.java b/examples/jms/topic-selector-example1/src/main/java/org/apache/activemq/artemis/jms/example/TopicSelectorExample1.java
index 5116a76..28c128e 100644
--- a/examples/jms/topic-selector-example1/src/main/java/org/apache/activemq/artemis/jms/example/TopicSelectorExample1.java
+++ b/examples/jms/topic-selector-example1/src/main/java/org/apache/activemq/artemis/jms/example/TopicSelectorExample1.java
@@ -25,20 +25,12 @@ import javax.jms.TextMessage;
 import javax.jms.Topic;
 import javax.naming.InitialContext;
 
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
-
 /**
  * A simple JMS Topic example that creates a producer and consumer on a queue and sends and receives a message.
  */
-public class TopicSelectorExample1 extends ActiveMQExample
+public class TopicSelectorExample1
 {
-   public static void main(final String[] args)
-   {
-      new TopicSelectorExample1().run(args);
-   }
-
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(final String[] args) throws Exception
    {
       Connection connection = null;
 
@@ -81,8 +73,8 @@ public class TopicSelectorExample1 extends ActiveMQExample
             {
                // Step 10.1 Create a text message
                TextMessage message1 = session.createTextMessage("This is a text message " + i +
-                                                                " sent for someID=" +
-                                                                someID);
+                                                                        " sent for someID=" +
+                                                                        someID);
 
                // Step 10.1 Set a property
                message1.setIntProperty("someID", someID);
@@ -110,8 +102,8 @@ public class TopicSelectorExample1 extends ActiveMQExample
             }
 
             System.out.println("messageConsumer1 received " + messageReceivedA.getText() +
-                               " someID = " +
-                               messageReceivedA.getIntProperty("someID"));
+                                       " someID = " +
+                                       messageReceivedA.getIntProperty("someID"));
          }
 
          // Step 13. Consume the messages from MessageConsumer2, filtering out someID=2
@@ -126,8 +118,8 @@ public class TopicSelectorExample1 extends ActiveMQExample
             }
 
             System.out.println("messageConsumer2 received " + messageReceivedB.getText() +
-                               " someID = " +
-                               messageReceivedB.getIntProperty("someID"));
+                                       " someID = " +
+                                       messageReceivedB.getIntProperty("someID"));
          }
 
          // Step 14. Consume the messages from MessageConsumer3, receiving the complete set of messages
@@ -141,17 +133,14 @@ public class TopicSelectorExample1 extends ActiveMQExample
                break;
             }
             System.out.println("messageConsumer3 received " + messageReceivedC.getText() +
-                               " someID = " +
-                               messageReceivedC.getIntProperty("someID"));
+                                       " someID = " +
+                                       messageReceivedC.getIntProperty("someID"));
          }
 
          // Step 15. Close the subscribers
          messageConsumer1.close();
          messageConsumer2.close();
          messageConsumer3.close();
-
-         return true;
-
       }
       finally
       {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/topic-selector-example1/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/topic-selector-example1/src/main/resources/activemq/server0/artemis-roles.properties b/examples/jms/topic-selector-example1/src/main/resources/activemq/server0/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/topic-selector-example1/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/topic-selector-example1/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/topic-selector-example1/src/main/resources/activemq/server0/artemis-users.properties b/examples/jms/topic-selector-example1/src/main/resources/activemq/server0/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/topic-selector-example1/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/topic-selector-example1/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/topic-selector-example1/src/main/resources/activemq/server0/broker.xml b/examples/jms/topic-selector-example1/src/main/resources/activemq/server0/broker.xml
index e7c1a14..4a4b505 100644
--- a/examples/jms/topic-selector-example1/src/main/resources/activemq/server0/broker.xml
+++ b/examples/jms/topic-selector-example1/src/main/resources/activemq/server0/broker.xml
@@ -29,13 +29,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
+      <bindings-directory>${data.dir:./data}/bindings</bindings-directory>
 
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
+      <journal-directory>${data.dir:./data}/journal</journal-directory>
 
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
+      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
+      <paging-directory>${data.dir:./data}/paging</paging-directory>
 
       <!-- Acceptors -->
       <acceptors>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/topic-selector-example2/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/topic-selector-example2/pom.xml b/examples/jms/topic-selector-example2/pom.xml
index 320d13c..b9f5332 100644
--- a/examples/jms/topic-selector-example2/pom.xml
+++ b/examples/jms/topic-selector-example2/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>
@@ -61,9 +56,18 @@ under the License.
                         <goals>
                            <goal>create</goal>
                         </goals>
+                     </execution>
+                     <execution>
+                        <id>start</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
                         <configuration>
-                           <instance>${basedir}/target/server0</instance>
-                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                           <spawn>true</spawn>
+                           <testURI>tcp://localhost:61616</testURI>
+                           <args>
+                              <param>run</param>
+                           </args>
                         </configuration>
                      </execution>
                      <execution>
@@ -73,8 +77,16 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.TopicSelectorExample2</clientClass>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>stop</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
                            <args>
-                              <param>${basedir}/target/server0</param>
+                              <param>stop</param>
                            </args>
                         </configuration>
                      </execution>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/topic-selector-example2/src/main/java/org/apache/activemq/artemis/jms/example/TopicSelectorExample2.java
----------------------------------------------------------------------
diff --git a/examples/jms/topic-selector-example2/src/main/java/org/apache/activemq/artemis/jms/example/TopicSelectorExample2.java b/examples/jms/topic-selector-example2/src/main/java/org/apache/activemq/artemis/jms/example/TopicSelectorExample2.java
index 301b752..e80d22d 100644
--- a/examples/jms/topic-selector-example2/src/main/java/org/apache/activemq/artemis/jms/example/TopicSelectorExample2.java
+++ b/examples/jms/topic-selector-example2/src/main/java/org/apache/activemq/artemis/jms/example/TopicSelectorExample2.java
@@ -27,24 +27,16 @@ import javax.jms.Session;
 import javax.jms.TextMessage;
 import javax.jms.Topic;
 import javax.naming.InitialContext;
-
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
+import java.util.concurrent.atomic.AtomicBoolean;
 
 /**
  * A simple JMS example that consumes messages using selectors.
  */
-public class TopicSelectorExample2 extends ActiveMQExample
+public class TopicSelectorExample2
 {
-   private volatile boolean result = true;
-
-   public static void main(final String[] args)
-   {
-      new TopicSelectorExample2().run(args);
-   }
-
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(final String[] args) throws Exception
    {
+      AtomicBoolean result = new AtomicBoolean(true);
       Connection connection = null;
       InitialContext initialContext = null;
       try
@@ -65,33 +57,36 @@ public class TopicSelectorExample2 extends ActiveMQExample
          connection.start();
 
          // Step 6. Create a JMS Session
-         Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+         Session producerSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
 
          // Step 7. Create a Message Producer
-         MessageProducer producer = session.createProducer(topic);
+         MessageProducer producer = producerSession.createProducer(topic);
 
          // Step 8. Prepare two selectors
          String redSelector = "color='red'";
          String greenSelector = "color='green'";
 
          // Step 9. Create a JMS Message Consumer that receives 'red' messages
-         MessageConsumer redConsumer = session.createConsumer(topic, redSelector);
-         redConsumer.setMessageListener(new SimpleMessageListener("red"));
+         Session redSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+         MessageConsumer redConsumer = redSession.createConsumer(topic, redSelector);
+         redConsumer.setMessageListener(new SimpleMessageListener("red", result));
 
          // Step 10. Create a second JMS message consumer that receives 'green' messages
-         MessageConsumer greenConsumer = session.createConsumer(topic, greenSelector);
-         greenConsumer.setMessageListener(new SimpleMessageListener("green"));
+         Session greenSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+         MessageConsumer greenConsumer = greenSession.createConsumer(topic, greenSelector);
+         greenConsumer.setMessageListener(new SimpleMessageListener("green", result));
 
          // Step 11. Create another JMS message consumer that receives all messages.
-         MessageConsumer allConsumer = session.createConsumer(topic);
-         allConsumer.setMessageListener(new SimpleMessageListener("all"));
+         Session allSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+         MessageConsumer allConsumer = allSession.createConsumer(topic);
+         allConsumer.setMessageListener(new SimpleMessageListener("all", result));
 
          // Step 12. Create three messages, each has a color property
-         TextMessage redMessage = session.createTextMessage("Red");
+         TextMessage redMessage = producerSession.createTextMessage("Red");
          redMessage.setStringProperty("color", "red");
-         TextMessage greenMessage = session.createTextMessage("Green");
+         TextMessage greenMessage = producerSession.createTextMessage("Green");
          greenMessage.setStringProperty("color", "green");
-         TextMessage blueMessage = session.createTextMessage("Blue");
+         TextMessage blueMessage = producerSession.createTextMessage("Blue");
          blueMessage.setStringProperty("color", "blue");
 
          // Step 13. Send the Messages
@@ -104,7 +99,8 @@ public class TopicSelectorExample2 extends ActiveMQExample
 
          Thread.sleep(5000);
 
-         return result;
+         if (!result.get())
+            throw new IllegalStateException();
       }
       finally
       {
@@ -121,39 +117,39 @@ public class TopicSelectorExample2 extends ActiveMQExample
          }
       }
    }
+}
 
-   public class SimpleMessageListener implements MessageListener
-   {
-
-      private final String name;
+class SimpleMessageListener implements MessageListener
+{
+   private final String name;
+   AtomicBoolean result;
 
-      public SimpleMessageListener(final String listener)
-      {
-         name = listener;
-      }
+   public SimpleMessageListener(final String listener, AtomicBoolean result)
+   {
+      name = listener;
+      this.result = result;
+   }
 
-      public void onMessage(final Message msg)
+   public void onMessage(final Message msg)
+   {
+      TextMessage textMessage = (TextMessage)msg;
+      try
       {
-         TextMessage textMessage = (TextMessage)msg;
-         try
-         {
-            String colorProp = msg.getStringProperty("color");
-            System.out.println("Receiver " + name +
-                               " receives message [" +
-                               textMessage.getText() +
-                               "] with color property: " +
-                               colorProp);
-            if (!colorProp.equals(name) && !name.equals("all"))
-            {
-               result = false;
-            }
-         }
-         catch (JMSException e)
+         String colorProp = msg.getStringProperty("color");
+         System.out.println("Receiver " + name +
+                                    " receives message [" +
+                                    textMessage.getText() +
+                                    "] with color property: " +
+                                    colorProp);
+         if (!colorProp.equals(name) && !name.equals("all"))
          {
-            e.printStackTrace();
-            result = false;
+            result.set(false);
          }
       }
-
+      catch (JMSException e)
+      {
+         e.printStackTrace();
+         result.set(false);
+      }
    }
-}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/topic-selector-example2/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/topic-selector-example2/src/main/resources/activemq/server0/artemis-roles.properties b/examples/jms/topic-selector-example2/src/main/resources/activemq/server0/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/topic-selector-example2/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/topic-selector-example2/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/topic-selector-example2/src/main/resources/activemq/server0/artemis-users.properties b/examples/jms/topic-selector-example2/src/main/resources/activemq/server0/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/topic-selector-example2/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/topic-selector-example2/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/topic-selector-example2/src/main/resources/activemq/server0/broker.xml b/examples/jms/topic-selector-example2/src/main/resources/activemq/server0/broker.xml
index e7c1a14..4a4b505 100644
--- a/examples/jms/topic-selector-example2/src/main/resources/activemq/server0/broker.xml
+++ b/examples/jms/topic-selector-example2/src/main/resources/activemq/server0/broker.xml
@@ -29,13 +29,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
+      <bindings-directory>${data.dir:./data}/bindings</bindings-directory>
 
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
+      <journal-directory>${data.dir:./data}/journal</journal-directory>
 
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
+      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
+      <paging-directory>${data.dir:./data}/paging</paging-directory>
 
       <!-- Acceptors -->
       <acceptors>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/topic/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/topic/pom.xml b/examples/jms/topic/pom.xml
index 0fe39ff..2c6a91a 100644
--- a/examples/jms/topic/pom.xml
+++ b/examples/jms/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>
@@ -60,9 +55,18 @@ under the License.
                         <goals>
                            <goal>create</goal>
                         </goals>
+                     </execution>
+                     <execution>
+                        <id>start</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
                         <configuration>
-                           <instance>${basedir}/target/server0</instance>
-                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                           <spawn>true</spawn>
+                           <testURI>tcp://localhost:61616</testURI>
+                           <args>
+                              <param>run</param>
+                           </args>
                         </configuration>
                      </execution>
                      <execution>
@@ -72,8 +76,16 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.TopicExample</clientClass>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>stop</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
                            <args>
-                              <param>${basedir}/target/server0</param>
+                              <param>stop</param>
                            </args>
                         </configuration>
                      </execution>
@@ -90,5 +102,4 @@ under the License.
          </build>
       </profile>
    </profiles>
-
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/topic/src/main/java/org/apache/activemq/artemis/jms/example/TopicExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/topic/src/main/java/org/apache/activemq/artemis/jms/example/TopicExample.java b/examples/jms/topic/src/main/java/org/apache/activemq/artemis/jms/example/TopicExample.java
index 0564525..08ca057 100644
--- a/examples/jms/topic/src/main/java/org/apache/activemq/artemis/jms/example/TopicExample.java
+++ b/examples/jms/topic/src/main/java/org/apache/activemq/artemis/jms/example/TopicExample.java
@@ -25,20 +25,12 @@ import javax.jms.TextMessage;
 import javax.jms.Topic;
 import javax.naming.InitialContext;
 
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
-
 /**
  * A simple JMS Topic example that creates a producer and consumer on a queue and sends and receives a message.
  */
-public class TopicExample extends ActiveMQExample
+public class TopicExample
 {
-   public static void main(final String[] args)
-   {
-      new TopicExample().run(args);
-   }
-
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(final String[] args) throws Exception
    {
       Connection connection = null;
       InitialContext initialContext = null;
@@ -88,8 +80,6 @@ public class TopicExample extends ActiveMQExample
          messageReceived = (TextMessage)messageConsumer2.receive();
 
          System.out.println("Consumer 2 Received message: " + messageReceived.getText());
-
-         return true;
       }
       finally
       {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/topic/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/topic/src/main/resources/activemq/server0/artemis-roles.properties b/examples/jms/topic/src/main/resources/activemq/server0/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/topic/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/topic/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/topic/src/main/resources/activemq/server0/artemis-users.properties b/examples/jms/topic/src/main/resources/activemq/server0/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/topic/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/topic/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/topic/src/main/resources/activemq/server0/broker.xml b/examples/jms/topic/src/main/resources/activemq/server0/broker.xml
index e7c1a14..f379d55 100644
--- a/examples/jms/topic/src/main/resources/activemq/server0/broker.xml
+++ b/examples/jms/topic/src/main/resources/activemq/server0/broker.xml
@@ -29,13 +29,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
+      <bindings-directory>${data.dir:./data}/bindings</bindings-directory>
 
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
+      <journal-directory>${data.dir:./data}/journal</journal-directory>
 
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
+      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
+      <paging-directory>${data.dir:./data}/paging</paging-directory>
 
       <!-- Acceptors -->
       <acceptors>
@@ -43,7 +43,6 @@ under the License.
       </acceptors>
 
       <!-- Other config -->
-
       <security-settings>
          <!--security for example topic-->
          <security-setting match="jms.topic.exampleTopic">

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/transaction-failover/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/transaction-failover/pom.xml b/examples/jms/transaction-failover/pom.xml
index f954478..0fe0ec8 100644
--- a/examples/jms/transaction-failover/pom.xml
+++ b/examples/jms/transaction-failover/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>
@@ -68,7 +68,7 @@ under the License.
                         </configuration>
                      </execution>
                      <execution>
-                        <id>create2</id>
+                        <id>create1</id>
                         <goals>
                            <goal>create</goal>
                         </goals>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/transaction-failover/src/main/java/org/apache/activemq/artemis/jms/example/TransactionFailoverExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/transaction-failover/src/main/java/org/apache/activemq/artemis/jms/example/TransactionFailoverExample.java b/examples/jms/transaction-failover/src/main/java/org/apache/activemq/artemis/jms/example/TransactionFailoverExample.java
index 4998649..119bdf8 100644
--- a/examples/jms/transaction-failover/src/main/java/org/apache/activemq/artemis/jms/example/TransactionFailoverExample.java
+++ b/examples/jms/transaction-failover/src/main/java/org/apache/activemq/artemis/jms/example/TransactionFailoverExample.java
@@ -16,6 +16,9 @@
  */
 package org.apache.activemq.artemis.jms.example;
 
+import org.apache.activemq.artemis.api.core.Message;
+import org.apache.activemq.artemis.util.ServerUtil;
+
 import javax.jms.Connection;
 import javax.jms.ConnectionFactory;
 import javax.jms.MessageConsumer;
@@ -26,30 +29,23 @@ import javax.jms.TextMessage;
 import javax.jms.TransactionRolledBackException;
 import javax.naming.InitialContext;
 
-import org.apache.activemq.artemis.api.core.Message;
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
-
 /**
  * A simple example that demonstrates failover of the JMS connection from one node to another
  * when the live server crashes using a JMS <em>transacted</em> session.
  */
-public class TransactionFailoverExample extends ActiveMQExample
+public class TransactionFailoverExample
 {
-
-   public static void main(final String[] args)
-   {
-      new TransactionFailoverExample().run(args);
-   }
-
    // You need to guarantee uniqueIDs when using duplicate detection
    // It needs to be unique even after a restart
    // as these IDs are stored on the journal for control
    // We recommend some sort of UUID, but for this example the Current Time as string would be enough
-   String uniqueID = Long.toString(System.currentTimeMillis());
+   static String uniqueID = Long.toString(System.currentTimeMillis());
 
+   private static Process server0;
 
-   @Override
-   public boolean runExample() throws Exception
+   private static Process server1;
+
+   public static void main(final String[] args) throws Exception
    {
       final int numMessages = 10;
 
@@ -59,6 +55,9 @@ public class TransactionFailoverExample extends ActiveMQExample
 
       try
       {
+         server0 = ServerUtil.startServer(args[0], TransactionFailoverExample.class.getSimpleName() + "0", 0, 5000);
+         server1 = ServerUtil.startServer(args[1], TransactionFailoverExample.class.getSimpleName() + "1", 1, 5000);
+
          // Step 1. Get an initial context for looking up JNDI from the server #1
          initialContext = new InitialContext();
 
@@ -109,9 +108,7 @@ public class TransactionFailoverExample extends ActiveMQExample
 
             if (message0 == null)
             {
-               System.err.println("Example failed - message wasn't received");
-
-               return false;
+               throw new IllegalStateException("Example failed - message wasn't received");
             }
 
             System.out.println("Got message: " + message0.getText());
@@ -120,8 +117,6 @@ public class TransactionFailoverExample extends ActiveMQExample
          session.commit();
 
          System.out.println("Other message on the server? " + consumer.receive(5000));
-
-         return true;
       }
       finally
       {
@@ -136,10 +131,13 @@ public class TransactionFailoverExample extends ActiveMQExample
          {
             initialContext.close();
          }
+
+         ServerUtil.killServer(server0);
+         ServerUtil.killServer(server1);
       }
    }
 
-   private void sendMessages(final Session session,
+   private static void sendMessages(final Session session,
                              final MessageProducer producer,
                              final int numMessages,
                              final boolean killServer) throws Exception
@@ -161,8 +159,7 @@ public class TransactionFailoverExample extends ActiveMQExample
       {
          Thread.sleep(5000);
 
-         killServer(0);
-
+         ServerUtil.killServer(server0);
       }
 
       // We send the remaining half of messages
@@ -180,5 +177,4 @@ public class TransactionFailoverExample extends ActiveMQExample
          System.out.println("Sent message: " + message.getText());
       }
    }
-
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/transaction-failover/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/transaction-failover/src/main/resources/activemq/server0/artemis-roles.properties b/examples/jms/transaction-failover/src/main/resources/activemq/server0/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/transaction-failover/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/transaction-failover/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/transaction-failover/src/main/resources/activemq/server0/artemis-users.properties b/examples/jms/transaction-failover/src/main/resources/activemq/server0/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/transaction-failover/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/transaction-failover/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/transaction-failover/src/main/resources/activemq/server0/broker.xml b/examples/jms/transaction-failover/src/main/resources/activemq/server0/broker.xml
index 74a66d4..916fdf5 100644
--- a/examples/jms/transaction-failover/src/main/resources/activemq/server0/broker.xml
+++ b/examples/jms/transaction-failover/src/main/resources/activemq/server0/broker.xml
@@ -29,17 +29,19 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>../../data/messaging/bindings</bindings-directory>
+      <bindings-directory>../data/bindings</bindings-directory>
 
-      <journal-directory>../../data/messaging/journal</journal-directory>
+      <journal-directory>../data/journal</journal-directory>
 
-      <large-messages-directory>../../data/messaging/largemessages</large-messages-directory>
+      <large-messages-directory>../data/largemessages</large-messages-directory>
 
-      <paging-directory>../../data/messaging/paging</paging-directory>
+      <paging-directory>../data/paging</paging-directory>
 
       <ha-policy>
          <shared-store>
-            <master/>
+            <master>
+               <failover-on-shutdown>true</failover-on-shutdown>
+            </master>
          </shared-store>
       </ha-policy>
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/transaction-failover/src/main/resources/activemq/server1/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/transaction-failover/src/main/resources/activemq/server1/artemis-roles.properties b/examples/jms/transaction-failover/src/main/resources/activemq/server1/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/transaction-failover/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/transaction-failover/src/main/resources/activemq/server1/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/transaction-failover/src/main/resources/activemq/server1/artemis-users.properties b/examples/jms/transaction-failover/src/main/resources/activemq/server1/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/transaction-failover/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/transaction-failover/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/transaction-failover/src/main/resources/activemq/server1/broker.xml b/examples/jms/transaction-failover/src/main/resources/activemq/server1/broker.xml
index 62e5154..055f04a 100644
--- a/examples/jms/transaction-failover/src/main/resources/activemq/server1/broker.xml
+++ b/examples/jms/transaction-failover/src/main/resources/activemq/server1/broker.xml
@@ -29,17 +29,19 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>../../data/messaging/bindings</bindings-directory>
+      <bindings-directory>../data/bindings</bindings-directory>
 
-      <journal-directory>../../data/messaging/journal</journal-directory>
+      <journal-directory>../data/journal</journal-directory>
 
-      <large-messages-directory>../../data/messaging/largemessages</large-messages-directory>
+      <large-messages-directory>../data/largemessages</large-messages-directory>
 
-      <paging-directory>../../data/messaging/paging</paging-directory>
+      <paging-directory>../data/paging</paging-directory>
 
       <ha-policy>
          <shared-store>
-            <slave/>
+            <slave>
+               <failover-on-shutdown>true</failover-on-shutdown>
+            </slave>
          </shared-store>
       </ha-policy>
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/transactional/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/transactional/pom.xml b/examples/jms/transactional/pom.xml
index 7461ed6..9029124 100644
--- a/examples/jms/transactional/pom.xml
+++ b/examples/jms/transactional/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>
@@ -61,9 +56,18 @@ under the License.
                         <goals>
                            <goal>create</goal>
                         </goals>
+                     </execution>
+                     <execution>
+                        <id>start</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
                         <configuration>
-                           <instance>${basedir}/target/server0</instance>
-                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                           <spawn>true</spawn>
+                           <testURI>tcp://localhost:61616</testURI>
+                           <args>
+                              <param>run</param>
+                           </args>
                         </configuration>
                      </execution>
                      <execution>
@@ -73,8 +77,16 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.TransactionalExample</clientClass>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>stop</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
                            <args>
-                              <param>${basedir}/target/server0</param>
+                              <param>stop</param>
                            </args>
                         </configuration>
                      </execution>


[24/24] activemq-artemis git commit: This closes #97 examples updates

Posted by cl...@apache.org.
This closes #97 examples updates


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/661f695e
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/661f695e
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/661f695e

Branch: refs/heads/master
Commit: 661f695ee2ea541a37d4ad3548ee735c4547d38a
Parents: c8d053e 54d0d2b
Author: Clebert Suconic <cl...@apache.org>
Authored: Wed Jul 29 17:21:20 2015 -0400
Committer: Clebert Suconic <cl...@apache.org>
Committed: Wed Jul 29 17:21:20 2015 -0400

----------------------------------------------------------------------
 .../apache/activemq/artemis/cli/Artemis.java    |   6 +
 .../activemq/artemis/cli/commands/Create.java   |  44 ++-
 .../activemq/artemis/cli/commands/Run.java      |   2 +
 .../artemis/cli/process/ProcessBuilder.java     | 192 +++++++++++
 .../artemis/cli/process/package-info.java       |  19 ++
 .../activemq/artemis/util/ServerUtil.java       | 207 +++++++++++
 .../cli/commands/etc/replicated-settings.txt    |   2 +-
 .../cli/commands/etc/shared-store-settings.txt  |   4 +-
 .../src/main/resources/bin/artemis              |   2 +-
 .../jms/server/impl/JMSServerManagerImpl.java   |   3 +-
 artemis-maven-plugin/pom.xml                    |  20 ++
 .../activemq/artemis/maven/ActiveMQClient.java  |  22 --
 .../artemis/maven/ActiveMQClientPlugin.java     |  19 +-
 .../artemis/maven/ActiveMQCreatePlugin.java     | 342 +++++++++++++++++++
 .../artemis/maven/ActiveMQStartPlugin.java      | 230 -------------
 .../artemis/maven/ActiveMQStopPlugin.java       |  76 -----
 .../artemis/maven/ArtemisCLIPlugin.java         | 180 ++++++++++
 .../artemis/maven/InVMNodeManagerServer.java    |  75 ----
 .../artemis/maven/LibInstallPlugin.java         | 147 ++++++++
 .../activemq/artemis/maven/PluginUtil.java      |  50 ---
 .../artemis/maven/TestClusterManager.java       |  52 ---
 .../artemis/maven/TestClusterManagerMBean.java  |  29 --
 .../apache/activemq/artemis/maven/TestNode.java |  49 ---
 .../artemis/server/ActiveMQBootstrap.java       | 270 ---------------
 .../server/SpawnedActiveMQBootstrap.java        |  38 ---
 .../artemis/server/SpawnedVMSupport.java        | 252 --------------
 examples/core/embedded/pom.xml                  |   2 -
 examples/core/perf/pom.xml                      |  27 +-
 .../main/resources/activemq/server0/broker.xml  |  69 ++++
 .../hornetq-configuration-messaging-lab.xml     |  53 +++
 .../perf/src/main/resources/server0/broker.xml  |  67 ----
 .../hornetq-configuration-messaging-lab.xml     |  53 ---
 examples/core/vertx-connector/pom.xml           | 131 +++----
 .../main/resources/activemq/server0/broker.xml  |  81 +++++
 .../resources/server0/artemis-roles.properties  |  17 -
 .../resources/server0/artemis-users.properties  |  17 -
 .../src/main/resources/server0/broker.xml       |  81 -----
 examples/jms/aerogear/pom.xml                   | 109 +++---
 .../artemis/jms/example/AerogearExample.java    |  16 +-
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |  11 +-
 examples/jms/application-layer-failover/pom.xml |  81 +----
 .../ApplicationLayerFailoverExample.java        |  69 ++--
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |  53 ---
 .../activemq/server1/artemis-roles.properties   |  17 -
 .../activemq/server1/artemis-users.properties   |  17 -
 .../main/resources/activemq/server1/broker.xml  |  56 ---
 examples/jms/bridge/pom.xml                     | 116 +++----
 .../artemis/jms/example/BridgeExample.java      |  38 +--
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../activemq/server1/artemis-roles.properties   |  17 -
 .../activemq/server1/artemis-users.properties   |  17 -
 examples/jms/browser/pom.xml                    |  71 ++--
 .../jms/example/QueueBrowserExample.java        |  18 +-
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |  61 ----
 examples/jms/client-kickoff/pom.xml             |  90 ++---
 .../jms/example/ClientKickoffExample.java       |  28 +-
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 .../jms/client-side-failoverlistener/pom.xml    | 118 ++-----
 .../ClientSideFailoverListerExample.java        |  44 +--
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |  92 -----
 .../activemq/server1/artemis-roles.properties   |  17 -
 .../activemq/server1/artemis-users.properties   |  17 -
 .../main/resources/activemq/server1/broker.xml  |  93 -----
 examples/jms/client-side-load-balancing/pom.xml | 156 ++++-----
 .../example/ClientSideLoadBalancingExample.java |  17 +-
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |  92 -----
 .../activemq/server1/artemis-roles.properties   |  17 -
 .../activemq/server1/artemis-users.properties   |  17 -
 .../main/resources/activemq/server1/broker.xml  |  89 -----
 .../activemq/server2/artemis-roles.properties   |  17 -
 .../activemq/server2/artemis-users.properties   |  17 -
 .../main/resources/activemq/server2/broker.xml  |  87 -----
 .../jms/clustered-durable-subscription/pom.xml  | 122 +++----
 .../ClusteredDurableSubscriptionExample.java    |  22 +-
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 .../activemq/server1/artemis-roles.properties   |  17 -
 .../activemq/server1/artemis-users.properties   |  17 -
 .../main/resources/activemq/server1/broker.xml  |   9 +-
 examples/jms/clustered-grouping/pom.xml         | 168 ++++-----
 .../jms/example/ClusteredGroupingExample.java   |  23 +-
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 .../activemq/server1/artemis-roles.properties   |  17 -
 .../activemq/server1/artemis-users.properties   |  17 -
 .../main/resources/activemq/server1/broker.xml  |   8 +-
 .../activemq/server2/artemis-roles.properties   |  17 -
 .../activemq/server2/artemis-users.properties   |  17 -
 .../main/resources/activemq/server2/broker.xml  |   8 +-
 examples/jms/clustered-jgroups/pom.xml          | 121 +++----
 .../jms/example/ClusteredJgroupsExample.java    |  22 +-
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |   9 +-
 .../activemq/server0/test-jgroups-file_ping.xml |   3 +-
 .../activemq/server1/artemis-roles.properties   |  17 -
 .../activemq/server1/artemis-users.properties   |  17 -
 .../main/resources/activemq/server1/broker.xml  |   9 +-
 .../activemq/server1/test-jgroups-file_ping.xml |   3 +-
 examples/jms/clustered-queue/pom.xml            | 109 +++---
 .../jms/example/ClusteredQueueExample.java      |  22 +-
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |   9 +-
 .../activemq/server1/artemis-roles.properties   |  17 -
 .../activemq/server1/artemis-users.properties   |  17 -
 examples/jms/clustered-standalone/pom.xml       | 147 ++++----
 .../jms/example/ClusteredStandaloneExample.java |  32 +-
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |   9 +-
 .../activemq/server1/artemis-roles.properties   |  17 -
 .../activemq/server1/artemis-users.properties   |  17 -
 .../main/resources/activemq/server1/broker.xml  |   9 +-
 .../activemq/server2/artemis-roles.properties   |  17 -
 .../activemq/server2/artemis-users.properties   |  17 -
 .../main/resources/activemq/server2/broker.xml  |   9 +-
 examples/jms/clustered-static-discovery/pom.xml | 166 +++++----
 .../example/StaticClusteredQueueExample.java    |  30 +-
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |   9 +-
 .../activemq/server1/artemis-roles.properties   |  17 -
 .../activemq/server1/artemis-users.properties   |  17 -
 .../main/resources/activemq/server1/broker.xml  |   9 +-
 .../activemq/server2/artemis-roles.properties   |  17 -
 .../activemq/server2/artemis-users.properties   |  17 -
 .../main/resources/activemq/server2/broker.xml  |   9 +-
 .../activemq/server3/artemis-roles.properties   |  17 -
 .../activemq/server3/artemis-users.properties   |  17 -
 .../main/resources/activemq/server3/broker.xml  |   9 +-
 examples/jms/clustered-static-oneway/pom.xml    | 138 ++++----
 .../jms/example/ClusterStaticOnewayExample.java |  33 +-
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |   9 +-
 .../activemq/server1/artemis-roles.properties   |  17 -
 .../activemq/server1/artemis-users.properties   |  17 -
 .../main/resources/activemq/server1/broker.xml  |   9 +-
 .../activemq/server2/artemis-roles.properties   |  17 -
 .../activemq/server2/artemis-users.properties   |  17 -
 .../main/resources/activemq/server2/broker.xml  |   9 +-
 examples/jms/clustered-topic/pom.xml            | 129 +++----
 .../jms/example/ClusteredTopicExample.java      |  22 +-
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |   9 +-
 .../activemq/server1/artemis-roles.properties   |  17 -
 .../activemq/server1/artemis-users.properties   |  17 -
 .../main/resources/activemq/server1/broker.xml  |   9 +-
 .../jms/colocated-failover-scale-down/pom.xml   |  92 +----
 .../ColocatedFailoverScaleDownExample.java      |  40 ++-
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |  13 +-
 .../activemq/server1/artemis-roles.properties   |  17 -
 .../activemq/server1/artemis-users.properties   |  17 -
 .../main/resources/activemq/server1/broker.xml  |   9 +-
 examples/jms/colocated-failover/pom.xml         |  93 +----
 .../jms/example/ColocatedFailoverExample.java   |  45 +--
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |  13 +-
 .../activemq/server1/artemis-roles.properties   |  17 -
 .../activemq/server1/artemis-users.properties   |  17 -
 .../main/resources/activemq/server1/broker.xml  |   9 +-
 examples/jms/common/pom.xml                     |  60 ----
 .../artemis/common/example/ActiveMQExample.java | 224 ------------
 .../artemis/common/example/DummyXid.java        | 208 -----------
 examples/jms/consumer-rate-limit/pom.xml        |  68 +---
 examples/jms/consumer-rate-limit/readme.html    |  46 +--
 .../jms/example/ConsumerRateLimitExample.java   |  18 +-
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |  60 ----
 examples/jms/dead-letter/pom.xml                |  68 +---
 .../artemis/jms/example/DeadLetterExample.java  |  19 +-
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 examples/jms/delayed-redelivery/pom.xml         |  70 ++--
 .../jms/example/DelayedRedeliveryExample.java   |  27 +-
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 examples/jms/divert/pom.xml                     | 108 +++---
 .../artemis/jms/example/DivertExample.java      |  30 +-
 .../main/resources/activemq/server0/broker.xml  |  11 +-
 .../main/resources/activemq/server1/broker.xml  |   8 +-
 examples/jms/durable-subscription/pom.xml       |  68 +---
 .../jms/example/DurableSubscriptionExample.java |  14 +-
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 examples/jms/embedded-simple/pom.xml            |  49 ---
 .../artemis/jms/example/EmbeddedExample.java    | 110 +++---
 examples/jms/embedded/pom.xml                   |  49 ---
 .../artemis/jms/example/EmbeddedExample.java    | 151 ++++----
 examples/jms/expiry/pom.xml                     |  68 +---
 .../artemis/jms/example/ExpiryExample.java      |  15 +-
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 examples/jms/ha-policy-autobackup/pom.xml       |  92 +----
 .../jms/example/HAPolicyAutoBackupExample.java  |  53 ++-
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 .../activemq/server1/artemis-roles.properties   |  17 -
 .../activemq/server1/artemis-users.properties   |  17 -
 .../main/resources/activemq/server1/broker.xml  |   8 +-
 examples/jms/http-transport/pom.xml             |  74 +---
 .../jms/example/HttpTransportExample.java       |  15 +-
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 .../jms/instantiate-connection-factory/pom.xml  |  68 +---
 .../InstantiateConnectionFactoryExample.java    |  21 +-
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |  60 ----
 examples/jms/interceptor/pom.xml                |  70 ++--
 .../artemis/jms/example/InterceptorExample.java |  23 +-
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 examples/jms/jms-auto-closeable/pom.xml         |  65 +---
 .../jms/example/JMSAutoCloseableExample.java    |  21 +-
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |  59 ----
 examples/jms/jms-bridge/pom.xml                 | 113 +++---
 .../artemis/jms/example/JMSBridgeExample.java   |  63 ++--
 .../main/resources/activemq/server0/broker.xml  |  10 +-
 .../main/resources/activemq/server1/broker.xml  |  12 +-
 examples/jms/jms-completion-listener/pom.xml    |  67 ++--
 .../example/JMSCompletionListenerExample.java   |  19 +-
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |  60 ----
 examples/jms/jms-context/pom.xml                |  65 +---
 .../artemis/jms/example/JMSContextExample.java  |  15 +-
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |  60 ----
 examples/jms/jms-shared-consumer/pom.xml        |  68 +---
 .../jms/example/JMSSharedConsumerExample.java   |  17 +-
 .../main/resources/activemq/server0/broker.xml  |  11 +-
 examples/jms/jmx/pom.xml                        |  91 ++---
 .../artemis/jms/example/JMXExample.java         |  16 +-
 examples/jms/large-message/pom.xml              |  67 +---
 .../jms/example/LargeMessageExample.java        |  49 ++-
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |  60 ----
 examples/jms/last-value-queue/pom.xml           |  67 ++--
 .../jms/example/LastValueQueueExample.java      |  15 +-
 examples/jms/management-notifications/pom.xml   |  67 ++--
 .../example/ManagementNotificationExample.java  |  14 +-
 examples/jms/management/pom.xml                 |  64 ++--
 .../artemis/jms/example/ManagementExample.java  |  13 +-
 examples/jms/message-counters/pom.xml           |  87 ++---
 .../jms/example/MessageCounterExample.java      |  17 +-
 examples/jms/message-group/pom.xml              |  67 ++--
 .../jms/example/MessageGroupExample.java        |  63 ++--
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |  60 ----
 examples/jms/message-group2/pom.xml             |  65 +---
 .../jms/example/MessageGroup2Example.java       |  65 ++--
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |  60 ----
 examples/jms/message-priority/pom.xml           |  67 ++--
 .../jms/example/MessagePriorityExample.java     |  72 ++--
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |  60 ----
 examples/jms/multiple-failover-failback/pom.xml | 144 ++------
 .../MultipleFailoverFailbackExample.java        |  34 +-
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |  93 -----
 .../activemq/server1/artemis-roles.properties   |  17 -
 .../activemq/server1/artemis-users.properties   |  17 -
 .../main/resources/activemq/server1/broker.xml  |  93 -----
 .../activemq/server2/artemis-roles.properties   |  17 -
 .../activemq/server2/artemis-users.properties   |  17 -
 .../main/resources/activemq/server2/broker.xml  |  94 -----
 examples/jms/multiple-failover/pom.xml          | 142 ++------
 .../jms/example/MultipleFailoverExample.java    |  36 +-
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |  95 ------
 .../activemq/server1/artemis-roles.properties   |  17 -
 .../activemq/server1/artemis-users.properties   |  17 -
 .../main/resources/activemq/server1/broker.xml  |  93 -----
 .../activemq/server2/artemis-roles.properties   |  17 -
 .../activemq/server2/artemis-users.properties   |  17 -
 .../main/resources/activemq/server2/broker.xml  |  93 -----
 examples/jms/no-consumer-buffering/pom.xml      |  66 +---
 .../jms/example/NoConsumerBufferingExample.java |  15 +-
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |  60 ----
 examples/jms/non-transaction-failover/pom.xml   | 112 ++----
 .../example/NonTransactionFailoverExample.java  |  32 +-
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |  93 -----
 .../activemq/server1/artemis-roles.properties   |  17 -
 .../activemq/server1/artemis-users.properties   |  17 -
 .../main/resources/activemq/server1/broker.xml  |  94 -----
 examples/jms/openwire/pom.xml                   |  93 ++---
 .../artemis/jms/example/OpenWireExample.java    |  15 +-
 .../main/resources/activemq/server0/broker.xml  |   4 +-
 examples/jms/paging/pom.xml                     |  65 +---
 .../artemis/jms/example/PagingExample.java      |  16 +-
 examples/jms/perf/pom.xml                       | 103 +++---
 .../activemq/artemis/jms/example/Server.java    |  28 ++
 .../jms/perf/src/main/resources/perf.properties |   6 +-
 examples/jms/pom.xml                            |  24 +-
 examples/jms/pre-acknowledge/pom.xml            |  67 ++--
 .../jms/example/PreacknowledgeExample.java      |  17 +-
 examples/jms/producer-rate-limit/pom.xml        |  65 +---
 .../jms/example/ProducerRateLimitExample.java   |  15 +-
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |  60 ----
 examples/jms/proton-cpp/pom.xml                 |  70 ++--
 .../artemis/jms/example/ProtonCPPExample.java   |  16 +-
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |  61 ----
 examples/jms/proton-j/pom.xml                   |  73 +---
 .../artemis/jms/example/ProtonJExample.java     |  12 +-
 .../main/resources/activemq/server0/broker.xml  |   1 +
 examples/jms/proton-ruby/pom.xml                |  60 +---
 examples/jms/proton-ruby/readme.html            |   3 +-
 .../jms/queue-message-redistribution/pom.xml    | 129 +++----
 .../QueueMessageRedistributionExample.java      |  22 +-
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |   9 +-
 .../activemq/server1/artemis-roles.properties   |  17 -
 .../activemq/server1/artemis-users.properties   |  17 -
 .../main/resources/activemq/server1/broker.xml  |   9 +-
 examples/jms/queue-requestor/pom.xml            |  65 +---
 .../jms/example/QueueRequestorExample.java      |  14 +-
 examples/jms/queue-selector/pom.xml             |  65 +---
 .../jms/example/QueueSelectorExample.java       |  99 +++---
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |  59 ----
 examples/jms/queue/pom.xml                      |  66 +---
 examples/jms/queue/readme.html                  |   1 +
 .../artemis/jms/example/QueueExample.java       |  14 +-
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |  60 ----
 examples/jms/reattach-node/pom.xml              |  77 ++---
 .../artemis/jms/example/ReattachExample.java    |  19 +-
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 examples/jms/replicated-failback-static/pom.xml | 109 +-----
 .../ReplicatedFailbackStaticExample.java        |  34 +-
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 .../activemq/server1/artemis-roles.properties   |  17 -
 .../activemq/server1/artemis-users.properties   |  17 -
 .../main/resources/activemq/server1/broker.xml  |   8 +-
 examples/jms/replicated-failback/pom.xml        | 109 +-----
 .../jms/example/ReplicatedFailbackExample.java  |  34 +-
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |  10 +-
 .../activemq/server1/artemis-roles.properties   |  17 -
 .../activemq/server1/artemis-users.properties   |  17 -
 .../main/resources/activemq/server1/broker.xml  |  10 +-
 .../jms/replicated-multiple-failover/pom.xml    | 137 ++------
 .../ReplicatedMultipleFailoverExample.java      |  38 ++-
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 .../activemq/server1/artemis-roles.properties   |  17 -
 .../activemq/server1/artemis-users.properties   |  17 -
 .../main/resources/activemq/server1/broker.xml  |   8 +-
 .../activemq/server2/artemis-roles.properties   |  17 -
 .../activemq/server2/artemis-users.properties   |  17 -
 .../main/resources/activemq/server2/broker.xml  |   9 +-
 .../jms/replicated-transaction-failover/pom.xml | 109 +-----
 .../ReplicatedTransactionFailoverExample.java   |  40 +--
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 .../activemq/server1/artemis-roles.properties   |  17 -
 .../activemq/server1/artemis-users.properties   |  17 -
 .../main/resources/activemq/server1/broker.xml  |   8 +-
 examples/jms/request-reply/pom.xml              |  66 +---
 .../jms/example/RequestReplyExample.java        | 114 +++----
 examples/jms/scale-down/pom.xml                 |  94 +----
 .../artemis/jms/example/ScaleDownExample.java   |  37 +-
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |   9 +-
 .../activemq/server1/artemis-roles.properties   |  17 -
 .../activemq/server1/artemis-users.properties   |  17 -
 .../main/resources/activemq/server1/broker.xml  |   9 +-
 examples/jms/scheduled-message/pom.xml          |  64 ++--
 .../jms/example/ScheduledMessageExample.java    |  14 +-
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |  60 ----
 examples/jms/security/pom.xml                   |  67 ++--
 .../artemis/jms/example/SecurityExample.java    |  48 ++-
 examples/jms/send-acknowledgements/pom.xml      |  64 ++--
 .../example/SendAcknowledgementsExample.java    |  14 +-
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |  60 ----
 examples/jms/spring-integration/pom.xml         |  39 ---
 examples/jms/ssl-enabled/pom.xml                |  65 +---
 .../artemis/jms/example/SSLExample.java         |  15 +-
 examples/jms/static-selector-jms/pom.xml        |  70 +---
 .../jms/example/StaticSelectorJMSExample.java   |  74 ++--
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 examples/jms/static-selector/pom.xml            |  65 +---
 .../jms/example/StaticSelectorExample.java      |  75 ++--
 examples/jms/stomp-websockets/pom.xml           |  82 +----
 .../jms/example/StompWebSocketExample.java      |  14 +-
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 examples/jms/stomp/pom.xml                      |  70 +---
 .../artemis/jms/example/StompExample.java       |  37 +-
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 examples/jms/stomp1.1/pom.xml                   |  70 +---
 .../artemis/jms/example/StompExample.java       |  40 +--
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 examples/jms/stomp1.2/pom.xml                   |  70 +---
 .../artemis/jms/example/StompExample.java       |  42 +--
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 examples/jms/stop-server-failover/pom.xml       | 135 +++-----
 .../jms/example/StopServerFailoverExample.java  |  20 +-
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |  94 -----
 .../activemq/server1/artemis-roles.properties   |  17 -
 .../activemq/server1/artemis-users.properties   |  17 -
 .../main/resources/activemq/server1/broker.xml  |  94 -----
 examples/jms/symmetric-cluster/pom.xml          | 290 ++++++++--------
 .../jms/example/SymmetricClusterExample.java    |  39 +--
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |   9 +-
 .../activemq/server1/artemis-roles.properties   |  17 -
 .../activemq/server1/artemis-users.properties   |  17 -
 .../main/resources/activemq/server1/broker.xml  |   9 +-
 .../activemq/server2/artemis-roles.properties   |  17 -
 .../activemq/server2/artemis-users.properties   |  17 -
 .../main/resources/activemq/server2/broker.xml  |   9 +-
 .../activemq/server3/artemis-roles.properties   |  17 -
 .../activemq/server3/artemis-users.properties   |  17 -
 .../main/resources/activemq/server3/broker.xml  |   9 +-
 .../activemq/server4/artemis-roles.properties   |  17 -
 .../activemq/server4/artemis-users.properties   |  17 -
 .../main/resources/activemq/server4/broker.xml  |   9 +-
 .../activemq/server5/artemis-roles.properties   |  17 -
 .../activemq/server5/artemis-users.properties   |  17 -
 .../main/resources/activemq/server5/broker.xml  |  13 +-
 examples/jms/temp-queue/pom.xml                 |  65 +---
 .../jms/example/TemporaryQueueExample.java      |  14 +-
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |  17 +-
 examples/jms/topic-hierarchies/pom.xml          |  64 ++--
 .../jms/example/TopicHierarchyExample.java      |  16 +-
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 examples/jms/topic-selector-example1/pom.xml    |  65 +---
 .../jms/example/TopicSelectorExample1.java      |  31 +-
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 examples/jms/topic-selector-example2/pom.xml    |  65 +---
 .../jms/example/TopicSelectorExample2.java      | 100 +++---
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 examples/jms/topic/pom.xml                      |  69 +---
 .../artemis/jms/example/TopicExample.java       |  14 +-
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |   9 +-
 examples/jms/transaction-failover/pom.xml       | 108 +-----
 .../jms/example/TransactionFailoverExample.java |  40 +--
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |  12 +-
 .../activemq/server1/artemis-roles.properties   |  17 -
 .../activemq/server1/artemis-users.properties   |  17 -
 .../main/resources/activemq/server1/broker.xml  |  12 +-
 examples/jms/transactional/pom.xml              |  65 +---
 .../jms/example/TransactionalExample.java       |  17 +-
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |  60 ----
 examples/jms/xa-heuristic/pom.xml               |  92 ++---
 .../activemq/artemis/jms/example/DummyXid.java  | 208 +++++++++++
 .../artemis/jms/example/XAHeuristicExample.java |  94 +++--
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |  60 ----
 examples/jms/xa-receive/pom.xml                 |  65 ++--
 .../activemq/artemis/jms/example/DummyXid.java  | 208 +++++++++++
 .../artemis/jms/example/XAReceiveExample.java   |  33 +-
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |  60 ----
 examples/jms/xa-send/pom.xml                    |  65 ++--
 .../activemq/artemis/jms/example/DummyXid.java  | 208 +++++++++++
 .../artemis/jms/example/XASendExample.java      |  93 +++--
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |  60 ----
 examples/soak/normal/README                     |  21 +-
 examples/soak/normal/pom.xml                    | 125 +++----
 examples/soak/normal/server0/broker.xml         |   5 +-
 .../artemis/jms/soak/example/SoakReceiver.java  |  31 +-
 .../artemis/jms/soak/example/SoakSender.java    |  27 +-
 .../normal/src/main/resources/jndi.properties   |  20 ++
 539 files changed, 6019 insertions(+), 16004 deletions(-)
----------------------------------------------------------------------



[14/24] activemq-artemis git commit: ARTEMIS-178 Refactor examples to use CLI

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/topic-selector-example1/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/topic-selector-example1/pom.xml b/examples/jms/topic-selector-example1/pom.xml
index 7b5cafb..7526dd5 100644
--- a/examples/jms/topic-selector-example1/pom.xml
+++ b/examples/jms/topic-selector-example1/pom.xml
@@ -57,17 +57,13 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
                         </configuration>
                      </execution>
                      <execution>
@@ -77,14 +73,11 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.TopicSelectorExample1</clientClass>
+                           <args>
+                              <param>${basedir}/target/server0</param>
+                           </args>
                         </configuration>
                      </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                     </execution>
                   </executions>
                   <dependencies>
                      <dependency>
@@ -92,41 +85,7 @@ under the License.
                         <artifactId>artemis-jms-topic-selector-example1-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                  </configuration>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/topic-selector-example2/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/topic-selector-example2/pom.xml b/examples/jms/topic-selector-example2/pom.xml
index dab3620..320d13c 100644
--- a/examples/jms/topic-selector-example2/pom.xml
+++ b/examples/jms/topic-selector-example2/pom.xml
@@ -57,17 +57,13 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
                         </configuration>
                      </execution>
                      <execution>
@@ -77,14 +73,11 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.TopicSelectorExample2</clientClass>
+                           <args>
+                              <param>${basedir}/target/server0</param>
+                           </args>
                         </configuration>
                      </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                     </execution>
                   </executions>
                   <dependencies>
                      <dependency>
@@ -92,41 +85,7 @@ under the License.
                         <artifactId>artemis-jms-topic-selector-example2-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                  </configuration>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/topic/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/topic/pom.xml b/examples/jms/topic/pom.xml
index 3563009..0fe39ff 100644
--- a/examples/jms/topic/pom.xml
+++ b/examples/jms/topic/pom.xml
@@ -56,17 +56,13 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
                         </configuration>
                      </execution>
                      <execution>
@@ -77,16 +73,10 @@ under the License.
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.TopicExample</clientClass>
                            <args>
-                              <param>tcp://localhost:61616</param>
+                              <param>${basedir}/target/server0</param>
                            </args>
                         </configuration>
                      </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                     </execution>
                   </executions>
                   <dependencies>
                      <dependency>
@@ -94,41 +84,7 @@ under the License.
                         <artifactId>artemis-jms-topic-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                  </configuration>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/transaction-failover/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/transaction-failover/pom.xml b/examples/jms/transaction-failover/pom.xml
index d61bcd8..f954478 100644
--- a/examples/jms/transaction-failover/pom.xml
+++ b/examples/jms/transaction-failover/pom.xml
@@ -57,42 +57,25 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start0</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                              <property>
-                                 <name>udp-address</name>
-                                 <value>${udp-address}</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                           <javaOptions>-Dudp-address=${udp-address}</javaOptions>
                         </configuration>
                      </execution>
                      <execution>
-                        <id>start1</id>
+                        <id>create2</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
-                           <fork>true</fork>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                              <property>
-                                 <name>udp-address</name>
-                                 <value>${udp-address}</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server1</instance>
+                           <configuration>${basedir}/target/classes/activemq/server1</configuration>
+                           <javaOptions>-Dudp-address=${udp-address}</javaOptions>
                         </configuration>
                      </execution>
                      <execution>
@@ -102,30 +85,10 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.TransactionFailoverExample</clientClass>
-                           <systemProperties>
-                              <property>
-                                 <name>exampleConfigDir</name>
-                                 <value>${basedir}/target/classes/activemq</value>
-                              </property>
-                           </systemProperties>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop0</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop1</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
+                           <args>
+                              <param>${basedir}/target/server0</param>
+                              <param>${basedir}/target/server1</param>
+                           </args>
                         </configuration>
                      </execution>
                   </executions>
@@ -135,46 +98,7 @@ under the License.
                         <artifactId>artemis-jms-transaction-failover-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <systemProperties>
-                        <property>
-                           <name>data.dir</name>
-                           <value>${basedir}/target/</value>
-                        </property>
-                     </systemProperties>
-                  </configuration>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/transaction-failover/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/transaction-failover/src/main/resources/activemq/server0/broker.xml b/examples/jms/transaction-failover/src/main/resources/activemq/server0/broker.xml
index 1041aca..74a66d4 100644
--- a/examples/jms/transaction-failover/src/main/resources/activemq/server0/broker.xml
+++ b/examples/jms/transaction-failover/src/main/resources/activemq/server0/broker.xml
@@ -29,13 +29,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
+      <bindings-directory>../../data/messaging/bindings</bindings-directory>
 
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
+      <journal-directory>../../data/messaging/journal</journal-directory>
 
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
+      <large-messages-directory>../../data/messaging/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
+      <paging-directory>../../data/messaging/paging</paging-directory>
 
       <ha-policy>
          <shared-store>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/transaction-failover/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/transaction-failover/src/main/resources/activemq/server1/broker.xml b/examples/jms/transaction-failover/src/main/resources/activemq/server1/broker.xml
index 27f33f6..62e5154 100644
--- a/examples/jms/transaction-failover/src/main/resources/activemq/server1/broker.xml
+++ b/examples/jms/transaction-failover/src/main/resources/activemq/server1/broker.xml
@@ -29,13 +29,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
+      <bindings-directory>../../data/messaging/bindings</bindings-directory>
 
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
+      <journal-directory>../../data/messaging/journal</journal-directory>
 
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
+      <large-messages-directory>../../data/messaging/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
+      <paging-directory>../../data/messaging/paging</paging-directory>
 
       <ha-policy>
          <shared-store>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/transactional/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/transactional/pom.xml b/examples/jms/transactional/pom.xml
index e7a629b..7461ed6 100644
--- a/examples/jms/transactional/pom.xml
+++ b/examples/jms/transactional/pom.xml
@@ -57,17 +57,13 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
                         </configuration>
                      </execution>
                      <execution>
@@ -77,14 +73,11 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.TransactionalExample</clientClass>
+                           <args>
+                              <param>${basedir}/target/server0</param>
+                           </args>
                         </configuration>
                      </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                     </execution>
                   </executions>
                   <dependencies>
                      <dependency>
@@ -92,41 +85,7 @@ under the License.
                         <artifactId>artemis-jms-transactional-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                  </configuration>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/xa-heuristic/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/xa-heuristic/pom.xml b/examples/jms/xa-heuristic/pom.xml
index 125bee7..da401e3 100644
--- a/examples/jms/xa-heuristic/pom.xml
+++ b/examples/jms/xa-heuristic/pom.xml
@@ -57,35 +57,14 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <!--we need to fork the server as we have system props that need set pre runtime-->
-                           <fork>true</fork>
-                           <systemProperties>
-                              <property>
-                                 <name>com.sun.management.jmxremote</name>
-                                 <value />
-                              </property>
-                              <property>
-                                 <name>com.sun.management.jmxremote.port</name>
-                                 <value>3001</value>
-                              </property>
-                              <property>
-                                 <name>com.sun.management.jmxremote.ssl</name>
-                                 <value>false</value>
-                              </property>
-                              <property>
-                                 <name>com.sun.management.jmxremote.authenticate</name>
-                                 <value>false</value>
-                              </property>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                           <javaOptions>-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=3001 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false</javaOptions>
                         </configuration>
                      </execution>
                      <execution>
@@ -95,14 +74,11 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.XAHeuristicExample</clientClass>
+                           <args>
+                              <param>${basedir}/target/server0</param>
+                           </args>
                         </configuration>
                      </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                     </execution>
                   </executions>
                   <dependencies>
                      <dependency>
@@ -110,45 +86,11 @@ under the License.
                         <artifactId>artemis-jms-xa-heuristic-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                  </configuration>
                </plugin>
             </plugins>
          </build>
-
       </profile>
    </profiles>
+
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/xa-heuristic/src/main/java/org/apache/activemq/artemis/jms/example/XAHeuristicExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/xa-heuristic/src/main/java/org/apache/activemq/artemis/jms/example/XAHeuristicExample.java b/examples/jms/xa-heuristic/src/main/java/org/apache/activemq/artemis/jms/example/XAHeuristicExample.java
index 0cacdb2..09232e3 100644
--- a/examples/jms/xa-heuristic/src/main/java/org/apache/activemq/artemis/jms/example/XAHeuristicExample.java
+++ b/examples/jms/xa-heuristic/src/main/java/org/apache/activemq/artemis/jms/example/XAHeuristicExample.java
@@ -16,10 +16,6 @@
  */
 package org.apache.activemq.artemis.jms.example;
 
-import java.nio.charset.StandardCharsets;
-import java.util.ArrayList;
-import java.util.HashMap;
-
 import javax.jms.JMSException;
 import javax.jms.Message;
 import javax.jms.MessageConsumer;
@@ -39,10 +35,13 @@ import javax.management.remote.JMXServiceURL;
 import javax.naming.InitialContext;
 import javax.transaction.xa.XAResource;
 import javax.transaction.xa.Xid;
+import java.nio.charset.StandardCharsets;
+import java.util.ArrayList;
+import java.util.HashMap;
 
 import org.apache.activemq.artemis.api.core.management.ObjectNameBuilder;
-import org.apache.activemq.artemis.common.example.DummyXid;
 import org.apache.activemq.artemis.common.example.ActiveMQExample;
+import org.apache.activemq.artemis.common.example.DummyXid;
 import org.apache.activemq.artemis.utils.UUIDGenerator;
 
 /**
@@ -104,8 +103,7 @@ public class XAHeuristicExample extends ActiveMQExample
          TextMessage worldMessage = session.createTextMessage("world");
 
          // Step 12. create a transaction
-         Xid xid1 =
-                  new DummyXid("xa-example1".getBytes(StandardCharsets.ISO_8859_1), 1, UUIDGenerator.getInstance()
+         Xid xid1 = new DummyXid("xa-example1".getBytes(StandardCharsets.ISO_8859_1), 1, UUIDGenerator.getInstance()
                                                                            .generateStringUUID()
                                                                            .getBytes());
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/xa-receive/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/xa-receive/pom.xml b/examples/jms/xa-receive/pom.xml
index b3d6c6e..5fa068a 100644
--- a/examples/jms/xa-receive/pom.xml
+++ b/examples/jms/xa-receive/pom.xml
@@ -57,17 +57,13 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
                         </configuration>
                      </execution>
                      <execution>
@@ -76,15 +72,12 @@ under the License.
                            <goal>runClient</goal>
                         </goals>
                         <configuration>
-                           <clientClass>org.apache.activemq.artemis.jms.example.XAReceiveExample</clientClass>
+                           <clientClass>org.apache.activemq.artemis.jms.example.TransactionalExample</clientClass>
+                           <args>
+                              <param>${basedir}/target/server0</param>
+                           </args>
                         </configuration>
                      </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                     </execution>
                   </executions>
                   <dependencies>
                      <dependency>
@@ -92,45 +85,12 @@ under the License.
                         <artifactId>artemis-jms-xa-receive-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                  </configuration>
                </plugin>
             </plugins>
          </build>
       </profile>
    </profiles>
 
+
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/xa-receive/src/main/java/org/apache/activemq/artemis/jms/example/XAReceiveExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/xa-receive/src/main/java/org/apache/activemq/artemis/jms/example/XAReceiveExample.java b/examples/jms/xa-receive/src/main/java/org/apache/activemq/artemis/jms/example/XAReceiveExample.java
index b624081..2671e54 100644
--- a/examples/jms/xa-receive/src/main/java/org/apache/activemq/artemis/jms/example/XAReceiveExample.java
+++ b/examples/jms/xa-receive/src/main/java/org/apache/activemq/artemis/jms/example/XAReceiveExample.java
@@ -16,8 +16,6 @@
  */
 package org.apache.activemq.artemis.jms.example;
 
-import java.nio.charset.StandardCharsets;
-
 import javax.jms.MessageConsumer;
 import javax.jms.MessageProducer;
 import javax.jms.Queue;
@@ -29,9 +27,12 @@ import javax.jms.XASession;
 import javax.naming.InitialContext;
 import javax.transaction.xa.XAResource;
 import javax.transaction.xa.Xid;
+import java.nio.charset.StandardCharsets;
 
-import org.apache.activemq.artemis.common.example.DummyXid;
 import org.apache.activemq.artemis.common.example.ActiveMQExample;
+
+// Defined on xa-heuristic example, the maven dependency will take care of that
+import org.apache.activemq.artemis.common.example.DummyXid;
 import org.apache.activemq.artemis.utils.UUIDGenerator;
 
 /**
@@ -88,8 +89,7 @@ public class XAReceiveExample extends ActiveMQExample
          TextMessage worldMessage = session.createTextMessage("world");
 
          // Step 12. create a transaction
-         Xid xid1 =
-                  new DummyXid("xa-example1".getBytes(StandardCharsets.US_ASCII), 1, UUIDGenerator.getInstance()
+         Xid xid1 = new DummyXid("xa-example1".getBytes(StandardCharsets.US_ASCII), 1, UUIDGenerator.getInstance()
                                                                            .generateStringUUID()
                                                                            .getBytes());
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/xa-send/src/main/java/org/apache/activemq/artemis/jms/example/XASendExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/xa-send/src/main/java/org/apache/activemq/artemis/jms/example/XASendExample.java b/examples/jms/xa-send/src/main/java/org/apache/activemq/artemis/jms/example/XASendExample.java
index 556fb12..447fbc4 100644
--- a/examples/jms/xa-send/src/main/java/org/apache/activemq/artemis/jms/example/XASendExample.java
+++ b/examples/jms/xa-send/src/main/java/org/apache/activemq/artemis/jms/example/XASendExample.java
@@ -16,9 +16,6 @@
  */
 package org.apache.activemq.artemis.jms.example;
 
-import java.nio.charset.StandardCharsets;
-import java.util.ArrayList;
-
 import javax.jms.JMSException;
 import javax.jms.Message;
 import javax.jms.MessageConsumer;
@@ -33,9 +30,11 @@ import javax.jms.XASession;
 import javax.naming.InitialContext;
 import javax.transaction.xa.XAResource;
 import javax.transaction.xa.Xid;
+import java.nio.charset.StandardCharsets;
+import java.util.ArrayList;
 
-import org.apache.activemq.artemis.common.example.DummyXid;
 import org.apache.activemq.artemis.common.example.ActiveMQExample;
+import org.apache.activemq.artemis.common.example.DummyXid;
 import org.apache.activemq.artemis.utils.UUIDGenerator;
 
 /**
@@ -95,8 +94,7 @@ public class XASendExample extends ActiveMQExample
          TextMessage worldMessage = session.createTextMessage("world");
 
          // Step 12. create a transaction
-         Xid xid1 =
-                  new DummyXid("xa-example1".getBytes(StandardCharsets.UTF_8), 1, UUIDGenerator.getInstance()
+         Xid xid1 = new DummyXid("xa-example1".getBytes(StandardCharsets.UTF_8), 1, UUIDGenerator.getInstance()
                                                                            .generateStringUUID()
                                                                            .getBytes());
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/soak/normal/README
----------------------------------------------------------------------
diff --git a/examples/soak/normal/README b/examples/soak/normal/README
index 54ec245..b69a1ac 100644
--- a/examples/soak/normal/README
+++ b/examples/soak/normal/README
@@ -5,22 +5,18 @@
 Running the Soak Tests
 =======================
 
-The default soak tests with start a ActiveMQ Artemis instance, 1 producer and 1 consumer.  To run the default suite.
-
-  $mvn verify
-
 Run The Server Standalone
 ==========================
 
-If would like to run a number of servers or run the server on a different machine:
+Use the Profile server
+   mvn -Pserver verify
+
+That will create a server under ./target/server0
 
-To run server using the default configuration (server0, using localhost):
-   $ mvn verify -Pserver
 
-To run multiple servers, you can specify the server configuration directory using server.dir 
-system property (which defaults to server0). To run a 2nd server with a configuration stored in server1:
+You can define the property server.dir under the same Profile to create other servers. or you could do it manually if desired using the regular ./artemis create
 
-   $ mvn verify -Pserver -Dserver.dir=server1
+   $ mvn -Dserver.dir=server1 -Pserver verify
 
 server1 should contain a copy of configuration equivalent to that found under the server0 director with different
 settings.
@@ -32,6 +28,9 @@ change:
 
   $ mvn verify -P server
 
+
+To run the server just start it manually
+
 Configure Server Dump
 =====================
 
@@ -61,7 +60,7 @@ The clients can be run separate from the server using:
 
 Parameters are specified in soak.properties.
 
-The duration of the tests is configured by duration-in-minutes (defaults to 2 minutes, set to 
+The duration of the tests is configured by duration-in-minutes (defaults to 2 minutes, set to
 -1 to run the test indefinitely).
 
 To configure the soak properties different to the defaults for the clients, use the system property

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/soak/normal/pom.xml
----------------------------------------------------------------------
diff --git a/examples/soak/normal/pom.xml b/examples/soak/normal/pom.xml
index e35be5a..61d7866 100644
--- a/examples/soak/normal/pom.xml
+++ b/examples/soak/normal/pom.xml
@@ -44,49 +44,9 @@ under the License.
       <activemq.basedir>${project.basedir}/../../..</activemq.basedir>
    </properties>
 
-   <build>
-      <plugins>
-         <plugin>
-            <groupId>org.apache.activemq</groupId>
-            <artifactId>artemis-maven-plugin</artifactId>
-            <dependencies>
-               <dependency>
-                  <groupId>org.apache.activemq.example.soak</groupId>
-                  <artifactId>artemis-jms-soak-example</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-               <dependency>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-server</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-               <dependency>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-jms-server</artifactId>
-                  <version>${project.version}</version>
-               </dependency>
-               <dependency>
-                  <groupId>io.netty</groupId>
-                  <artifactId>netty-all</artifactId>
-                  <version>${netty.version}</version>
-               </dependency>
-            </dependencies>
-            <configuration>
-               <waitOnStart>false</waitOnStart>
-               <systemProperties>
-                  <property>
-                     <name>build.directory</name>
-                     <value>${basedir}/target/</value>
-                  </property>
-               </systemProperties>
-            </configuration>
-         </plugin>
-      </plugins>
-   </build>
-
    <profiles>
       <profile>
-         <id>local</id>
+         <id>server</id>
          <build>
             <plugins>
                <plugin>
@@ -94,15 +54,35 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <fork>true</fork>
-                           <configurationDir>${server.dir}</configurationDir>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/server0</configuration>
                         </configuration>
                      </execution>
+                  </executions>
+                  <dependencies>
+                     <dependency>
+                        <groupId>org.apache.activemq.examples.soak</groupId>
+                        <artifactId>artemis-jms-soak-example</artifactId>
+                        <version>${project.version}</version>
+                     </dependency>
+                  </dependencies>
+               </plugin>
+            </plugins>
+         </build>
+      </profile>
+      <profile>
+         <id>local</id>
+         <build>
+            <plugins>
+               <plugin>
+                  <groupId>org.apache.activemq</groupId>
+                  <artifactId>artemis-maven-plugin</artifactId>
+                  <executions>
                      <execution>
                         <id>runConsumer</id>
                         <goals>
@@ -110,9 +90,6 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.soak.example.SoakReceiver</clientClass>
-                           <args>
-                              <param>tcp://localhost:61616</param>
-                           </args>
                         </configuration>
                      </execution>
                      <execution>
@@ -122,21 +99,16 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.soak.example.SoakSender</clientClass>
-                           <args>
-                              <param>tcp://localhost:61616</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${server.dir}</configurationDir>
                         </configuration>
                      </execution>
                   </executions>
+                  <dependencies>
+                     <dependency>
+                        <groupId>org.apache.activemq.examples.soak</groupId>
+                        <artifactId>artemis-jms-soak-example</artifactId>
+                        <version>${project.version}</version>
+                     </dependency>
+                  </dependencies>
                </plugin>
             </plugins>
          </build>
@@ -174,34 +146,17 @@ under the License.
                         </configuration>
                      </execution>
                   </executions>
+                  <dependencies>
+                     <dependency>
+                        <groupId>org.apache.activemq.example.soak</groupId>
+                        <artifactId>artemis-jms-soak-example</artifactId>
+                        <version>${project.version}</version>
+                     </dependency>
+                  </dependencies>
                </plugin>
             </plugins>
          </build>
       </profile>
-      <profile>
-         <id>server</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>start</id>
-                        <goals>
-                           <goal>start</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${server.dir}</configurationDir>
-                           <fork>true</fork>
-                           <waitOnStart>true</waitOnStart>
-                        </configuration>
-                     </execution>
-                  </executions>
-               </plugin>
-            </plugins>
-         </build>
-      </profile>
-   </profiles>
 
+   </profiles>
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/soak/normal/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/soak/normal/server0/broker.xml b/examples/soak/normal/server0/broker.xml
index 7f1f435..76df21f 100644
--- a/examples/soak/normal/server0/broker.xml
+++ b/examples/soak/normal/server0/broker.xml
@@ -17,7 +17,6 @@ KIND, either express or implied.  See the License for the
 specific language governing permissions and limitations
 under the License.
 -->
-
 <configuration xmlns="urn:activemq"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="urn:activemq /schema/artemis-server.xsd">
@@ -26,12 +25,12 @@ under the License.
    </jms>
    <core xmlns="urn:activemq:core">
       <connectors>
-         <connector name="netty-connector">tcp://localhost:61616?tcpNoDelay=false;tcpSendBufferSize=1048576?tcpReceiveBufferSize=1048576</connector>
+         <connector name="netty-connector">tcp://localhost:61616?tcpNoDelay=false;tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576</connector>
       </connectors>
 
       <!-- Acceptors -->
       <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61616?tcpNoDelay=false;tcpSendBufferSize=1048576?tcpReceiveBufferSize=1048576 </acceptor>
+         <acceptor name="netty-acceptor">tcp://localhost:61616?tcpNoDelay=false;tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576</acceptor>
       </acceptors>
 
       <security-enabled>false</security-enabled>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/soak/normal/src/main/java/org/apache/activemq/artemis/jms/soak/example/SoakReceiver.java
----------------------------------------------------------------------
diff --git a/examples/soak/normal/src/main/java/org/apache/activemq/artemis/jms/soak/example/SoakReceiver.java b/examples/soak/normal/src/main/java/org/apache/activemq/artemis/jms/soak/example/SoakReceiver.java
index 62ab65c..c903831 100644
--- a/examples/soak/normal/src/main/java/org/apache/activemq/artemis/jms/soak/example/SoakReceiver.java
+++ b/examples/soak/normal/src/main/java/org/apache/activemq/artemis/jms/soak/example/SoakReceiver.java
@@ -16,13 +16,6 @@
  */
 package org.apache.activemq.artemis.jms.soak.example;
 
-import java.lang.Override;
-import java.lang.Runnable;
-import java.util.Hashtable;
-import java.util.UUID;
-import java.util.concurrent.atomic.AtomicLong;
-import java.util.logging.Logger;
-
 import javax.jms.Connection;
 import javax.jms.ConnectionFactory;
 import javax.jms.Destination;
@@ -34,6 +27,9 @@ import javax.jms.MessageListener;
 import javax.jms.Session;
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
+import java.util.UUID;
+import java.util.concurrent.atomic.AtomicLong;
+import java.util.logging.Logger;
 
 public class SoakReceiver
 {
@@ -49,25 +45,13 @@ public class SoakReceiver
          public void run()
          {
 
-            String jndiURL = System.getProperty("jndi.address");
-            if(jndiURL == null)
-            {
-               jndiURL = args.length > 0 ? args[0] : "tcp://localhost:61616";
-            }
-
-            System.out.println("Connecting to JNDI at " + jndiURL);
-
             try
             {
                String fileName = SoakBase.getPerfFileName();
 
                SoakParams params = SoakBase.getParams(fileName);
 
-               Hashtable<String, String> jndiProps = new Hashtable<String, String>();
-               jndiProps.put("connectionFactory.ConnectionFactory", jndiURL);
-               jndiProps.put("java.naming.factory.initial", "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory");
-
-               final SoakReceiver receiver = new SoakReceiver(jndiProps, params);
+               final SoakReceiver receiver = new SoakReceiver(params);
 
                Runtime.getRuntime().addShutdownHook(new Thread()
                {
@@ -91,8 +75,6 @@ public class SoakReceiver
       t.start();
    }
 
-   private final Hashtable<String, String> jndiProps;
-
    private final SoakParams perfParams;
 
    private final ExceptionListener exceptionListener = new ExceptionListener()
@@ -149,9 +131,8 @@ public class SoakReceiver
 
    private Connection connection;
 
-   private SoakReceiver(final Hashtable<String, String> jndiProps, final SoakParams perfParams)
+   private SoakReceiver(final SoakParams perfParams)
    {
-      this.jndiProps = jndiProps;
       this.perfParams = perfParams;
    }
 
@@ -210,7 +191,7 @@ public class SoakReceiver
       InitialContext ic = null;
       try
       {
-         ic = new InitialContext(jndiProps);
+         ic = new InitialContext();
 
          ConnectionFactory factory = (ConnectionFactory)ic.lookup(perfParams.getConnectionFactoryLookup());
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/soak/normal/src/main/java/org/apache/activemq/artemis/jms/soak/example/SoakSender.java
----------------------------------------------------------------------
diff --git a/examples/soak/normal/src/main/java/org/apache/activemq/artemis/jms/soak/example/SoakSender.java b/examples/soak/normal/src/main/java/org/apache/activemq/artemis/jms/soak/example/SoakSender.java
index 567a72b..2e81de6 100644
--- a/examples/soak/normal/src/main/java/org/apache/activemq/artemis/jms/soak/example/SoakSender.java
+++ b/examples/soak/normal/src/main/java/org/apache/activemq/artemis/jms/soak/example/SoakSender.java
@@ -16,10 +16,6 @@
  */
 package org.apache.activemq.artemis.jms.soak.example;
 
-import java.util.Hashtable;
-import java.util.concurrent.atomic.AtomicLong;
-import java.util.logging.Logger;
-
 import javax.jms.BytesMessage;
 import javax.jms.Connection;
 import javax.jms.ConnectionFactory;
@@ -31,6 +27,8 @@ import javax.jms.MessageProducer;
 import javax.jms.Session;
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
+import java.util.concurrent.atomic.AtomicLong;
+import java.util.logging.Logger;
 
 import org.apache.activemq.artemis.utils.TokenBucketLimiter;
 import org.apache.activemq.artemis.utils.TokenBucketLimiterImpl;
@@ -41,24 +39,12 @@ public class SoakSender
 
    public static void main(final String[] args)
    {
-      String jndiURL = System.getProperty("jndi.address");
-      if(jndiURL == null)
-      {
-         jndiURL = args.length > 0 ? args[0] : "tcp://localhost:61616";
-      }
-
-      System.out.println("Connecting to JNDI at " + jndiURL);
       try
       {
          String fileName = SoakBase.getPerfFileName();
 
          SoakParams params = SoakBase.getParams(fileName);
-
-         Hashtable<String, String> jndiProps = new Hashtable<String, String>();
-         jndiProps.put("connectionFactory.ConnectionFactory", jndiURL);
-         jndiProps.put("java.naming.factory.initial", "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory");
-
-         final SoakSender sender = new SoakSender(jndiProps, params);
+         final SoakSender sender = new SoakSender(params);
 
          Runtime.getRuntime().addShutdownHook(new Thread()
          {
@@ -79,8 +65,6 @@ public class SoakSender
 
    private final SoakParams perfParams;
 
-   private final Hashtable<String, String> jndiProps;
-
    private Connection connection;
 
    private Session session;
@@ -98,9 +82,8 @@ public class SoakSender
 
    };
 
-   private SoakSender(final Hashtable<String, String> jndiProps, final SoakParams perfParams)
+   private SoakSender(final SoakParams perfParams)
    {
-      this.jndiProps = jndiProps;
       this.perfParams = perfParams;
    }
 
@@ -207,7 +190,7 @@ public class SoakSender
       InitialContext ic = null;
       try
       {
-         ic = new InitialContext(jndiProps);
+         ic = new InitialContext();
 
          ConnectionFactory factory = (ConnectionFactory)ic.lookup(perfParams.getConnectionFactoryLookup());
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/soak/normal/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/soak/normal/src/main/resources/jndi.properties b/examples/soak/normal/src/main/resources/jndi.properties
new file mode 100644
index 0000000..93537c4
--- /dev/null
+++ b/examples/soak/normal/src/main/resources/jndi.properties
@@ -0,0 +1,20 @@
+# 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.
+
+java.naming.factory.initial=org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory
+connectionFactory.ConnectionFactory=tcp://localhost:61616
+queue.queue/exampleQueue=exampleQueue


[19/24] activemq-artemis git commit: ARTEMIS-178 Refactor examples to use CLI

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/colocated-failover/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/colocated-failover/pom.xml b/examples/jms/colocated-failover/pom.xml
index 5860edf..fb697b2 100644
--- a/examples/jms/colocated-failover/pom.xml
+++ b/examples/jms/colocated-failover/pom.xml
@@ -57,34 +57,23 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start0</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                           <systemProperties>
-                              <property>
-                                 <name>udp-address</name>
-                                 <value>${udp-address}</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
                         </configuration>
                      </execution>
                      <execution>
-                        <id>start1</id>
+                        <id>create2</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
-                           <fork>true</fork>
-                           <systemProperties>
-                              <property>
-                                 <name>udp-address</name>
-                                 <value>${udp-address}</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server1</instance>
+                           <configuration>${basedir}/target/classes/activemq/server1</configuration>
                         </configuration>
                      </execution>
                      <execution>
@@ -95,33 +84,9 @@ under the License.
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.ColocatedFailoverExample</clientClass>
                            <args>
-                              <param>tcp://localhost:61616</param>
-                              <param>tcp://localhost:61617</param>
+                              <param>${basedir}/target/server0</param>
+                              <param>${basedir}/target/server1</param>
                            </args>
-                            <systemProperties>
-                                <property>
-                                    <name>exampleConfigDir</name>
-                                    <value>${basedir}/target/classes/activemq</value>
-                                </property>
-                            </systemProperties>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop0</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop1</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
                         </configuration>
                      </execution>
                   </executions>
@@ -131,40 +96,7 @@ under the License.
                         <artifactId>colocated-failover</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                  </configuration>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/colocated-failover/src/main/java/org/apache/activemq/artemis/jms/example/ColocatedFailoverExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/colocated-failover/src/main/java/org/apache/activemq/artemis/jms/example/ColocatedFailoverExample.java b/examples/jms/colocated-failover/src/main/java/org/apache/activemq/artemis/jms/example/ColocatedFailoverExample.java
index 0baa7b4..de823a4 100644
--- a/examples/jms/colocated-failover/src/main/java/org/apache/activemq/artemis/jms/example/ColocatedFailoverExample.java
+++ b/examples/jms/colocated-failover/src/main/java/org/apache/activemq/artemis/jms/example/ColocatedFailoverExample.java
@@ -16,8 +16,6 @@
  */
 package org.apache.activemq.artemis.jms.example;
 
-import java.util.Hashtable;
-
 import javax.jms.Connection;
 import javax.jms.ConnectionFactory;
 import javax.jms.MessageConsumer;
@@ -26,6 +24,7 @@ import javax.jms.Queue;
 import javax.jms.Session;
 import javax.jms.TextMessage;
 import javax.naming.InitialContext;
+import java.util.Hashtable;
 
 import org.apache.activemq.artemis.common.example.ActiveMQExample;
 
@@ -35,7 +34,7 @@ import org.apache.activemq.artemis.common.example.ActiveMQExample;
  */
 public class ColocatedFailoverExample extends ActiveMQExample
 {
-   public static void main(final String[] args)
+   public static void main(final String[] args) throws Exception
    {
       new ColocatedFailoverExample().run(args);
    }
@@ -56,12 +55,12 @@ public class ColocatedFailoverExample extends ActiveMQExample
          // Step 1. Get an initial context for looking up JNDI for both servers
          Hashtable<String, Object> properties = new Hashtable<String, Object>();
          properties.put("java.naming.factory.initial", "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory");
-         properties.put("connectionFactory.ConnectionFactory", args[1]);
+         properties.put("connectionFactory.ConnectionFactory", DEFAULT_TCP2);
          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", args[0] + "?ha=true&retryInterval=1000&retryIntervalMultiplier=1.0&reconnectAttempts=-1");
+         properties.put("connectionFactory.ConnectionFactory", DEFAULT_TCP1 + "?ha=true&retryInterval=1000&retryIntervalMultiplier=1.0&reconnectAttempts=-1");
          properties.put("queue.queue/exampleQueue", "exampleQueue");
          initialContext = new InitialContext(properties);
 
@@ -95,8 +94,8 @@ public class ColocatedFailoverExample extends ActiveMQExample
 
          // Step 7. Crash server #0, the live server, and wait a little while to make sure
          // it has really crashed
-         Thread.sleep(2000);
          killServer(0);
+         Thread.sleep(5000);
 
 
          // Step 8. start the connection ready to receive messages

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/colocated-failover/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/colocated-failover/src/main/resources/activemq/server0/broker.xml b/examples/jms/colocated-failover/src/main/resources/activemq/server0/broker.xml
index 363ae96..554d01f 100644
--- a/examples/jms/colocated-failover/src/main/resources/activemq/server0/broker.xml
+++ b/examples/jms/colocated-failover/src/main/resources/activemq/server0/broker.xml
@@ -30,13 +30,13 @@ under the License.
    <core xmlns="urn:activemq:core">
 
 
-      <bindings-directory>target/server0/data/messaging/bindings</bindings-directory>
+      <bindings-directory>../../server0/data/messaging/bindings</bindings-directory>
 
-      <journal-directory>target/server0/data/messaging/journal</journal-directory>
+      <journal-directory>../../server0/data/messaging/journal</journal-directory>
 
-      <large-messages-directory>target/server0/data/messaging/largemessages</large-messages-directory>
+      <large-messages-directory>../../server0/data/messaging/largemessages</large-messages-directory>
 
-      <paging-directory>target/server0/data/messaging/paging</paging-directory>
+      <paging-directory>../../server0/data/messaging/paging</paging-directory>
       <!-- Connectors -->
 
       <connectors>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/colocated-failover/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/colocated-failover/src/main/resources/activemq/server1/broker.xml b/examples/jms/colocated-failover/src/main/resources/activemq/server1/broker.xml
index 464fdee..2fda160 100644
--- a/examples/jms/colocated-failover/src/main/resources/activemq/server1/broker.xml
+++ b/examples/jms/colocated-failover/src/main/resources/activemq/server1/broker.xml
@@ -30,13 +30,13 @@ under the License.
    <core xmlns="urn:activemq:core">
 
 
-      <bindings-directory>target/server1/data/messaging/bindings</bindings-directory>
+      <bindings-directory>../../server1/data/messaging/bindings</bindings-directory>
 
-      <journal-directory>target/server1/data/messaging/journal</journal-directory>
+      <journal-directory>../../server1/data/messaging/journal</journal-directory>
 
-      <large-messages-directory>target/server1/data/messaging/largemessages</large-messages-directory>
+      <large-messages-directory>../../server1/data/messaging/largemessages</large-messages-directory>
 
-      <paging-directory>target/server1/data/messaging/paging</paging-directory>
+      <paging-directory>../../server1/data/messaging/paging</paging-directory>
 
       <!-- Connectors -->
       <connectors>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/common/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/common/pom.xml b/examples/jms/common/pom.xml
index 9fe2604..4681cac 100644
--- a/examples/jms/common/pom.xml
+++ b/examples/jms/common/pom.xml
@@ -55,6 +55,11 @@ under the License.
          <artifactId>artemis-jms-client</artifactId>
          <version>${project.version}</version>
       </dependency>
+      <dependency>
+         <groupId>io.netty</groupId>
+         <artifactId>netty-all</artifactId>
+         <version>${netty.version}</version>
+      </dependency>
    </dependencies>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/common/src/main/java/org/apache/activemq/artemis/common/example/ActiveMQExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/common/src/main/java/org/apache/activemq/artemis/common/example/ActiveMQExample.java b/examples/jms/common/src/main/java/org/apache/activemq/artemis/common/example/ActiveMQExample.java
index 637cf3b..b3b791b 100644
--- a/examples/jms/common/src/main/java/org/apache/activemq/artemis/common/example/ActiveMQExample.java
+++ b/examples/jms/common/src/main/java/org/apache/activemq/artemis/common/example/ActiveMQExample.java
@@ -16,156 +16,214 @@
  */
 package org.apache.activemq.artemis.common.example;
 
-import java.io.File;
+import javax.jms.Connection;
 import java.util.HashMap;
 import java.util.logging.Logger;
 
-import javax.jms.Connection;
-import javax.jms.JMSException;
-
 import org.apache.activemq.artemis.api.core.TransportConfiguration;
 import org.apache.activemq.artemis.api.core.client.ClientSession;
 import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
 import org.apache.activemq.artemis.api.jms.JMSFactoryType;
-import org.apache.activemq.artemis.core.client.impl.DelegatingSession;
 import org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnectorFactory;
 import org.apache.activemq.artemis.jms.client.ActiveMQConnection;
 import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
 
 /**
- * Base class for ActiveMQ Artemis examples.
- * <p>
- * This takes care of starting and stopping the server as well as deploying any
- * queue needed.
+ * This cass is a base class for all the tests where we have a few utilities to start and stop servers *
  */
 public abstract class ActiveMQExample
 {
    protected static final Logger log = Logger.getLogger(ActiveMQExample.class.getName());
+   public static final int DEFAULT_PORT = 61616;
+
+   public static final String DEFAULT_TCP1 = "tcp://localhost:61616";
+   public static final String DEFAULT_TCP2 = "tcp://localhost:61617";
+   public static final String DEFAULT_TCP3 = "tcp://localhost:61618";
+   public static final String DEFAULT_TCP4 = "tcp://localhost:61619";
 
    protected boolean failure = false;
 
-   protected String[] args;
+   protected String[] serversArgs;
 
-   public abstract boolean runExample() throws Exception;
+   protected Process[] processes;
 
-   protected void run(final String[] args1)
-   {
-      this.args = args1;
-      //if we have a cluster of servers wait a while for the cluster to form properly
-      if(args != null && args.length > 1)
-      {
-         System.out.println("****pausing to allow cluster to form****");
-         Thread.yield();
-         try
-         {
-            Thread.sleep(2000);
-         }
-         catch (InterruptedException e)
-         {
-            //ignore
-         }
-      }
 
+   // This is to make sure we stop the servers when the example is shutdown
+   // as we start the servers with the example
+   Thread hook;
+
+   public void run(String servers[])
+   {
       try
       {
+         setupServers(servers);
          if (!runExample())
          {
             failure = true;
          }
-         System.out.println("example complete");
       }
-      catch (Throwable e)
+      catch (Throwable throwable)
       {
          failure = true;
-         e.printStackTrace();
+         throwable.printStackTrace();
       }
+      finally
+      {
+         try
+         {
+            stopAllServers();
+         }
+         catch (Throwable ignored)
+         {
+            ignored.printStackTrace();
+         }
+      }
+
       reportResultAndExit();
+
    }
+   public abstract boolean runExample() throws Exception;
 
-   protected void killServer(final int id) throws Exception
+   public void close() throws Exception
    {
-      String configDir = System.getProperty("exampleConfigDir");
-      if(configDir == null)
+
+      if (hook != null)
       {
-         throw new Exception("exampleConfigDir must be set as a system property");
+         Runtime.getRuntime().removeShutdownHook(hook);
+         hook = null;
       }
+      stopAllServers();
+   }
+
+   /** This will start the servers */
+   private final ActiveMQExample setupServers(String[] serversArgs) throws Exception
+   {
+      hook = new Thread()
+      {
+         public void run()
+         {
+            try
+            {
+               System.out.println("Shutting down servers!!!");
+               System.out.flush();
+               ActiveMQExample.this.stopAllServers();
+            }
+            catch (Exception e)
+            {
+               e.printStackTrace();
+            }
+         }
+      };
 
-      System.out.println("Killing server " + id);
+      Runtime.getRuntime().addShutdownHook(hook);
+      this.serversArgs = serversArgs;
 
-      // We kill the server by creating a new file in the server dir which is checked for by the server
-      // We can't use Process.destroy() since this does not do a hard kill - it causes shutdown hooks
-      // to be called which cleanly shutdown the server
-      System.out.println(configDir + "/server" + id + "/KILL_ME");
-      File file = new File(configDir + "/server" + id + "/KILL_ME");
+      if (serversArgs == null)
+      {
+         serversArgs = new String[0];
+      }
 
-      file.createNewFile();
+      processes = new Process[serversArgs.length];
+      startServers(serversArgs);
 
-      // Sleep longer than the KillChecker check period
-      Thread.sleep(3000);
+      return this;
    }
 
-   protected void killServer(final int id, final int serverToWaitFor) throws Exception
+   protected void startServers(String[] serversArgs) throws Exception
    {
-      String configDir = System.getProperty("exampleConfigDir");
-      if(configDir == null)
+      for (int i = 0; i < serversArgs.length; i++)
       {
-         throw new Exception("exampleConfigDir must be set as a system property");
+         startServer(i, 5000);
       }
+   }
 
-      System.out.println("Killing server " + id);
-
-      // We kill the server by creating a new file in the server dir which is checked for by the server
-      // We can't use Process.destroy() since this does not do a hard kill - it causes shutdown hooks
-      // to be called which cleanly shutdown the server
-      System.out.println(configDir + "/server" + id + "/KILL_ME");
-      File file = new File(configDir + "/server" + id + "/KILL_ME");
-
-      file.createNewFile();
-
-      waitForServerStart(serverToWaitFor, 20000);
+   protected void stopAllServers() throws Exception
+   {
+      if (processes != null)
+      {
+         for (int i = 0; i < processes.length; i++)
+         {
+            killServer(i);
+         }
+      }
    }
 
-   protected void reStartServer(final int id, final long timeout) throws Exception
+   protected void killServer(final int id) throws Exception
    {
-      String configDir = System.getProperty("exampleConfigDir");
-      if(configDir == null)
+      if (id > processes.length)
       {
-         throw new Exception("exampleConfigDir must be set as a system property");
+         System.out.println("**********************************");
+         System.out.println("Kill server " + id + " manually, will wait 5 seconds for that being done");
+         Thread.sleep(5000);
       }
 
-      System.out.println("restarting server " + id);
+      if (processes[id] != null)
+      {
+         System.out.println("**********************************");
+         System.out.println("Kill server " + id);
+         processes[id].destroyForcibly();
+         processes[id].waitFor();
+//         processes[id].destroy();
+         processes[id] = null;
+         Thread.sleep(1000);
+      }
+   }
 
-      // We kill the server by creating a new file in the server dir which is checked for by the server
-      // We can't use Process.destroy() since this does not do a hard kill - it causes shutdown hooks
-      // to be called which cleanly shutdown the server
-      File file = new File(configDir + "/server" + id + "/RESTART_ME");
+   protected void reStartServer(final int id, final long timeout) throws Exception
+   {
+      startServer(id, timeout);
+   }
 
-      file.createNewFile();
+   protected void startServer(final int id, final long timeout) throws Exception
+   {
+      if (id > processes.length)
+      {
+         System.out.println("**********************************");
+         System.out.println("Start server " + id + " manually");
+         Thread.sleep(5000);
+      }
+      else
+      {
+         // if started before, will kill it
+         if (processes[id] != null)
+         {
+            killServer(id);
+         }
+      }
 
-      waitForServerStart(id, timeout);
+      processes[id] = ExampleUtil.startServer(serversArgs[id], "Server_" + id);
 
+      if (timeout != 0)
+      {
+         waitForServerStart(id, timeout);
+      }
+      else
+      {
+         // just some time wait to wait server to form clusters.. etc
+         Thread.sleep(500);
+      }
    }
 
-   private void waitForServerStart(int id, long timeout) throws InterruptedException
+   protected void waitForServerStart(int id, long timeoutParameter) throws InterruptedException
    {
       // wait for restart
-      long time = System.currentTimeMillis();
-      while (time < System.currentTimeMillis() + timeout)
+      long timeout = System.currentTimeMillis() + timeoutParameter;
+      while (System.currentTimeMillis() < timeout)
       {
          try
          {
             HashMap<String, Object> params = new HashMap<String, Object>();
             params.put("host", "localhost");
-            params.put("port", 61616 + id);
+            params.put("port", DEFAULT_PORT + id);
             TransportConfiguration transportConfiguration = new TransportConfiguration(NettyConnectorFactory.class.getName(), params);
             ActiveMQConnectionFactory cf = ActiveMQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, transportConfiguration);
             cf.createConnection().close();
-            System.out.println("server restarted");
+            System.out.println("server " + id + " started");
          }
          catch (Exception e)
          {
-            System.out.println("awaiting server restart");
-            Thread.sleep(1000);
+            System.out.println("awaiting server " + id + " start at " + (DEFAULT_PORT + id));
+            Thread.sleep(500);
             continue;
          }
          break;
@@ -177,7 +235,7 @@ public abstract class ActiveMQExample
       ClientSession session = ((ActiveMQConnection) connection).getInitialSession();
       TransportConfiguration transportConfiguration = session.getSessionFactory().getConnectorConfiguration();
       String port = (String) transportConfiguration.getParams().get("port");
-      return Integer.valueOf(port) - 61616;
+      return Integer.valueOf(port) - DEFAULT_PORT;
    }
 
    protected Connection getServerConnection(int server, Connection... connections)
@@ -213,12 +271,4 @@ public abstract class ActiveMQExample
          System.out.println("#####################");
       }
    }
-
-   protected static final void closeConnection(final Connection connection) throws JMSException
-   {
-      if (connection != null)
-      {
-         connection.close();
-      }
-   }
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/common/src/main/java/org/apache/activemq/artemis/common/example/ExampleUtil.java
----------------------------------------------------------------------
diff --git a/examples/jms/common/src/main/java/org/apache/activemq/artemis/common/example/ExampleUtil.java b/examples/jms/common/src/main/java/org/apache/activemq/artemis/common/example/ExampleUtil.java
new file mode 100644
index 0000000..b9bb25d
--- /dev/null
+++ b/examples/jms/common/src/main/java/org/apache/activemq/artemis/common/example/ExampleUtil.java
@@ -0,0 +1,122 @@
+/**
+ * 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.
+ */
+
+package org.apache.activemq.artemis.common.example;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+
+public class ExampleUtil
+{
+   public static Process startServer(String artemisInstance, String serverName) throws Exception
+   {
+      boolean IS_WINDOWS = System.getProperty("os.name").toLowerCase().trim().startsWith("win");
+
+      ProcessBuilder builder = null;
+      if (IS_WINDOWS)
+      {
+         builder = new ProcessBuilder("cmd", "/c", "artemis.cmd", "run");
+      }
+      else
+      {
+         builder = new ProcessBuilder("./artemis", "run");
+      }
+
+      builder.directory(new File(artemisInstance + "/bin"));
+
+      Process process = builder.start();
+
+      ProcessLogger outputLogger = new ProcessLogger(true,
+                                                     process.getInputStream(),
+                                                     serverName + "::Out",
+                                                     false);
+      outputLogger.start();
+
+      // Adding a reader to System.err, so the VM won't hang on a System.err.println as identified on this forum thread:
+      // http://www.jboss.org/index.html?module=bb&op=viewtopic&t=151815
+      ProcessLogger errorLogger = new ProcessLogger(true,
+                                                    process.getErrorStream(),
+                                                    serverName + "::Err",
+                                                    true);
+      errorLogger.start();
+
+      return process;
+   }
+
+
+   /**
+    * Redirect the input stream to a logger (as debug logs)
+    */
+   static class ProcessLogger extends Thread
+   {
+      private final InputStream is;
+
+      private final String logName;
+
+      private final boolean print;
+
+      private final boolean sendToErr;
+
+      boolean failed = false;
+
+      ProcessLogger(final boolean print,
+                    final InputStream is,
+                    final String logName,
+                    final boolean sendToErr) throws ClassNotFoundException
+      {
+         this.is = is;
+         this.print = print;
+         this.logName = logName;
+         this.sendToErr = sendToErr;
+         setDaemon(false);
+      }
+
+      @Override
+      public void run()
+      {
+         try
+         {
+            InputStreamReader isr = new InputStreamReader(is);
+            BufferedReader br = new BufferedReader(isr);
+            String line;
+            while ((line = br.readLine()) != null)
+            {
+               if (print)
+               {
+                  if (sendToErr)
+                  {
+                     System.err.println(logName + " err:" + line);
+                  }
+                  else
+                  {
+                     System.out.println(logName + " out:" + line);
+                  }
+               }
+            }
+         }
+         catch (IOException e)
+         {
+            // ok, stream closed
+         }
+
+      }
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/consumer-rate-limit/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/consumer-rate-limit/pom.xml b/examples/jms/consumer-rate-limit/pom.xml
index 6e4690b..d262b3b 100644
--- a/examples/jms/consumer-rate-limit/pom.xml
+++ b/examples/jms/consumer-rate-limit/pom.xml
@@ -57,17 +57,13 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
                         </configuration>
                      </execution>
                      <execution>
@@ -78,16 +74,10 @@ under the License.
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.ConsumerRateLimitExample</clientClass>
                            <args>
-                              <param>tcp://localhost:61616</param>
+                              <param>${basedir}/target/server0</param>
                            </args>
                         </configuration>
                      </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                     </execution>
                   </executions>
                   <dependencies>
                      <dependency>
@@ -95,41 +85,7 @@ under the License.
                         <artifactId>artemis-jms-consumer-rate-limit-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                  </configuration>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/dead-letter/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/dead-letter/pom.xml b/examples/jms/dead-letter/pom.xml
index bcec76a..c383d9e 100644
--- a/examples/jms/dead-letter/pom.xml
+++ b/examples/jms/dead-letter/pom.xml
@@ -57,17 +57,13 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
                         </configuration>
                      </execution>
                      <execution>
@@ -78,16 +74,10 @@ under the License.
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.DeadLetterExample</clientClass>
                            <args>
-                              <param>tcp://localhost:61616</param>
+                              <param>${basedir}/target/server0</param>
                            </args>
                         </configuration>
                      </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                     </execution>
                   </executions>
                   <dependencies>
                      <dependency>
@@ -95,41 +85,7 @@ under the License.
                         <artifactId>artemis-jms-dead-letter-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                  </configuration>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/delayed-redelivery/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/delayed-redelivery/pom.xml b/examples/jms/delayed-redelivery/pom.xml
index 1d696c9..4264468 100644
--- a/examples/jms/delayed-redelivery/pom.xml
+++ b/examples/jms/delayed-redelivery/pom.xml
@@ -57,10 +57,14 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
+                        <configuration>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                        </configuration>
                      </execution>
                      <execution>
                         <id>runClient</id>
@@ -70,16 +74,10 @@ under the License.
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.DelayedRedeliveryExample</clientClass>
                            <args>
-                              <param>tcp://localhost:61616</param>
+                              <param>${basedir}/target/server0</param>
                            </args>
                         </configuration>
                      </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                     </execution>
                   </executions>
                   <dependencies>
                      <dependency>
@@ -87,47 +85,7 @@ under the License.
                         <artifactId>artemis-jms-delayed-redelivery-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                     <systemProperties>
-                        <property>
-                           <name>data.dir</name>
-                           <value>${basedir}/target/</value>
-                        </property>
-                     </systemProperties>
-                  </configuration>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/divert/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/divert/pom.xml b/examples/jms/divert/pom.xml
index d1007d6..260569e 100644
--- a/examples/jms/divert/pom.xml
+++ b/examples/jms/divert/pom.xml
@@ -62,22 +62,23 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start0</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
                         </configuration>
                      </execution>
                      <execution>
-                        <id>start1</id>
+                        <id>create2</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
-                           <fork>true</fork>
+                           <instance>${basedir}/target/server1</instance>
+                           <configuration>${basedir}/target/classes/activemq/server1</configuration>
                         </configuration>
                      </execution>
                      <execution>
@@ -88,33 +89,9 @@ under the License.
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.DivertExample</clientClass>
                            <args>
-                              <param>tcp://localhost:61616</param>
-                              <param>tcp://localhost:61617</param>
+                              <param>${basedir}/target/server0</param>
+                              <param>${basedir}/target/server1</param>
                            </args>
-                           <systemProperties>
-                              <property>
-                                 <name>exampleConfigDir</name>
-                                 <value>${basedir}/target/classes/activemq</value>
-                              </property>
-                           </systemProperties>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop0</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop1</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
                         </configuration>
                      </execution>
                   </executions>
@@ -124,46 +101,7 @@ under the License.
                         <artifactId>artemis-jms-divert-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <systemProperties>
-                        <property>
-                           <name>data.dir</name>
-                           <value>${basedir}/target/</value>
-                        </property>
-                     </systemProperties>
-                  </configuration>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/divert/src/main/java/org/apache/activemq/artemis/jms/example/DivertExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/divert/src/main/java/org/apache/activemq/artemis/jms/example/DivertExample.java b/examples/jms/divert/src/main/java/org/apache/activemq/artemis/jms/example/DivertExample.java
index a4cc663..503aadd 100644
--- a/examples/jms/divert/src/main/java/org/apache/activemq/artemis/jms/example/DivertExample.java
+++ b/examples/jms/divert/src/main/java/org/apache/activemq/artemis/jms/example/DivertExample.java
@@ -16,8 +16,6 @@
  */
 package org.apache.activemq.artemis.jms.example;
 
-import java.util.Hashtable;
-
 import javax.jms.Connection;
 import javax.jms.ConnectionFactory;
 import javax.jms.Message;
@@ -28,6 +26,7 @@ import javax.jms.Session;
 import javax.jms.TextMessage;
 import javax.jms.Topic;
 import javax.naming.InitialContext;
+import java.util.Hashtable;
 
 import org.apache.activemq.artemis.common.example.ActiveMQExample;
 
@@ -59,7 +58,7 @@ public class DivertExample extends ActiveMQExample
          // Step 1. Create an initial context to perform the JNDI lookup on the London server
          Hashtable<String, Object> properties = new Hashtable<String, Object>();
          properties.put("java.naming.factory.initial", "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory");
-         properties.put("connectionFactory.ConnectionFactory", args[0]);
+         properties.put("connectionFactory.ConnectionFactory", DEFAULT_TCP1);
          properties.put("queue.queue/orders", "orders");
          properties.put("topic.topic/priceUpdates", "priceUpdates");
          properties.put("topic.topic/spyTopic", "spyTopic");
@@ -78,7 +77,7 @@ public class DivertExample extends ActiveMQExample
          // Step 6. Create an initial context to perform the JNDI lookup on the New York server
          properties = new Hashtable<String, Object>();
          properties.put("java.naming.factory.initial", "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory");
-         properties.put("connectionFactory.ConnectionFactory", args[1]);
+         properties.put("connectionFactory.ConnectionFactory", DEFAULT_TCP2);
          properties.put("topic.topic/newYorkPriceUpdates", "newYorkPriceUpdates");
          initialContextNewYork = new InitialContext(properties);
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/durable-subscription/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/durable-subscription/pom.xml b/examples/jms/durable-subscription/pom.xml
index 2b37eca..1d408de 100644
--- a/examples/jms/durable-subscription/pom.xml
+++ b/examples/jms/durable-subscription/pom.xml
@@ -57,17 +57,13 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
                         </configuration>
                      </execution>
                      <execution>
@@ -78,16 +74,10 @@ under the License.
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.DurableSubscriptionExample</clientClass>
                            <args>
-                              <param>tcp://localhost:61616</param>
+                              <param>${basedir}/target/server0</param>
                            </args>
                         </configuration>
                      </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                     </execution>
                   </executions>
                   <dependencies>
                      <dependency>
@@ -95,41 +85,7 @@ under the License.
                         <artifactId>artemis-jms-durable-subscription-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                  </configuration>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/embedded-simple/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/embedded-simple/pom.xml b/examples/jms/embedded-simple/pom.xml
index 7762af3..9836ff6 100644
--- a/examples/jms/embedded-simple/pom.xml
+++ b/examples/jms/embedded-simple/pom.xml
@@ -73,16 +73,6 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.EmbeddedExample</clientClass>
-                           <args>
-                              <param>tcp://localhost:61616</param>
-                              <param>tcp://localhost:61616</param>
-                           </args>
-                           <systemProperties>
-                              <property>
-                                 <name>exampleConfigDir</name>
-                                 <value>${basedir}/target/classes/activemq</value>
-                              </property>
-                           </systemProperties>
                         </configuration>
                      </execution>
                   </executions>
@@ -92,41 +82,7 @@ under the License.
                         <artifactId>artemis-jms-embedded-simple-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                  </configuration>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/embedded-simple/src/main/java/org/apache/activemq/artemis/jms/example/EmbeddedExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/embedded-simple/src/main/java/org/apache/activemq/artemis/jms/example/EmbeddedExample.java b/examples/jms/embedded-simple/src/main/java/org/apache/activemq/artemis/jms/example/EmbeddedExample.java
index 8221873..c148dca 100644
--- a/examples/jms/embedded-simple/src/main/java/org/apache/activemq/artemis/jms/example/EmbeddedExample.java
+++ b/examples/jms/embedded-simple/src/main/java/org/apache/activemq/artemis/jms/example/EmbeddedExample.java
@@ -16,10 +16,6 @@
  */
 package org.apache.activemq.artemis.jms.example;
 
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-
 import javax.jms.Connection;
 import javax.jms.ConnectionFactory;
 import javax.jms.MessageConsumer;
@@ -27,13 +23,16 @@ import javax.jms.MessageProducer;
 import javax.jms.Queue;
 import javax.jms.Session;
 import javax.jms.TextMessage;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
 
+import org.apache.activemq.artemis.api.jms.JMSFactoryType;
 import org.apache.activemq.artemis.common.example.ActiveMQExample;
 import org.apache.activemq.artemis.core.config.impl.SecurityConfiguration;
-import org.apache.activemq.artemis.jms.server.embedded.EmbeddedJMS;
 import org.apache.activemq.artemis.jms.server.JMSServerManager;
+import org.apache.activemq.artemis.jms.server.embedded.EmbeddedJMS;
 import org.apache.activemq.artemis.spi.core.security.ActiveMQSecurityManagerImpl;
-import org.apache.activemq.artemis.api.jms.JMSFactoryType;
 
 /**
  * This example demonstrates how to run an ActiveMQ Artemis embedded with JMS

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/embedded/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/embedded/pom.xml b/examples/jms/embedded/pom.xml
index f0eb3f9..e39c4a4 100644
--- a/examples/jms/embedded/pom.xml
+++ b/examples/jms/embedded/pom.xml
@@ -73,20 +73,6 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.EmbeddedExample</clientClass>
-                           <args>
-                              <param>tcp://localhost:61616</param>
-                              <param>tcp://localhost:61617</param>
-                           </args>
-                           <systemProperties>
-                              <property>
-                                 <name>exampleConfigDir</name>
-                                 <value>${basedir}/target/classes/activemq</value>
-                              </property>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                           </systemProperties>
                         </configuration>
                      </execution>
                   </executions>
@@ -96,36 +82,6 @@ under the License.
                         <artifactId>artemis-jms-embedded-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
                </plugin>
             </plugins>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/embedded/src/main/java/org/apache/activemq/artemis/jms/example/EmbeddedExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/embedded/src/main/java/org/apache/activemq/artemis/jms/example/EmbeddedExample.java b/examples/jms/embedded/src/main/java/org/apache/activemq/artemis/jms/example/EmbeddedExample.java
index 9300058..0c029ad 100644
--- a/examples/jms/embedded/src/main/java/org/apache/activemq/artemis/jms/example/EmbeddedExample.java
+++ b/examples/jms/embedded/src/main/java/org/apache/activemq/artemis/jms/example/EmbeddedExample.java
@@ -16,9 +16,6 @@
  */
 package org.apache.activemq.artemis.jms.example;
 
-import java.util.ArrayList;
-import java.util.Date;
-
 import javax.jms.Connection;
 import javax.jms.ConnectionFactory;
 import javax.jms.MessageConsumer;
@@ -26,6 +23,8 @@ import javax.jms.MessageProducer;
 import javax.jms.Queue;
 import javax.jms.Session;
 import javax.jms.TextMessage;
+import java.util.ArrayList;
+import java.util.Date;
 
 import org.apache.activemq.artemis.api.core.TransportConfiguration;
 import org.apache.activemq.artemis.common.example.ActiveMQExample;
@@ -55,7 +54,7 @@ public final class EmbeddedExample extends ActiveMQExample
    @Override
    public boolean runExample() throws Exception
    {
-            try
+      try
       {
 
          // Step 1. Create ActiveMQ Artemis core configuration, and set the properties accordingly

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/expiry/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/expiry/pom.xml b/examples/jms/expiry/pom.xml
index 16b081a..6133af4 100644
--- a/examples/jms/expiry/pom.xml
+++ b/examples/jms/expiry/pom.xml
@@ -57,17 +57,13 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
                         </configuration>
                      </execution>
                      <execution>
@@ -78,16 +74,10 @@ under the License.
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.ExpiryExample</clientClass>
                            <args>
-                              <param>tcp://localhost:61616</param>
+                              <param>${basedir}/target/server0</param>
                            </args>
                         </configuration>
                      </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                     </execution>
                   </executions>
                   <dependencies>
                      <dependency>
@@ -95,41 +85,7 @@ under the License.
                         <artifactId>artemis-jms-expiry-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                  </configuration>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/ha-policy-autobackup/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/ha-policy-autobackup/pom.xml b/examples/jms/ha-policy-autobackup/pom.xml
index 1d3dc10..649adf0 100644
--- a/examples/jms/ha-policy-autobackup/pom.xml
+++ b/examples/jms/ha-policy-autobackup/pom.xml
@@ -57,34 +57,23 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start0</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                           <systemProperties>
-                              <property>
-                                 <name>udp-address</name>
-                                 <value>${udp-address}</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
                         </configuration>
                      </execution>
                      <execution>
-                        <id>start1</id>
+                        <id>create2</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
-                           <fork>true</fork>
-                           <systemProperties>
-                              <property>
-                                 <name>udp-address</name>
-                                 <value>${udp-address}</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server1</instance>
+                           <configuration>${basedir}/target/classes/activemq/server1</configuration>
                         </configuration>
                      </execution>
                      <execution>
@@ -95,33 +84,9 @@ under the License.
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.HAPolicyAutoBackupExample</clientClass>
                            <args>
-                              <param>tcp://localhost:61616</param>
-                              <param>tcp://localhost:61617</param>
+                              <param>${basedir}/target/server0</param>
+                              <param>${basedir}/target/server1</param>
                            </args>
-                           <systemProperties>
-                              <property>
-                                 <name>exampleConfigDir</name>
-                                 <value>${basedir}/target/classes/activemq</value>
-                              </property>
-                           </systemProperties>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop0</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop1</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
                         </configuration>
                      </execution>
                   </executions>
@@ -131,40 +96,7 @@ under the License.
                         <artifactId>ha-policy-autobackup</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                  </configuration>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/ha-policy-autobackup/src/main/java/org/apache/activemq/artemis/jms/example/HAPolicyAutoBackupExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/ha-policy-autobackup/src/main/java/org/apache/activemq/artemis/jms/example/HAPolicyAutoBackupExample.java b/examples/jms/ha-policy-autobackup/src/main/java/org/apache/activemq/artemis/jms/example/HAPolicyAutoBackupExample.java
index 4af82b4..10f858f 100644
--- a/examples/jms/ha-policy-autobackup/src/main/java/org/apache/activemq/artemis/jms/example/HAPolicyAutoBackupExample.java
+++ b/examples/jms/ha-policy-autobackup/src/main/java/org/apache/activemq/artemis/jms/example/HAPolicyAutoBackupExample.java
@@ -16,8 +16,6 @@
  */
 package org.apache.activemq.artemis.jms.example;
 
-import java.util.Hashtable;
-
 import javax.jms.Connection;
 import javax.jms.ConnectionFactory;
 import javax.jms.MessageConsumer;
@@ -26,19 +24,18 @@ import javax.jms.Queue;
 import javax.jms.Session;
 import javax.jms.TextMessage;
 import javax.naming.InitialContext;
+import java.util.ArrayList;
+import java.util.Hashtable;
+import java.util.List;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
 
 import org.apache.activemq.artemis.api.core.TransportConfiguration;
 import org.apache.activemq.artemis.api.core.client.ClusterTopologyListener;
 import org.apache.activemq.artemis.api.core.client.TopologyMember;
 import org.apache.activemq.artemis.common.example.ActiveMQExample;
-import org.apache.activemq.artemis.jms.client.ActiveMQConnection;
 import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
 
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-
 /**
  * A simple example that demonstrates server side load-balancing of messages between the queue instances on different
  * nodes of the cluster.
@@ -46,7 +43,7 @@ import java.util.concurrent.TimeUnit;
  */
 public class HAPolicyAutoBackupExample extends ActiveMQExample
 {
-   public static void main(final String[] args)
+   public static void main(final String[] args) throws Exception
    {
       new HAPolicyAutoBackupExample().run(args);
    }
@@ -67,13 +64,13 @@ public class HAPolicyAutoBackupExample extends ActiveMQExample
          // Step 1. Get an initial context for looking up JNDI from server 0 and 1
          Hashtable<String, Object> properties = new Hashtable<String, Object>();
          properties.put("java.naming.factory.initial", "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory");
-         properties.put("connectionFactory.ConnectionFactory", args[0] + "?ha=true&retryInterval=1000&retryIntervalMultiplier=1.0&reconnectAttempts=-1");
+         properties.put("connectionFactory.ConnectionFactory", DEFAULT_TCP1 + "?ha=true&retryInterval=1000&retryIntervalMultiplier=1.0&reconnectAttempts=-1");
          properties.put("queue.queue/exampleQueue", "exampleQueue");
          ic0 = new InitialContext(properties);
 
          properties = new Hashtable<String, Object>();
          properties.put("java.naming.factory.initial", "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory");
-         properties.put("connectionFactory.ConnectionFactory", args[1] + "?ha=true&retryInterval=1000&retryIntervalMultiplier=1.0&reconnectAttempts=-1");
+         properties.put("connectionFactory.ConnectionFactory", DEFAULT_TCP2 + "?ha=true&retryInterval=1000&retryIntervalMultiplier=1.0&reconnectAttempts=-1");
          ic1 = new InitialContext(properties);
 
          // Step 2. Look-up the JMS Queue object from JNDI
@@ -128,12 +125,13 @@ public class HAPolicyAutoBackupExample extends ActiveMQExample
             System.out.println("Got message: " + message0.getText() + " from node 0");
          }
 
-         // Step 14.now kill server1, messages will be scaled down to server0
-         killServer(1);
-
-         // Step 15.close the consumer so it doesnt get any messages
+         // Step 14.close the consumer so it doesnt get any messages
          consumer1.close();
 
+         // Step 15.now kill server1, messages will be scaled down to server0
+         killServer(1);
+         Thread.sleep(40000);
+
          // Step 16. we now receive the messages that were on server1 but were scaled down to server0
          for (int i = 0; i < numMessages / 2; i++)
          {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/ha-policy-autobackup/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/ha-policy-autobackup/src/main/resources/activemq/server0/broker.xml b/examples/jms/ha-policy-autobackup/src/main/resources/activemq/server0/broker.xml
index 79dd692..db98aa0 100644
--- a/examples/jms/ha-policy-autobackup/src/main/resources/activemq/server0/broker.xml
+++ b/examples/jms/ha-policy-autobackup/src/main/resources/activemq/server0/broker.xml
@@ -29,13 +29,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>target/server0/data/messaging/bindings</bindings-directory>
+      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
 
-      <journal-directory>target/server0/data/messaging/journal</journal-directory>
+      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
 
-      <large-messages-directory>target/server0/data/messaging/largemessages</large-messages-directory>
+      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
 
-      <paging-directory>target/server0/data/messaging/paging</paging-directory>
+      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
       <!-- Connectors -->
 
       <connectors>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/ha-policy-autobackup/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/ha-policy-autobackup/src/main/resources/activemq/server1/broker.xml b/examples/jms/ha-policy-autobackup/src/main/resources/activemq/server1/broker.xml
index 7b135ac..760ce0d 100644
--- a/examples/jms/ha-policy-autobackup/src/main/resources/activemq/server1/broker.xml
+++ b/examples/jms/ha-policy-autobackup/src/main/resources/activemq/server1/broker.xml
@@ -29,13 +29,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>target/server1/data/messaging/bindings</bindings-directory>
+      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
 
-      <journal-directory>target/server1/data/messaging/journal</journal-directory>
+      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
 
-      <large-messages-directory>target/server1/data/messaging/largemessages</large-messages-directory>
+      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
 
-      <paging-directory>target/server1/data/messaging/paging</paging-directory>
+      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
 
       <!-- Connectors -->
       <connectors>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/http-transport/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/http-transport/pom.xml b/examples/jms/http-transport/pom.xml
index a61bf1f..b13f800 100644
--- a/examples/jms/http-transport/pom.xml
+++ b/examples/jms/http-transport/pom.xml
@@ -57,17 +57,13 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
                         </configuration>
                      </execution>
                      <execution>
@@ -78,16 +74,10 @@ under the License.
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.HttpTransportExample</clientClass>
                            <args>
-                              <param>tcp://localhost:61616</param>
+                              <param>${basedir}/target/server0</param>
                            </args>
                         </configuration>
                      </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                     </execution>
                   </executions>
                   <dependencies>
                      <dependency>
@@ -95,47 +85,7 @@ under the License.
                         <artifactId>artemis-jms-http-transport-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                     <systemProperties>
-                        <property>
-                           <name>data.dir</name>
-                           <value>${basedir}/target/</value>
-                        </property>
-                     </systemProperties>
-                  </configuration>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/http-transport/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/http-transport/src/main/resources/activemq/server0/broker.xml b/examples/jms/http-transport/src/main/resources/activemq/server0/broker.xml
index 40cf947..f6062b6 100644
--- a/examples/jms/http-transport/src/main/resources/activemq/server0/broker.xml
+++ b/examples/jms/http-transport/src/main/resources/activemq/server0/broker.xml
@@ -41,6 +41,8 @@ under the License.
 
       <acceptors>
          <acceptor name="netty-acceptor">tcp://localhost:8080</acceptor>
+         <!-- This is being defined just so the check-alive on the ArtemisExample super class works -->
+         <acceptor name="netty-accepto-checkalive">tcp://localhost:61616</acceptor>
       </acceptors>
 
       <!-- Other config -->


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

Posted by cl...@apache.org.
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>


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

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/message-group/src/main/java/org/apache/activemq/artemis/jms/example/MessageGroupExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/message-group/src/main/java/org/apache/activemq/artemis/jms/example/MessageGroupExample.java b/examples/jms/message-group/src/main/java/org/apache/activemq/artemis/jms/example/MessageGroupExample.java
index d621646..ea7e447 100644
--- a/examples/jms/message-group/src/main/java/org/apache/activemq/artemis/jms/example/MessageGroupExample.java
+++ b/examples/jms/message-group/src/main/java/org/apache/activemq/artemis/jms/example/MessageGroupExample.java
@@ -31,25 +31,14 @@ import javax.jms.Session;
 import javax.jms.TextMessage;
 import javax.naming.InitialContext;
 
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
-
 /**
  * A simple JMS Queue example that sends and receives message groups.
  */
-public class MessageGroupExample extends ActiveMQExample
+public class MessageGroupExample
 {
-   private final Map<String, String> messageReceiverMap = new ConcurrentHashMap<String, String>();
-
-   private boolean result = true;
-
-   public static void main(final String[] args)
-   {
-      new MessageGroupExample().run(args);
-   }
-
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(final String[] args) throws Exception
    {
+      final Map<String, String> messageReceiverMap = new ConcurrentHashMap<String, String>();
       Connection connection = null;
       InitialContext initialContext = null;
       try
@@ -74,9 +63,9 @@ public class MessageGroupExample extends ActiveMQExample
 
          // Step 7. Create two consumers
          MessageConsumer consumer1 = session.createConsumer(queue);
-         consumer1.setMessageListener(new SimpleMessageListener("consumer-1"));
+         consumer1.setMessageListener(new SimpleMessageListener("consumer-1", messageReceiverMap));
          MessageConsumer consumer2 = session.createConsumer(queue);
-         consumer2.setMessageListener(new SimpleMessageListener("consumer-2"));
+         consumer2.setMessageListener(new SimpleMessageListener("consumer-2", messageReceiverMap));
 
          // Step 8. Create and send 10 text messages with group id 'Group-0'
          int msgCount = 10;
@@ -103,12 +92,9 @@ public class MessageGroupExample extends ActiveMQExample
             String receiver = messageReceiverMap.get(grpMsg.getText());
             if (!trueReceiver.equals(receiver))
             {
-               System.out.println("Group message [" + grpMsg.getText() + "[ went to wrong receiver: " + receiver);
-               result = false;
+               throw new IllegalStateException("Group message [" + grpMsg.getText() + "[ went to wrong receiver: " + receiver);
             }
          }
-
-         return result;
       }
       finally
       {
@@ -123,29 +109,30 @@ public class MessageGroupExample extends ActiveMQExample
          }
       }
    }
+}
+
+class SimpleMessageListener implements MessageListener
+{
+   private final String name;
+   private final Map<String, String> messageReceiverMap;
 
-   private class SimpleMessageListener implements MessageListener
+   public SimpleMessageListener(final String listenerName, Map<String, String> messageReceiverMap)
    {
-      private final String name;
+      name = listenerName;
+      this.messageReceiverMap = messageReceiverMap;
+   }
 
-      public SimpleMessageListener(final String listenerName)
+   public void onMessage(final Message message)
+   {
+      try
       {
-         name = listenerName;
+         TextMessage msg = (TextMessage)message;
+         System.out.format("Message: [%s] received by %s%n", msg.getText(), name);
+         messageReceiverMap.put(msg.getText(), name);
       }
-
-      public void onMessage(final Message message)
+      catch (JMSException e)
       {
-         try
-         {
-            TextMessage msg = (TextMessage)message;
-            System.out.format("Message: [%s] received by %s%n", msg.getText(), name);
-            messageReceiverMap.put(msg.getText(), name);
-         }
-         catch (JMSException e)
-         {
-            e.printStackTrace();
-         }
+         e.printStackTrace();
       }
    }
-
-}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/message-group/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/message-group/src/main/resources/activemq/server0/artemis-roles.properties b/examples/jms/message-group/src/main/resources/activemq/server0/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/message-group/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/message-group/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/message-group/src/main/resources/activemq/server0/artemis-users.properties b/examples/jms/message-group/src/main/resources/activemq/server0/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/message-group/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/message-group/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/message-group/src/main/resources/activemq/server0/broker.xml b/examples/jms/message-group/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index 7690094..0000000
--- a/examples/jms/message-group/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,60 +0,0 @@
-<?xml version='1.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.
--->
-
-<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-               xmlns="urn:activemq"
-               xsi:schemaLocation="urn:activemq /schema/artemis-server.xsd">
-
-   <jms xmlns="urn:activemq:jms">
-      <!--the queue used by the example-->
-      <queue name="exampleQueue"/>
-   </jms>
-
-   <core xmlns="urn:activemq:core">
-
-      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
-
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
-
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
-
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
-      </acceptors>
-
-      <!-- Other config -->
-
-      <security-settings>
-         <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
-            <permission type="createDurableQueue" roles="guest"/>
-            <permission type="deleteDurableQueue" roles="guest"/>
-            <permission type="createNonDurableQueue" roles="guest"/>
-            <permission type="deleteNonDurableQueue" roles="guest"/>
-            <permission type="consume" roles="guest"/>
-            <permission type="send" roles="guest"/>
-         </security-setting>
-      </security-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/message-group2/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/message-group2/pom.xml b/examples/jms/message-group2/pom.xml
index 54258f9..6f23575 100644
--- a/examples/jms/message-group2/pom.xml
+++ b/examples/jms/message-group2/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>
@@ -61,9 +56,18 @@ under the License.
                         <goals>
                            <goal>create</goal>
                         </goals>
+                     </execution>
+                     <execution>
+                        <id>start</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
                         <configuration>
-                           <instance>${basedir}/target/server0</instance>
-                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                           <spawn>true</spawn>
+                           <testURI>tcp://localhost:61616</testURI>
+                           <args>
+                              <param>run</param>
+                           </args>
                         </configuration>
                      </execution>
                      <execution>
@@ -73,8 +77,16 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.MessageGroup2Example</clientClass>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>stop</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
                            <args>
-                              <param>${basedir}/target/server0</param>
+                              <param>stop</param>
                            </args>
                         </configuration>
                      </execution>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/message-group2/src/main/java/org/apache/activemq/artemis/jms/example/MessageGroup2Example.java
----------------------------------------------------------------------
diff --git a/examples/jms/message-group2/src/main/java/org/apache/activemq/artemis/jms/example/MessageGroup2Example.java b/examples/jms/message-group2/src/main/java/org/apache/activemq/artemis/jms/example/MessageGroup2Example.java
index 78b5164..d53a125 100644
--- a/examples/jms/message-group2/src/main/java/org/apache/activemq/artemis/jms/example/MessageGroup2Example.java
+++ b/examples/jms/message-group2/src/main/java/org/apache/activemq/artemis/jms/example/MessageGroup2Example.java
@@ -31,24 +31,16 @@ import javax.jms.Session;
 import javax.jms.TextMessage;
 import javax.naming.InitialContext;
 
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
-
 /**
  * A simple JMS Queue example that sends and receives message groups.
  */
-public class MessageGroup2Example extends ActiveMQExample
+public class MessageGroup2Example
 {
-   private final Map<String, String> messageReceiverMap = new ConcurrentHashMap<String, String>();
    private boolean result = true;
 
-   public static void main(String[] args)
-   {
-      new MessageGroup2Example().run(args);
-   }
-
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(String[] args) throws Exception
    {
+      final Map<String, String> messageReceiverMap = new ConcurrentHashMap<String, String>();
       Connection connection = null;
       InitialContext initialContext = null;
       try
@@ -75,9 +67,9 @@ public class MessageGroup2Example extends ActiveMQExample
 
          //Step 7. Create two consumers
          MessageConsumer consumer1 = session.createConsumer(queue);
-         consumer1.setMessageListener(new SimpleMessageListener("consumer-1"));
+         consumer1.setMessageListener(new SimpleMessageListener("consumer-1", messageReceiverMap));
          MessageConsumer consumer2 = session.createConsumer(queue);
-         consumer2.setMessageListener(new SimpleMessageListener("consumer-2"));
+         consumer2.setMessageListener(new SimpleMessageListener("consumer-2", messageReceiverMap));
 
          //Step 8. Create and send 10 text messages with each producer
          int msgCount = 10;
@@ -106,18 +98,14 @@ public class MessageGroup2Example extends ActiveMQExample
             String receiver = messageReceiverMap.get("producer1 message " + i);
             if (!trueReceiver.equals(receiver))
             {
-               System.out.println("Group message [producer1 message " + i + "] went to wrong receiver: " + receiver);
-               result = false;
+               throw new IllegalStateException("Group message [producer1 message " + i + "] went to wrong receiver: " + receiver);
             }
             receiver = messageReceiverMap.get("producer2 message " + i);
             if (!trueReceiver.equals(receiver))
             {
-               System.out.println("Group message [producer2 message " + i + "] went to wrong receiver: " + receiver);
-               result = false;
+               throw new IllegalStateException("Group message [producer2 message " + i + "] went to wrong receiver: " + receiver);
             }
          }
-
-         return result;
       }
       finally
       {
@@ -132,31 +120,32 @@ public class MessageGroup2Example extends ActiveMQExample
          }
       }
    }
+}
+
+class SimpleMessageListener implements MessageListener
+{
+   private final String name;
+   final Map<String, String> messageReceiverMap;
 
-   private class SimpleMessageListener implements MessageListener
+   public SimpleMessageListener(String listenerName, Map<String, String> messageReceiverMap)
    {
-      private final String name;
+      name = listenerName;
+      this.messageReceiverMap = messageReceiverMap;
+   }
 
-      public SimpleMessageListener(String listenerName)
+   public void onMessage(Message message)
+   {
+      try
       {
-         name = listenerName;
+         TextMessage msg = (TextMessage)message;
+         System.out.format("Message: [%s] received by %s%n",
+                           msg.getText(),
+                           name);
+         messageReceiverMap.put(msg.getText(), name);
       }
-
-      public void onMessage(Message message)
+      catch (JMSException e)
       {
-         try
-         {
-            TextMessage msg = (TextMessage)message;
-            System.out.format("Message: [%s] received by %s%n",
-                              msg.getText(),
-                              name);
-            messageReceiverMap.put(msg.getText(), name);
-         }
-         catch (JMSException e)
-         {
-            e.printStackTrace();
-         }
+         e.printStackTrace();
       }
    }
-
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/message-group2/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/message-group2/src/main/resources/activemq/server0/artemis-roles.properties b/examples/jms/message-group2/src/main/resources/activemq/server0/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/message-group2/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/message-group2/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/message-group2/src/main/resources/activemq/server0/artemis-users.properties b/examples/jms/message-group2/src/main/resources/activemq/server0/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/message-group2/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/message-group2/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/message-group2/src/main/resources/activemq/server0/broker.xml b/examples/jms/message-group2/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index 7690094..0000000
--- a/examples/jms/message-group2/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,60 +0,0 @@
-<?xml version='1.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.
--->
-
-<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-               xmlns="urn:activemq"
-               xsi:schemaLocation="urn:activemq /schema/artemis-server.xsd">
-
-   <jms xmlns="urn:activemq:jms">
-      <!--the queue used by the example-->
-      <queue name="exampleQueue"/>
-   </jms>
-
-   <core xmlns="urn:activemq:core">
-
-      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
-
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
-
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
-
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
-      </acceptors>
-
-      <!-- Other config -->
-
-      <security-settings>
-         <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
-            <permission type="createDurableQueue" roles="guest"/>
-            <permission type="deleteDurableQueue" roles="guest"/>
-            <permission type="createNonDurableQueue" roles="guest"/>
-            <permission type="deleteNonDurableQueue" roles="guest"/>
-            <permission type="consume" roles="guest"/>
-            <permission type="send" roles="guest"/>
-         </security-setting>
-      </security-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/message-priority/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/message-priority/pom.xml b/examples/jms/message-priority/pom.xml
index 5b35473..6956310 100644
--- a/examples/jms/message-priority/pom.xml
+++ b/examples/jms/message-priority/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>
@@ -61,9 +56,18 @@ under the License.
                         <goals>
                            <goal>create</goal>
                         </goals>
+                     </execution>
+                     <execution>
+                        <id>start</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
                         <configuration>
-                           <instance>${basedir}/target/server0</instance>
-                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                           <spawn>true</spawn>
+                           <testURI>tcp://localhost:61616</testURI>
+                           <args>
+                              <param>run</param>
+                           </args>
                         </configuration>
                      </execution>
                      <execution>
@@ -73,8 +77,16 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.MessagePriorityExample</clientClass>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>stop</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
                            <args>
-                              <param>${basedir}/target/server0</param>
+                              <param>stop</param>
                            </args>
                         </configuration>
                      </execution>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/message-priority/src/main/java/org/apache/activemq/artemis/jms/example/MessagePriorityExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/message-priority/src/main/java/org/apache/activemq/artemis/jms/example/MessagePriorityExample.java b/examples/jms/message-priority/src/main/java/org/apache/activemq/artemis/jms/example/MessagePriorityExample.java
index bdf98cd..6435efe 100644
--- a/examples/jms/message-priority/src/main/java/org/apache/activemq/artemis/jms/example/MessagePriorityExample.java
+++ b/examples/jms/message-priority/src/main/java/org/apache/activemq/artemis/jms/example/MessagePriorityExample.java
@@ -17,6 +17,7 @@
 package org.apache.activemq.artemis.jms.example;
 
 import java.util.ArrayList;
+import java.util.concurrent.atomic.AtomicBoolean;
 
 import javax.jms.Connection;
 import javax.jms.ConnectionFactory;
@@ -31,25 +32,15 @@ import javax.jms.Session;
 import javax.jms.TextMessage;
 import javax.naming.InitialContext;
 
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
-
 /**
  * A simple JMS example that shows the delivery order of messages with priorities.
  */
-public class MessagePriorityExample extends ActiveMQExample
+public class MessagePriorityExample
 {
-   private volatile boolean result = true;
-
-   private final ArrayList<TextMessage> msgReceived = new ArrayList<TextMessage>();
-
-   public static void main(final String[] args)
-   {
-      new MessagePriorityExample().run(args);
-   }
-
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(final String[] args) throws Exception
    {
+      AtomicBoolean result = new AtomicBoolean(true);
+      final ArrayList<TextMessage> msgReceived = new ArrayList<TextMessage>();
       Connection connection = null;
       InitialContext initialContext = null;
       try
@@ -74,7 +65,7 @@ public class MessagePriorityExample extends ActiveMQExample
 
          // Step 7. Create a JMS Message Consumer
          MessageConsumer redConsumer = session.createConsumer(queue);
-         redConsumer.setMessageListener(new SimpleMessageListener());
+         redConsumer.setMessageListener(new SimpleMessageListener(msgReceived, result));
 
          // Step 8. Create three messages
          TextMessage[] sentMessages = new TextMessage[3];
@@ -85,16 +76,16 @@ public class MessagePriorityExample extends ActiveMQExample
          // Step 9. Send the Messages, each has a different priority
          producer.send(sentMessages[0]);
          System.out.println("Message sent: " + sentMessages[0].getText() +
-                            " with priority: " +
-                            sentMessages[0].getJMSPriority());
+                                    " with priority: " +
+                                    sentMessages[0].getJMSPriority());
          producer.send(sentMessages[1], DeliveryMode.NON_PERSISTENT, 5, 0);
          System.out.println("Message sent: " + sentMessages[1].getText() +
-                            "with priority: " +
-                            sentMessages[1].getJMSPriority());
+                                    "with priority: " +
+                                    sentMessages[1].getJMSPriority());
          producer.send(sentMessages[2], DeliveryMode.NON_PERSISTENT, 9, 0);
          System.out.println("Message sent: " + sentMessages[2].getText() +
-                            "with priority: " +
-                            sentMessages[2].getJMSPriority());
+                                    "with priority: " +
+                                    sentMessages[2].getJMSPriority());
 
          // Step 10. Start the connection now.
          connection.start();
@@ -108,12 +99,12 @@ public class MessagePriorityExample extends ActiveMQExample
             TextMessage rm = msgReceived.get(i);
             if (!rm.getText().equals(sentMessages[2 - i].getText()))
             {
-               System.err.println("Priority is broken!");
-               result = false;
+               throw new IllegalStateException("Priority is broken!");
             }
          }
 
-         return result;
+         if (!result.get())
+            throw new IllegalStateException();
       }
       finally
       {
@@ -128,28 +119,31 @@ public class MessagePriorityExample extends ActiveMQExample
          }
       }
    }
+}
+
+class SimpleMessageListener implements MessageListener
+{
+   ArrayList<TextMessage> msgReceived;
+   AtomicBoolean result;
 
-   public class SimpleMessageListener implements MessageListener
+   public SimpleMessageListener(ArrayList<TextMessage> msgReceived, AtomicBoolean result)
    {
+      this.msgReceived = msgReceived;
+      this.result = result;
+   }
 
-      public SimpleMessageListener()
+   public void onMessage(final Message msg)
+   {
+      TextMessage textMessage = (TextMessage)msg;
+      try
       {
+         System.out.println("Received message : [" + textMessage.getText() + "]");
       }
-
-      public void onMessage(final Message msg)
+      catch (JMSException e)
       {
-         TextMessage textMessage = (TextMessage)msg;
-         try
-         {
-            System.out.println("Received message : [" + textMessage.getText() + "]");
-         }
-         catch (JMSException e)
-         {
-            result = false;
-         }
-         msgReceived.add(textMessage);
+         result.set(false);
       }
-
+      msgReceived.add(textMessage);
    }
 
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/message-priority/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/message-priority/src/main/resources/activemq/server0/artemis-roles.properties b/examples/jms/message-priority/src/main/resources/activemq/server0/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/message-priority/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/message-priority/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/message-priority/src/main/resources/activemq/server0/artemis-users.properties b/examples/jms/message-priority/src/main/resources/activemq/server0/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/message-priority/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/message-priority/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/message-priority/src/main/resources/activemq/server0/broker.xml b/examples/jms/message-priority/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index 7690094..0000000
--- a/examples/jms/message-priority/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,60 +0,0 @@
-<?xml version='1.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.
--->
-
-<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-               xmlns="urn:activemq"
-               xsi:schemaLocation="urn:activemq /schema/artemis-server.xsd">
-
-   <jms xmlns="urn:activemq:jms">
-      <!--the queue used by the example-->
-      <queue name="exampleQueue"/>
-   </jms>
-
-   <core xmlns="urn:activemq:core">
-
-      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
-
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
-
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
-
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
-      </acceptors>
-
-      <!-- Other config -->
-
-      <security-settings>
-         <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
-            <permission type="createDurableQueue" roles="guest"/>
-            <permission type="deleteDurableQueue" roles="guest"/>
-            <permission type="createNonDurableQueue" roles="guest"/>
-            <permission type="deleteNonDurableQueue" roles="guest"/>
-            <permission type="consume" roles="guest"/>
-            <permission type="send" roles="guest"/>
-         </security-setting>
-      </security-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/multiple-failover-failback/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/multiple-failover-failback/pom.xml b/examples/jms/multiple-failover-failback/pom.xml
index 0e429b7..4ae6e9e 100644
--- a/examples/jms/multiple-failover-failback/pom.xml
+++ b/examples/jms/multiple-failover-failback/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,13 +57,16 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>create</id>
+                        <id>create0</id>
                         <goals>
                            <goal>create</goal>
                         </goals>
                         <configuration>
                            <instance>${basedir}/target/server0</instance>
-                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                           <sharedStore>true</sharedStore>
+                           <slave>false</slave>
+                           <dataFolder>../data</dataFolder>
+                           <failoverOnShutdown>true</failoverOnShutdown>
                         </configuration>
                      </execution>
                      <execution>
@@ -73,7 +76,10 @@ under the License.
                         </goals>
                         <configuration>
                            <instance>${basedir}/target/server1</instance>
-                           <configuration>${basedir}/target/classes/activemq/server1</configuration>
+                           <sharedStore>true</sharedStore>
+                           <slave>true</slave>
+                           <dataFolder>../data</dataFolder>
+                           <failoverOnShutdown>true</failoverOnShutdown>
                         </configuration>
                      </execution>
                      <execution>
@@ -83,7 +89,9 @@ under the License.
                         </goals>
                         <configuration>
                            <instance>${basedir}/target/server2</instance>
-                           <configuration>${basedir}/target/classes/activemq/server2</configuration>
+                           <sharedStore>true</sharedStore>
+                           <slave>true</slave>
+                           <dataFolder>../data</dataFolder>
                         </configuration>
                      </execution>
                      <execution>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/multiple-failover-failback/src/main/java/org/apache/activemq/artemis/jms/example/MultipleFailoverFailbackExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/multiple-failover-failback/src/main/java/org/apache/activemq/artemis/jms/example/MultipleFailoverFailbackExample.java b/examples/jms/multiple-failover-failback/src/main/java/org/apache/activemq/artemis/jms/example/MultipleFailoverFailbackExample.java
index 9ea1dc9..dcfb685 100644
--- a/examples/jms/multiple-failover-failback/src/main/java/org/apache/activemq/artemis/jms/example/MultipleFailoverFailbackExample.java
+++ b/examples/jms/multiple-failover-failback/src/main/java/org/apache/activemq/artemis/jms/example/MultipleFailoverFailbackExample.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.JMSException;
@@ -26,37 +28,25 @@ import javax.jms.Session;
 import javax.jms.TextMessage;
 import javax.naming.InitialContext;
 
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
-
-public class MultipleFailoverFailbackExample extends ActiveMQExample
+public class MultipleFailoverFailbackExample
 {
    public static void main(final String[] args) throws Exception
    {
-      new MultipleFailoverFailbackExample().run(args);
-   }
-
-   protected void startServers(String[] serversArgs) throws Exception
-   {
-      for (int i = 0; i < serversArgs.length; i++)
-      {
-         startServer(i, i == 0 ? 5000 : 0);
-      }
-
-      Thread.sleep(5000);
-   }
-
-
-   @Override
-   public boolean runExample() throws Exception
-   {
       final int numMessages = 30;
 
       Connection connection = null;
 
       InitialContext initialContext = null;
 
+      Process[] servers = new Process[3];
+
       try
       {
+         for (int i = 0; i < args.length; i++)
+         {
+            servers[i] = ServerUtil.startServer(args[i], MultipleFailoverFailbackExample.class.getSimpleName() + i, i, 5000);
+         }
+
          // Step 1. Get an initial context for looking up JNDI from the server #1
          initialContext = new InitialContext();
 
@@ -103,9 +93,7 @@ public class MultipleFailoverFailbackExample extends ActiveMQExample
 
          // Step 10. Crash server #1, the live server, and wait a little while to make sure
          // it has really crashed
-         Thread.sleep(2000);
-         killServer(0);
-         Thread.sleep(5000);
+         ServerUtil.killServer(servers[0]);
 
          // Step 11. Acknowledging the 2nd half of the sent messages will fail as failover to the
          // backup server has occurred
@@ -126,8 +114,7 @@ public class MultipleFailoverFailbackExample extends ActiveMQExample
          }
          message0.acknowledge();
 
-         Thread.sleep(2000);
-         startServer(0, 10000);
+         servers[0] = ServerUtil.startServer(args[0], MultipleFailoverFailbackExample.class.getSimpleName() + 0, 0, 5000);
 
          // Step 11. Acknowledging the 2nd half of the sent messages will fail as failover to the
          // backup server has occurred
@@ -147,8 +134,6 @@ public class MultipleFailoverFailbackExample extends ActiveMQExample
             System.out.printf("Got message: %s (redelivered?: %s)%n", message0.getText(), message0.getJMSRedelivered());
          }
          message0.acknowledge();
-
-         return true;
       }
       finally
       {
@@ -163,6 +148,11 @@ public class MultipleFailoverFailbackExample extends ActiveMQExample
          {
             initialContext.close();
          }
+
+         for (int i = 0; i < args.length; i++)
+         {
+            ServerUtil.killServer(servers[i]);
+         }
       }
    }
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/multiple-failover-failback/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/multiple-failover-failback/src/main/resources/activemq/server0/artemis-roles.properties b/examples/jms/multiple-failover-failback/src/main/resources/activemq/server0/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/multiple-failover-failback/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/multiple-failover-failback/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/multiple-failover-failback/src/main/resources/activemq/server0/artemis-users.properties b/examples/jms/multiple-failover-failback/src/main/resources/activemq/server0/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/multiple-failover-failback/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/multiple-failover-failback/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/multiple-failover-failback/src/main/resources/activemq/server0/broker.xml b/examples/jms/multiple-failover-failback/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index 4cf5582..0000000
--- a/examples/jms/multiple-failover-failback/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,93 +0,0 @@
-<?xml version='1.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.
--->
-
-<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-               xmlns="urn:activemq"
-               xsi:schemaLocation="urn:activemq /schema/artemis-server.xsd">
-
-   <jms xmlns="urn:activemq:jms">
-      <!--the queue used by the example-->
-      <queue name="exampleQueue"/>
-   </jms>
-
-   <core xmlns="urn:activemq:core">
-
-      <bindings-directory>../../server0/data/messaging/bindings</bindings-directory>
-
-      <journal-directory>../../server0/data/messaging/journal</journal-directory>
-
-      <large-messages-directory>../../server0/data/messaging/largemessages</large-messages-directory>
-
-      <paging-directory>../../server0/data/messaging/paging</paging-directory>
-
-      <ha-policy>
-         <shared-store>
-            <master/>
-         </shared-store>
-      </ha-policy>
-
-      <!-- Connectors -->
-      <connectors>
-         <connector name="netty-connector">tcp://localhost:61616</connector>
-      </connectors>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
-      </acceptors>
-
-      <broadcast-groups>
-         <broadcast-group name="bg-group1">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <broadcast-period>1000</broadcast-period>
-            <connector-ref>netty-connector</connector-ref>
-         </broadcast-group>
-      </broadcast-groups>
-
-      <discovery-groups>
-         <discovery-group name="dg-group1">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <refresh-timeout>60000</refresh-timeout>
-         </discovery-group>
-      </discovery-groups>
-
-      <cluster-connections>
-         <cluster-connection name="my-cluster">
-            <address>jms</address>
-            <connector-ref>netty-connector</connector-ref>
-            <discovery-group-ref discovery-group-name="dg-group1"/>
-         </cluster-connection>
-      </cluster-connections>
-
-      <security-settings>
-         <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
-            <permission type="createDurableQueue" roles="guest"/>
-            <permission type="deleteDurableQueue" roles="guest"/>
-            <permission type="createNonDurableQueue" roles="guest"/>
-            <permission type="deleteNonDurableQueue" roles="guest"/>
-            <permission type="consume" roles="guest"/>
-            <permission type="send" roles="guest"/>
-         </security-setting>
-      </security-settings>
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/multiple-failover-failback/src/main/resources/activemq/server1/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/multiple-failover-failback/src/main/resources/activemq/server1/artemis-roles.properties b/examples/jms/multiple-failover-failback/src/main/resources/activemq/server1/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/multiple-failover-failback/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/multiple-failover-failback/src/main/resources/activemq/server1/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/multiple-failover-failback/src/main/resources/activemq/server1/artemis-users.properties b/examples/jms/multiple-failover-failback/src/main/resources/activemq/server1/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/multiple-failover-failback/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/multiple-failover-failback/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/multiple-failover-failback/src/main/resources/activemq/server1/broker.xml b/examples/jms/multiple-failover-failback/src/main/resources/activemq/server1/broker.xml
deleted file mode 100644
index f910045..0000000
--- a/examples/jms/multiple-failover-failback/src/main/resources/activemq/server1/broker.xml
+++ /dev/null
@@ -1,93 +0,0 @@
-<?xml version='1.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.
--->
-
-<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-               xmlns="urn:activemq"
-               xsi:schemaLocation="urn:activemq /schema/artemis-server.xsd">
-
-   <jms xmlns="urn:activemq:jms">
-      <!--the queue used by the example-->
-      <queue name="exampleQueue"/>
-   </jms>
-
-   <core xmlns="urn:activemq:core">
-
-      <bindings-directory>../../server0/data/messaging/bindings</bindings-directory>
-
-      <journal-directory>../../server0/data/messaging/journal</journal-directory>
-
-      <large-messages-directory>../../server0/data/messaging/largemessages</large-messages-directory>
-
-      <paging-directory>../../server0/data/messaging/paging</paging-directory>
-
-      <ha-policy>
-         <shared-store>
-            <slave/>
-         </shared-store>
-      </ha-policy>
-
-      <!-- Connectors -->
-      <connectors>
-         <connector name="netty-connector">tcp://localhost:61617</connector>
-      </connectors>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61617</acceptor>
-      </acceptors>
-
-      <broadcast-groups>
-         <broadcast-group name="bg-group1">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <broadcast-period>1000</broadcast-period>
-            <connector-ref>netty-connector</connector-ref>
-         </broadcast-group>
-      </broadcast-groups>
-
-      <discovery-groups>
-         <discovery-group name="dg-group1">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <refresh-timeout>60000</refresh-timeout>
-         </discovery-group>
-      </discovery-groups>
-
-      <cluster-connections>
-         <cluster-connection name="my-cluster">
-            <address>jms</address>
-            <connector-ref>netty-connector</connector-ref>
-            <discovery-group-ref discovery-group-name="dg-group1"/>
-         </cluster-connection>
-      </cluster-connections>
-
-      <security-settings>
-         <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
-            <permission type="createDurableQueue" roles="guest"/>
-            <permission type="deleteDurableQueue" roles="guest"/>
-            <permission type="createNonDurableQueue" roles="guest"/>
-            <permission type="deleteNonDurableQueue" roles="guest"/>
-            <permission type="consume" roles="guest"/>
-            <permission type="send" roles="guest"/>
-         </security-setting>
-      </security-settings>
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/multiple-failover-failback/src/main/resources/activemq/server2/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/multiple-failover-failback/src/main/resources/activemq/server2/artemis-roles.properties b/examples/jms/multiple-failover-failback/src/main/resources/activemq/server2/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/multiple-failover-failback/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/multiple-failover-failback/src/main/resources/activemq/server2/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/multiple-failover-failback/src/main/resources/activemq/server2/artemis-users.properties b/examples/jms/multiple-failover-failback/src/main/resources/activemq/server2/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/multiple-failover-failback/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/multiple-failover-failback/src/main/resources/activemq/server2/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/multiple-failover-failback/src/main/resources/activemq/server2/broker.xml b/examples/jms/multiple-failover-failback/src/main/resources/activemq/server2/broker.xml
deleted file mode 100644
index 76a521a..0000000
--- a/examples/jms/multiple-failover-failback/src/main/resources/activemq/server2/broker.xml
+++ /dev/null
@@ -1,94 +0,0 @@
-<?xml version='1.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.
--->
-
-<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-               xmlns="urn:activemq"
-               xsi:schemaLocation="urn:activemq /schema/artemis-server.xsd">
-
-   <jms xmlns="urn:activemq:jms">
-      <!--the queue used by the example-->
-      <queue name="exampleQueue"/>
-   </jms>
-
-   <core xmlns="urn:activemq:core">
-
-      <bindings-directory>../../server0/data/messaging/bindings</bindings-directory>
-
-      <journal-directory>../../server0/data/messaging/journal</journal-directory>
-
-      <large-messages-directory>../../server0/data/messaging/largemessages</large-messages-directory>
-
-      <paging-directory>../../server0/data/messaging/paging</paging-directory>
-
-      <ha-policy>
-         <shared-store>
-            <slave/>
-         </shared-store>
-      </ha-policy>
-
-      <connectors>
-         <connector name="netty-connector">tcp://localhost:61618</connector>
-      </connectors>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61618</acceptor>
-      </acceptors>
-
-      <broadcast-groups>
-         <broadcast-group name="bg-group1">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <broadcast-period>1000</broadcast-period>
-            <connector-ref>netty-connector</connector-ref>
-         </broadcast-group>
-      </broadcast-groups>
-
-      <discovery-groups>
-         <discovery-group name="dg-group1">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <refresh-timeout>60000</refresh-timeout>
-         </discovery-group>
-      </discovery-groups>
-
-      <cluster-connections>
-         <cluster-connection name="my-cluster">
-            <address>jms</address>
-            <connector-ref>netty-connector</connector-ref>
-            <discovery-group-ref discovery-group-name="dg-group1"/>
-         </cluster-connection>
-      </cluster-connections>
-      <!-- Other config -->
-
-      <security-settings>
-         <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
-            <permission type="createDurableQueue" roles="guest"/>
-            <permission type="deleteDurableQueue" roles="guest"/>
-            <permission type="createNonDurableQueue" roles="guest"/>
-            <permission type="deleteNonDurableQueue" roles="guest"/>
-            <permission type="consume" roles="guest"/>
-            <permission type="send" roles="guest"/>
-         </security-setting>
-      </security-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/multiple-failover/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/multiple-failover/pom.xml b/examples/jms/multiple-failover/pom.xml
index a68679d..cb00084 100644
--- a/examples/jms/multiple-failover/pom.xml
+++ b/examples/jms/multiple-failover/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,13 +57,16 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>create</id>
+                        <id>create0</id>
                         <goals>
                            <goal>create</goal>
                         </goals>
                         <configuration>
                            <instance>${basedir}/target/server0</instance>
-                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                           <sharedStore>true</sharedStore>
+                           <slave>false</slave>
+                           <dataFolder>../data</dataFolder>
+                           <failoverOnShutdown>true</failoverOnShutdown>
                         </configuration>
                      </execution>
                      <execution>
@@ -73,7 +76,10 @@ under the License.
                         </goals>
                         <configuration>
                            <instance>${basedir}/target/server1</instance>
-                           <configuration>${basedir}/target/classes/activemq/server1</configuration>
+                           <sharedStore>true</sharedStore>
+                           <slave>true</slave>
+                           <dataFolder>../data</dataFolder>
+                           <failoverOnShutdown>true</failoverOnShutdown>
                         </configuration>
                      </execution>
                      <execution>
@@ -83,7 +89,9 @@ under the License.
                         </goals>
                         <configuration>
                            <instance>${basedir}/target/server2</instance>
-                           <configuration>${basedir}/target/classes/activemq/server2</configuration>
+                           <sharedStore>true</sharedStore>
+                           <slave>true</slave>
+                           <dataFolder>../data</dataFolder>
                         </configuration>
                      </execution>
                      <execution>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/multiple-failover/src/main/java/org/apache/activemq/artemis/jms/example/MultipleFailoverExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/multiple-failover/src/main/java/org/apache/activemq/artemis/jms/example/MultipleFailoverExample.java b/examples/jms/multiple-failover/src/main/java/org/apache/activemq/artemis/jms/example/MultipleFailoverExample.java
index a2b55e4..928e6fb 100644
--- a/examples/jms/multiple-failover/src/main/java/org/apache/activemq/artemis/jms/example/MultipleFailoverExample.java
+++ b/examples/jms/multiple-failover/src/main/java/org/apache/activemq/artemis/jms/example/MultipleFailoverExample.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.JMSException;
@@ -26,37 +28,25 @@ import javax.jms.Session;
 import javax.jms.TextMessage;
 import javax.naming.InitialContext;
 
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
-
-public class MultipleFailoverExample extends ActiveMQExample
+public class MultipleFailoverExample
 {
    public static void main(final String[] args) throws Exception
    {
-      new MultipleFailoverExample().run(args);
-   }
-
-   protected void startServers(String[] serversArgs) throws Exception
-   {
-      for (int i = 0; i < serversArgs.length; i++)
-      {
-         startServer(i, i == 0 ? 5000 : 0);
-      }
-
-      Thread.sleep(5000);
-   }
-
-
-   @Override
-   public boolean runExample() throws Exception
-   {
       final int numMessages = 30;
 
       Connection connection = null;
 
       InitialContext initialContext = null;
 
+      Process[] servers = new Process[3];
+
       try
       {
+         for (int i = 0; i < args.length; i++)
+         {
+            servers[i] = ServerUtil.startServer(args[i], MultipleFailoverExample.class.getSimpleName() + i, i, 5000);
+         }
+
          // Step 1. Get an initial context for looking up JNDI from the server #1
          initialContext = new InitialContext();
 
@@ -103,9 +93,7 @@ public class MultipleFailoverExample extends ActiveMQExample
 
          // Step 10. Crash server #1, the live server, and wait a little while to make sure
          // it has really crashed
-         Thread.sleep(1000);
-         killServer(0);
-         Thread.sleep(5000);
+         ServerUtil.killServer(servers[0]);
 
          // Step 11. Acknowledging the 2nd half of the sent messages will fail as failover to the
          // backup server has occurred
@@ -126,9 +114,7 @@ public class MultipleFailoverExample extends ActiveMQExample
          }
          message0.acknowledge();
 
-         Thread.sleep(1000);
-         killServer(getServer(connection));
-         Thread.sleep(5000);
+         ServerUtil.killServer(servers[ServerUtil.getServer(connection)]);
 
          // Step 11. Acknowledging the 2nd half of the sent messages will fail as failover to the
          // backup server has occurred
@@ -138,7 +124,7 @@ public class MultipleFailoverExample extends ActiveMQExample
          }
          catch (JMSException e)
          {
-            System.err.println("Got exception while acknowledging message: " + e.getMessage());
+            throw new IllegalStateException("Got exception while acknowledging message: " + e.getMessage());
          }
 
          // Step 12. Consume again the 2nd third of the messages again. Note that they are not considered as redelivered.
@@ -148,8 +134,6 @@ public class MultipleFailoverExample extends ActiveMQExample
             System.out.printf("Got message: %s (redelivered?: %s)%n", message0.getText(), message0.getJMSRedelivered());
          }
          message0.acknowledge();
-
-         return true;
       }
       finally
       {
@@ -164,6 +148,11 @@ public class MultipleFailoverExample extends ActiveMQExample
          {
             initialContext.close();
          }
+
+         for (int i = 0; i < args.length; i++)
+         {
+            ServerUtil.killServer(servers[i]);
+         }
       }
    }
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/multiple-failover/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/multiple-failover/src/main/resources/activemq/server0/artemis-roles.properties b/examples/jms/multiple-failover/src/main/resources/activemq/server0/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/multiple-failover/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/multiple-failover/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/multiple-failover/src/main/resources/activemq/server0/artemis-users.properties b/examples/jms/multiple-failover/src/main/resources/activemq/server0/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/multiple-failover/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/multiple-failover/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/multiple-failover/src/main/resources/activemq/server0/broker.xml b/examples/jms/multiple-failover/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index 323bfef..0000000
--- a/examples/jms/multiple-failover/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,95 +0,0 @@
-<?xml version='1.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.
--->
-
-<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-               xmlns="urn:activemq"
-               xsi:schemaLocation="urn:activemq /schema/artemis-server.xsd">
-
-   <jms xmlns="urn:activemq:jms">
-      <!--the queue used by the example-->
-      <queue name="exampleQueue"/>
-   </jms>
-
-   <core xmlns="urn:activemq:core">
-
-      <bindings-directory>../../server0/data/messaging/bindings</bindings-directory>
-
-      <journal-directory>../../server0/data/messaging/journal</journal-directory>
-
-      <large-messages-directory>../../server0/data/messaging/largemessages</large-messages-directory>
-
-      <paging-directory>../../server0/data/messaging/paging</paging-directory>
-
-      <ha-policy>
-         <shared-store>
-            <master/>
-         </shared-store>
-      </ha-policy>
-
-      <!-- Connectors -->
-      <connectors>
-         <connector name="netty-connector">tcp://localhost:61616</connector>
-      </connectors>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
-      </acceptors>
-
-      <broadcast-groups>
-         <broadcast-group name="bg-group1">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <broadcast-period>1000</broadcast-period>
-            <connector-ref>netty-connector</connector-ref>
-         </broadcast-group>
-      </broadcast-groups>
-
-      <discovery-groups>
-         <discovery-group name="dg-group1">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <refresh-timeout>60000</refresh-timeout>
-         </discovery-group>
-      </discovery-groups>
-
-      <cluster-connections>
-         <cluster-connection name="my-cluster">
-            <address>jms</address>
-            <connector-ref>netty-connector</connector-ref>
-            <discovery-group-ref discovery-group-name="dg-group1"/>
-         </cluster-connection>
-      </cluster-connections>
-      <!-- Other config -->
-
-      <security-settings>
-         <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
-            <permission type="createDurableQueue" roles="guest"/>
-            <permission type="deleteDurableQueue" roles="guest"/>
-            <permission type="createNonDurableQueue" roles="guest"/>
-            <permission type="deleteNonDurableQueue" roles="guest"/>
-            <permission type="consume" roles="guest"/>
-            <permission type="send" roles="guest"/>
-         </security-setting>
-      </security-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/multiple-failover/src/main/resources/activemq/server1/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/multiple-failover/src/main/resources/activemq/server1/artemis-roles.properties b/examples/jms/multiple-failover/src/main/resources/activemq/server1/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/multiple-failover/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/multiple-failover/src/main/resources/activemq/server1/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/multiple-failover/src/main/resources/activemq/server1/artemis-users.properties b/examples/jms/multiple-failover/src/main/resources/activemq/server1/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/multiple-failover/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/multiple-failover/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/multiple-failover/src/main/resources/activemq/server1/broker.xml b/examples/jms/multiple-failover/src/main/resources/activemq/server1/broker.xml
deleted file mode 100644
index f910045..0000000
--- a/examples/jms/multiple-failover/src/main/resources/activemq/server1/broker.xml
+++ /dev/null
@@ -1,93 +0,0 @@
-<?xml version='1.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.
--->
-
-<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-               xmlns="urn:activemq"
-               xsi:schemaLocation="urn:activemq /schema/artemis-server.xsd">
-
-   <jms xmlns="urn:activemq:jms">
-      <!--the queue used by the example-->
-      <queue name="exampleQueue"/>
-   </jms>
-
-   <core xmlns="urn:activemq:core">
-
-      <bindings-directory>../../server0/data/messaging/bindings</bindings-directory>
-
-      <journal-directory>../../server0/data/messaging/journal</journal-directory>
-
-      <large-messages-directory>../../server0/data/messaging/largemessages</large-messages-directory>
-
-      <paging-directory>../../server0/data/messaging/paging</paging-directory>
-
-      <ha-policy>
-         <shared-store>
-            <slave/>
-         </shared-store>
-      </ha-policy>
-
-      <!-- Connectors -->
-      <connectors>
-         <connector name="netty-connector">tcp://localhost:61617</connector>
-      </connectors>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61617</acceptor>
-      </acceptors>
-
-      <broadcast-groups>
-         <broadcast-group name="bg-group1">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <broadcast-period>1000</broadcast-period>
-            <connector-ref>netty-connector</connector-ref>
-         </broadcast-group>
-      </broadcast-groups>
-
-      <discovery-groups>
-         <discovery-group name="dg-group1">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <refresh-timeout>60000</refresh-timeout>
-         </discovery-group>
-      </discovery-groups>
-
-      <cluster-connections>
-         <cluster-connection name="my-cluster">
-            <address>jms</address>
-            <connector-ref>netty-connector</connector-ref>
-            <discovery-group-ref discovery-group-name="dg-group1"/>
-         </cluster-connection>
-      </cluster-connections>
-
-      <security-settings>
-         <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
-            <permission type="createDurableQueue" roles="guest"/>
-            <permission type="deleteDurableQueue" roles="guest"/>
-            <permission type="createNonDurableQueue" roles="guest"/>
-            <permission type="deleteNonDurableQueue" roles="guest"/>
-            <permission type="consume" roles="guest"/>
-            <permission type="send" roles="guest"/>
-         </security-setting>
-      </security-settings>
-   </core>
-</configuration>


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

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/jms-auto-closeable/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/jms-auto-closeable/src/main/resources/activemq/server0/artemis-roles.properties b/examples/jms/jms-auto-closeable/src/main/resources/activemq/server0/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/jms-auto-closeable/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/jms-auto-closeable/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/jms-auto-closeable/src/main/resources/activemq/server0/artemis-users.properties b/examples/jms/jms-auto-closeable/src/main/resources/activemq/server0/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/jms-auto-closeable/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/jms-auto-closeable/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/jms-auto-closeable/src/main/resources/activemq/server0/broker.xml b/examples/jms/jms-auto-closeable/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index 0f0eebc..0000000
--- a/examples/jms/jms-auto-closeable/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,59 +0,0 @@
-<?xml version='1.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.
--->
-
-<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-               xmlns="urn:activemq"
-               xsi:schemaLocation="urn:activemq /schema/artemis-server.xsd">
-
-   <jms xmlns="urn:activemq:jms">
-      <!--the queue used by the example-->
-      <queue name="exampleQueue"/>
-   </jms>
-
-   <core xmlns="urn:activemq:core">
-
-      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
-
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
-
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
-
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
-      </acceptors>
-
-      <!-- Other config -->
-
-      <security-settings>
-         <!--security for example queue, note we have removed send privs-->
-         <security-setting match="jms.queue.exampleQueue">
-            <permission type="createDurableQueue" roles="guest"/>
-            <permission type="deleteDurableQueue" roles="guest"/>
-            <permission type="createNonDurableQueue" roles="guest"/>
-            <permission type="deleteNonDurableQueue" roles="guest"/>
-            <permission type="consume" roles="guest"/>
-         </security-setting>
-      </security-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/jms-bridge/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/jms-bridge/pom.xml b/examples/jms/jms-bridge/pom.xml
index 54ea63e..ac21a8c 100644
--- a/examples/jms/jms-bridge/pom.xml
+++ b/examples/jms/jms-bridge/pom.xml
@@ -27,7 +27,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-jms-bridge-example</artifactId>
+   <artifactId>artemis-jms-bridge-example</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS Bridge Example</name>
 
@@ -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.activemq</groupId>
          <artifactId>artemis-jms-server</artifactId>
          <version>${project.version}</version>
@@ -62,7 +57,7 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>create</id>
+                        <id>create0</id>
                         <goals>
                            <goal>create</goal>
                         </goals>
@@ -72,7 +67,7 @@ under the License.
                         </configuration>
                      </execution>
                      <execution>
-                        <id>create2</id>
+                        <id>create1</id>
                         <goals>
                            <goal>create</goal>
                         </goals>
@@ -82,15 +77,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.JMSBridgeExample</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>
@@ -98,7 +143,7 @@ under the License.
                   <dependencies>
                      <dependency>
                         <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-jms-bridge-example</artifactId>
+                        <artifactId>artemis-jms-bridge-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
                   </dependencies>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/jms-bridge/src/main/java/org/apache/activemq/artemis/jms/example/JMSBridgeExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/jms-bridge/src/main/java/org/apache/activemq/artemis/jms/example/JMSBridgeExample.java b/examples/jms/jms-bridge/src/main/java/org/apache/activemq/artemis/jms/example/JMSBridgeExample.java
index 659d37b..13d30e7 100644
--- a/examples/jms/jms-bridge/src/main/java/org/apache/activemq/artemis/jms/example/JMSBridgeExample.java
+++ b/examples/jms/jms-bridge/src/main/java/org/apache/activemq/artemis/jms/example/JMSBridgeExample.java
@@ -27,7 +27,6 @@ import javax.jms.Topic;
 import javax.naming.InitialContext;
 import java.util.Hashtable;
 
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
 import org.apache.activemq.artemis.jms.bridge.JMSBridge;
 import org.apache.activemq.artemis.jms.bridge.QualityOfServiceMode;
 import org.apache.activemq.artemis.jms.bridge.impl.JMSBridgeImpl;
@@ -39,22 +38,16 @@ import org.apache.activemq.artemis.jms.bridge.impl.JNDIDestinationFactory;
  * The source and target destinations are located on 2 different ActiveMQ Artemis server.
  * The source and target queues are bridged by a JMS Bridge configured and running on the "target" server.
  */
-public class JMSBridgeExample extends ActiveMQExample
+public class JMSBridgeExample
 {
    public static void main(final String[] args) throws Exception
    {
-      new JMSBridgeExample().run(args);
-   }
-
-   @Override
-   public boolean runExample() throws Exception
-   {
-      String sourceServer = ActiveMQExample.DEFAULT_TCP1;
-      String targetServer = ActiveMQExample.DEFAULT_TCP2;
+      String sourceServer = "tcp://localhost:61616";
+      String targetServer = "tcp://localhost:61617";
 
       System.out.println("client will publish messages to " + sourceServer +
-                         " and receives message from " +
-                         targetServer);
+                                 " and receives message from " +
+                                 targetServer);
 
       // Step 1. Create JNDI contexts for source and target servers
       InitialContext sourceContext = JMSBridgeExample.createContext(sourceServer);
@@ -65,23 +58,23 @@ public class JMSBridgeExample extends ActiveMQExample
       // Step 2. Create and start a JMS Bridge
       // Note, the Bridge needs a transaction manager, in this instance we will use the JBoss TM
       JMSBridge jmsBridge = new JMSBridgeImpl(
-               new JNDIConnectionFactoryFactory(sourceJndiParams, "ConnectionFactory"),
-               new JNDIConnectionFactoryFactory(targetJndiParams, "ConnectionFactory"),
-               new JNDIDestinationFactory(sourceJndiParams, "source/topic"),
-               new JNDIDestinationFactory(targetJndiParams, "target/queue"),
-               null,
-               null,
-               null,
-               null,
-               null,
-               5000,
-               10,
-               QualityOfServiceMode.DUPLICATES_OK,
-               1,
-               -1,
-               null,
-               null,
-               true);
+              new JNDIConnectionFactoryFactory(sourceJndiParams, "ConnectionFactory"),
+              new JNDIConnectionFactoryFactory(targetJndiParams, "ConnectionFactory"),
+              new JNDIDestinationFactory(sourceJndiParams, "source/topic"),
+              new JNDIDestinationFactory(targetJndiParams, "target/queue"),
+              null,
+              null,
+              null,
+              null,
+              null,
+              5000,
+              10,
+              QualityOfServiceMode.DUPLICATES_OK,
+              1,
+              -1,
+              null,
+              null,
+              true);
 
       Connection sourceConnection = null;
       Connection targetConnection = null;
@@ -135,7 +128,7 @@ public class JMSBridgeExample extends ActiveMQExample
          // Step 12. Be sure to close the resources!
          if(jmsBridge != null)
          {
-             jmsBridge.stop();
+            jmsBridge.stop();
          }
          if (sourceContext != null)
          {
@@ -154,8 +147,6 @@ public class JMSBridgeExample extends ActiveMQExample
             targetConnection.close();
          }
       }
-
-      return true;
    }
 
    private static InitialContext createContext(final String server) throws Exception

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/jms-bridge/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/jms-bridge/src/main/resources/activemq/server0/broker.xml b/examples/jms/jms-bridge/src/main/resources/activemq/server0/broker.xml
index d1e96e7..df456d7 100644
--- a/examples/jms/jms-bridge/src/main/resources/activemq/server0/broker.xml
+++ b/examples/jms/jms-bridge/src/main/resources/activemq/server0/broker.xml
@@ -28,13 +28,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
+      <bindings-directory>${data.dir:../data}/bindings</bindings-directory>
 
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
+      <journal-directory>${data.dir:../data}/journal</journal-directory>
 
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
+      <large-messages-directory>${data.dir:../data}/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
+      <paging-directory>${data.dir:../data}/paging</paging-directory>
 
       <acceptors>
          <acceptor name="netty">tcp://localhost:61616</acceptor>
@@ -50,4 +50,4 @@ under the License.
       </security-settings>
    </core>
 </configuration>
- 
+

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/jms-bridge/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/jms-bridge/src/main/resources/activemq/server1/broker.xml b/examples/jms/jms-bridge/src/main/resources/activemq/server1/broker.xml
index aada805..e65720c 100644
--- a/examples/jms/jms-bridge/src/main/resources/activemq/server1/broker.xml
+++ b/examples/jms/jms-bridge/src/main/resources/activemq/server1/broker.xml
@@ -28,17 +28,16 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>${data.dir}/server1/data/messaging/bindings</bindings-directory>
+      <bindings-directory>${data.dir:../data}/bindings</bindings-directory>
 
-      <journal-directory>${data.dir}/server1/data/messaging/journal</journal-directory>
+      <journal-directory>${data.dir:../data}/journal</journal-directory>
 
-      <large-messages-directory>${data.dir}/server1/data/messaging/largemessages</large-messages-directory>
+      <large-messages-directory>${data.dir:../data}/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir}/server1/data/messaging/paging</paging-directory>
+      <paging-directory>${data.dir:../data}/paging</paging-directory>
 
       <acceptors>
-         <acceptor name="netty">tcp://localhost:5455</acceptor>
-         <acceptor name="netty2">tcp://localhost:61617</acceptor>
+         <acceptor name="netty">tcp://localhost:61617</acceptor>
       </acceptors>
 
       <security-settings>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/jms-completion-listener/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/jms-completion-listener/pom.xml b/examples/jms/jms-completion-listener/pom.xml
index 042b3de..ef5fb76 100644
--- a/examples/jms/jms-completion-listener/pom.xml
+++ b/examples/jms/jms-completion-listener/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>
@@ -61,9 +56,18 @@ under the License.
                         <goals>
                            <goal>create</goal>
                         </goals>
+                     </execution>
+                     <execution>
+                        <id>start</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
                         <configuration>
-                           <instance>${basedir}/target/server0</instance>
-                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                           <spawn>true</spawn>
+                           <testURI>tcp://localhost:61616</testURI>
+                           <args>
+                              <param>run</param>
+                           </args>
                         </configuration>
                      </execution>
                      <execution>
@@ -73,8 +77,16 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.JMSCompletionListenerExample</clientClass>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>stop</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
                            <args>
-                              <param>${basedir}/target/server0</param>
+                              <param>stop</param>
                            </args>
                         </configuration>
                      </execution>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/jms-completion-listener/src/main/java/org/apache/activemq/artemis/jms/example/JMSCompletionListenerExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/jms-completion-listener/src/main/java/org/apache/activemq/artemis/jms/example/JMSCompletionListenerExample.java b/examples/jms/jms-completion-listener/src/main/java/org/apache/activemq/artemis/jms/example/JMSCompletionListenerExample.java
index a166000..47a61cb 100644
--- a/examples/jms/jms-completion-listener/src/main/java/org/apache/activemq/artemis/jms/example/JMSCompletionListenerExample.java
+++ b/examples/jms/jms-completion-listener/src/main/java/org/apache/activemq/artemis/jms/example/JMSCompletionListenerExample.java
@@ -24,23 +24,17 @@ import javax.jms.Message;
 import javax.jms.Queue;
 import javax.naming.InitialContext;
 
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
-
+import java.lang.Exception;
+import java.lang.IllegalStateException;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 
 /**
  * A JMS Completion Listener Example.
  */
-public class JMSCompletionListenerExample extends ActiveMQExample
+public class JMSCompletionListenerExample
 {
-   public static void main(final String[] args)
-   {
-      new JMSCompletionListenerExample().run(args);
-   }
-
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(final String[] args) throws Exception
    {
       InitialContext initialContext = null;
       JMSContext jmsContext = null;
@@ -84,7 +78,10 @@ public class JMSCompletionListenerExample extends ActiveMQExample
          producer.send(queue, "this is a string");
 
          //Step 7. wait for the Completion handler
-         return latch.await(5, TimeUnit.SECONDS);
+         if (!latch.await(5, TimeUnit.SECONDS))
+         {
+            throw new IllegalStateException("Completion listener not called as expected.");
+         }
       }
       finally
       {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/jms-completion-listener/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/jms-completion-listener/src/main/resources/activemq/server0/artemis-roles.properties b/examples/jms/jms-completion-listener/src/main/resources/activemq/server0/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/jms-completion-listener/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/jms-completion-listener/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/jms-completion-listener/src/main/resources/activemq/server0/artemis-users.properties b/examples/jms/jms-completion-listener/src/main/resources/activemq/server0/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/jms-completion-listener/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/jms-completion-listener/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/jms-completion-listener/src/main/resources/activemq/server0/broker.xml b/examples/jms/jms-completion-listener/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index 7690094..0000000
--- a/examples/jms/jms-completion-listener/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,60 +0,0 @@
-<?xml version='1.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.
--->
-
-<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-               xmlns="urn:activemq"
-               xsi:schemaLocation="urn:activemq /schema/artemis-server.xsd">
-
-   <jms xmlns="urn:activemq:jms">
-      <!--the queue used by the example-->
-      <queue name="exampleQueue"/>
-   </jms>
-
-   <core xmlns="urn:activemq:core">
-
-      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
-
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
-
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
-
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
-      </acceptors>
-
-      <!-- Other config -->
-
-      <security-settings>
-         <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
-            <permission type="createDurableQueue" roles="guest"/>
-            <permission type="deleteDurableQueue" roles="guest"/>
-            <permission type="createNonDurableQueue" roles="guest"/>
-            <permission type="deleteNonDurableQueue" roles="guest"/>
-            <permission type="consume" roles="guest"/>
-            <permission type="send" roles="guest"/>
-         </security-setting>
-      </security-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/jms-context/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/jms-context/pom.xml b/examples/jms/jms-context/pom.xml
index 7363d88..d586367 100644
--- a/examples/jms/jms-context/pom.xml
+++ b/examples/jms/jms-context/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>
@@ -61,9 +56,18 @@ under the License.
                         <goals>
                            <goal>create</goal>
                         </goals>
+                     </execution>
+                     <execution>
+                        <id>start</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
                         <configuration>
-                           <instance>${basedir}/target/server0</instance>
-                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                           <spawn>true</spawn>
+                           <testURI>tcp://localhost:61616</testURI>
+                           <args>
+                              <param>run</param>
+                           </args>
                         </configuration>
                      </execution>
                      <execution>
@@ -73,8 +77,16 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.JMSContextExample</clientClass>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>stop</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
                            <args>
-                              <param>${basedir}/target/server0</param>
+                              <param>stop</param>
                            </args>
                         </configuration>
                      </execution>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/jms-context/src/main/java/org/apache/activemq/artemis/jms/example/JMSContextExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/jms-context/src/main/java/org/apache/activemq/artemis/jms/example/JMSContextExample.java b/examples/jms/jms-context/src/main/java/org/apache/activemq/artemis/jms/example/JMSContextExample.java
index 81e7a9d..bb8457f 100644
--- a/examples/jms/jms-context/src/main/java/org/apache/activemq/artemis/jms/example/JMSContextExample.java
+++ b/examples/jms/jms-context/src/main/java/org/apache/activemq/artemis/jms/example/JMSContextExample.java
@@ -21,21 +21,14 @@ import javax.jms.DeliveryMode;
 import javax.jms.JMSContext;
 import javax.jms.Queue;
 import javax.naming.InitialContext;
-
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
+import java.lang.Exception;
 
 /**
  * A simple JMS Queue example that creates a producer and consumer on a queue and sends then receives a message.
  */
-public class JMSContextExample extends ActiveMQExample
+public class JMSContextExample
 {
-   public static void main(final String[] args)
-   {
-      new JMSContextExample().run(args);
-   }
-
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(final String[] args) throws Exception
    {
       InitialContext initialContext = null;
       JMSContext jmsContext = null;
@@ -60,8 +53,6 @@ public class JMSContextExample extends ActiveMQExample
          String payLoad = jmsContext.createConsumer(queue).receiveBody(String.class);
 
          System.out.println("payLoad = " + payLoad);
-
-         return true;
       }
       finally
       {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/jms-context/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/jms-context/src/main/resources/activemq/server0/artemis-roles.properties b/examples/jms/jms-context/src/main/resources/activemq/server0/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/jms-context/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/jms-context/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/jms-context/src/main/resources/activemq/server0/artemis-users.properties b/examples/jms/jms-context/src/main/resources/activemq/server0/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/jms-context/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/jms-context/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/jms-context/src/main/resources/activemq/server0/broker.xml b/examples/jms/jms-context/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index 7690094..0000000
--- a/examples/jms/jms-context/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,60 +0,0 @@
-<?xml version='1.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.
--->
-
-<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-               xmlns="urn:activemq"
-               xsi:schemaLocation="urn:activemq /schema/artemis-server.xsd">
-
-   <jms xmlns="urn:activemq:jms">
-      <!--the queue used by the example-->
-      <queue name="exampleQueue"/>
-   </jms>
-
-   <core xmlns="urn:activemq:core">
-
-      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
-
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
-
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
-
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
-      </acceptors>
-
-      <!-- Other config -->
-
-      <security-settings>
-         <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
-            <permission type="createDurableQueue" roles="guest"/>
-            <permission type="deleteDurableQueue" roles="guest"/>
-            <permission type="createNonDurableQueue" roles="guest"/>
-            <permission type="deleteNonDurableQueue" roles="guest"/>
-            <permission type="consume" roles="guest"/>
-            <permission type="send" roles="guest"/>
-         </security-setting>
-      </security-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/jms-shared-consumer/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/jms-shared-consumer/pom.xml b/examples/jms/jms-shared-consumer/pom.xml
index 5939114..af55f86 100644
--- a/examples/jms/jms-shared-consumer/pom.xml
+++ b/examples/jms/jms-shared-consumer/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>
@@ -61,9 +56,18 @@ under the License.
                         <goals>
                            <goal>create</goal>
                         </goals>
+                     </execution>
+                     <execution>
+                        <id>start</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
                         <configuration>
-                           <instance>${basedir}/target/server0</instance>
-                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                           <spawn>true</spawn>
+                           <testURI>tcp://localhost:61616</testURI>
+                           <args>
+                              <param>run</param>
+                           </args>
                         </configuration>
                      </execution>
                      <execution>
@@ -73,8 +77,16 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.JMSSharedConsumerExample</clientClass>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>stop</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
                            <args>
-                              <param>${basedir}/target/server0</param>
+                              <param>stop</param>
                            </args>
                         </configuration>
                      </execution>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/jms-shared-consumer/src/main/java/org/apache/activemq/artemis/jms/example/JMSSharedConsumerExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/jms-shared-consumer/src/main/java/org/apache/activemq/artemis/jms/example/JMSSharedConsumerExample.java b/examples/jms/jms-shared-consumer/src/main/java/org/apache/activemq/artemis/jms/example/JMSSharedConsumerExample.java
index 5c50063..c45f79b 100644
--- a/examples/jms/jms-shared-consumer/src/main/java/org/apache/activemq/artemis/jms/example/JMSSharedConsumerExample.java
+++ b/examples/jms/jms-shared-consumer/src/main/java/org/apache/activemq/artemis/jms/example/JMSSharedConsumerExample.java
@@ -23,21 +23,13 @@ import javax.jms.JMSProducer;
 import javax.jms.Topic;
 import javax.naming.InitialContext;
 
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
-
 /**
  * A JMS Example that uses shared consumers.
  */
-public class JMSSharedConsumerExample extends ActiveMQExample
+public class JMSSharedConsumerExample
 {
    public static void main(final String[] args) throws Exception
    {
-      new JMSSharedConsumerExample().run(args);
-   }
-
-   @Override
-   public boolean runExample() throws Exception
-   {
       InitialContext initialContext = null;
       JMSContext jmsContext = null;
       JMSContext jmsContext2 = null;
@@ -80,8 +72,6 @@ public class JMSSharedConsumerExample extends ActiveMQExample
          body = jmsConsumer2.receiveBody(String.class, 5000);
 
          System.out.println("body = " + body);
-
-         return true;
       }
       finally
       {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/jms-shared-consumer/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/jms-shared-consumer/src/main/resources/activemq/server0/broker.xml b/examples/jms/jms-shared-consumer/src/main/resources/activemq/server0/broker.xml
index 0ee3f9d..2b2ba2e 100644
--- a/examples/jms/jms-shared-consumer/src/main/resources/activemq/server0/broker.xml
+++ b/examples/jms/jms-shared-consumer/src/main/resources/activemq/server0/broker.xml
@@ -29,15 +29,16 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
+      <bindings-directory>${data.dir:../data}/bindings</bindings-directory>
 
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
+      <journal-directory>${data.dir:../data}/journal</journal-directory>
 
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
+      <large-messages-directory>${data.dir:../data}/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
+      <paging-directory>${data.dir:../data}/paging</paging-directory>
 
       <!-- Acceptors -->
+
       <acceptors>
          <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
       </acceptors>
@@ -45,7 +46,7 @@ under the License.
       <!-- Other config -->
 
       <security-settings>
-         <!--security for example queue-->
+         <!--security for example topic-->
          <security-setting match="jms.topic.exampleTopic">
             <permission type="createDurableQueue" roles="guest"/>
             <permission type="deleteDurableQueue" roles="guest"/>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/jmx/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/jmx/pom.xml b/examples/jms/jmx/pom.xml
index f9a3e9a..802025d 100644
--- a/examples/jms/jmx/pom.xml
+++ b/examples/jms/jmx/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.activemq</groupId>
          <artifactId>artemis-core-client</artifactId>
          <version>${project.version}</version>
@@ -77,14 +72,35 @@ under the License.
                         </configuration>
                      </execution>
                      <execution>
+                        <id>start</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
+                           <spawn>true</spawn>
+                           <testURI>tcp://localhost:61616</testURI>
+                           <args>
+                              <param>run</param>
+                           </args>
+                        </configuration>
+                     </execution>
+                     <execution>
                         <id>runClient</id>
                         <goals>
                            <goal>runClient</goal>
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.JMXExample</clientClass>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>stop</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
                            <args>
-                              <param>${basedir}/target/server0</param>
+                              <param>stop</param>
                            </args>
                         </configuration>
                      </execution>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/jmx/src/main/java/org/apache/activemq/artemis/jms/example/JMXExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/jmx/src/main/java/org/apache/activemq/artemis/jms/example/JMXExample.java b/examples/jms/jmx/src/main/java/org/apache/activemq/artemis/jms/example/JMXExample.java
index ebdad1b..8d36d53 100644
--- a/examples/jms/jmx/src/main/java/org/apache/activemq/artemis/jms/example/JMXExample.java
+++ b/examples/jms/jmx/src/main/java/org/apache/activemq/artemis/jms/example/JMXExample.java
@@ -36,22 +36,15 @@ import javax.naming.InitialContext;
 
 import org.apache.activemq.artemis.api.core.management.ObjectNameBuilder;
 import org.apache.activemq.artemis.api.jms.management.JMSQueueControl;
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
 
 /**
  * An example that shows how to manage ActiveMQ Artemis using JMX.
  */
-public class JMXExample extends ActiveMQExample
+public class JMXExample
 {
    private static final String JMX_URL = "service:jmx:rmi:///jndi/rmi://localhost:3000/jmxrmi";
 
-   public static void main(final String[] args)
-   {
-      new JMXExample().run(args);
-   }
-
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(final String[] args) throws Exception
    {
       QueueConnection connection = null;
       InitialContext initialContext = null;
@@ -94,7 +87,7 @@ public class JMXExample extends ActiveMQExample
          // Step 12. Create a JMSQueueControl proxy to manage the queue on the server
          JMSQueueControl queueControl = MBeanServerInvocationHandler.newProxyInstance(mbsc,
                                                                                       on,
-                                                                                       JMSQueueControl.class,
+                                                                                      JMSQueueControl.class,
                                                                                       false);
          // Step 13. Display the number of messages in the queue
          System.out.println(queueControl.getName() + " contains " + queueControl.getMessageCount() + " messages");
@@ -119,8 +112,6 @@ public class JMXExample extends ActiveMQExample
          // The call will timeout after 5000ms and messageReceived will be null
          TextMessage messageReceived = (TextMessage)messageConsumer.receive(5000);
          System.out.println("Received message: " + messageReceived);
-
-         return true;
       }
       finally
       {
@@ -135,5 +126,4 @@ public class JMXExample extends ActiveMQExample
          }
       }
    }
-
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/large-message/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/large-message/pom.xml b/examples/jms/large-message/pom.xml
index dd3af5b..cc354e6 100644
--- a/examples/jms/large-message/pom.xml
+++ b/examples/jms/large-message/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>
@@ -61,10 +61,6 @@ under the License.
                         <goals>
                            <goal>create</goal>
                         </goals>
-                        <configuration>
-                           <instance>${basedir}/target/server0</instance>
-                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
-                        </configuration>
                      </execution>
                      <execution>
                         <id>runClient</id>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/large-message/src/main/java/org/apache/activemq/artemis/jms/example/LargeMessageExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/large-message/src/main/java/org/apache/activemq/artemis/jms/example/LargeMessageExample.java b/examples/jms/large-message/src/main/java/org/apache/activemq/artemis/jms/example/LargeMessageExample.java
index d154ed7..b7cf3de 100644
--- a/examples/jms/large-message/src/main/java/org/apache/activemq/artemis/jms/example/LargeMessageExample.java
+++ b/examples/jms/large-message/src/main/java/org/apache/activemq/artemis/jms/example/LargeMessageExample.java
@@ -16,6 +16,8 @@
  */
 package org.apache.activemq.artemis.jms.example;
 
+import org.apache.activemq.artemis.util.ServerUtil;
+
 import javax.jms.BytesMessage;
 import javax.jms.Connection;
 import javax.jms.ConnectionFactory;
@@ -32,19 +34,12 @@ import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
 import java.io.IOException;
 
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
-
 /**
  * This example demonstrates the ability of ActiveMQ Artemis to send and consume a very large message, much
  * bigger than can fit in RAM.
  */
-public class LargeMessageExample extends ActiveMQExample
+public class LargeMessageExample
 {
-   public static void main(final String[] args)
-   {
-      new LargeMessageExample().run(args);
-   }
-
    /**
     * The message we will send is size 2GiB, even though we are only running in 50MB of RAM on both
     * client and server.
@@ -54,14 +49,16 @@ public class LargeMessageExample extends ActiveMQExample
     */
    private static final long FILE_SIZE = 2L * 1024 * 1024 * 1024; // 2 GiB message
 
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(final String[] args) throws Exception
    {
+      Process server = null;
       Connection connection = null;
       InitialContext initialContext = null;
 
       try
       {
+         server = ServerUtil.startServer(args[0], LargeMessageExample.class.getSimpleName(), 0, 5000);
+
          // Step 1. Create an initial context to perform the JNDI lookup.
          initialContext = new InitialContext();
 
@@ -83,8 +80,8 @@ public class LargeMessageExample extends ActiveMQExample
          // Step 5. Create a huge file - this will form the body of the message we will send.
 
          System.out.println("Creating a file to send of size " + FILE_SIZE +
-                            " bytes. This may take a little while... " +
-                            "If this is too big for your disk you can easily change the FILE_SIZE in the example.");
+                                    " bytes. This may take a little while... " +
+                                    "If this is too big for your disk you can easily change the FILE_SIZE in the example.");
 
          File fileInput = new File("huge_message_to_send.dat");
 
@@ -122,12 +119,9 @@ public class LargeMessageExample extends ActiveMQExample
 
          initialContext.close();
 
-         killServer(0);
-
-         // Give the server a little time to shutdown properly
-         Thread.sleep(5000);
+         ServerUtil.killServer(server);
 
-         reStartServer(0, 60000);
+         server = ServerUtil.startServer(args[0], "LargeMessageExample", 0, 5000);
 
          System.out.println("Server restarted.");
 
@@ -154,7 +148,7 @@ public class LargeMessageExample extends ActiveMQExample
          BytesMessage messageReceived = (BytesMessage)messageConsumer.receive(120000);
 
          System.out.println("Received message with: " + messageReceived.getLongProperty("_AMQ_LARGE_SIZE") +
-                            " bytes. Now streaming to file on disk.");
+                                    " bytes. Now streaming to file on disk.");
 
          // Step 13. We set an OutputStream on the message. This causes the message body to be written to the
          // OutputStream until there are no more bytes to be written.
@@ -174,8 +168,6 @@ public class LargeMessageExample extends ActiveMQExample
          fileOutputStream.close();
 
          System.out.println("File streamed to disk. Size of received file on disk is " + outputFile.length());
-
-         return true;
       }
       finally
       {
@@ -189,6 +181,8 @@ public class LargeMessageExample extends ActiveMQExample
          {
             connection.close();
          }
+
+         ServerUtil.killServer(server);
       }
    }
 
@@ -198,7 +192,7 @@ public class LargeMessageExample extends ActiveMQExample
     * @throws FileNotFoundException
     * @throws IOException
     */
-   private void createFile(final File file, final long fileSize) throws IOException
+   private static void createFile(final File file, final long fileSize) throws IOException
    {
       FileOutputStream fileOut = new FileOutputStream(file);
       BufferedOutputStream buffOut = new BufferedOutputStream(fileOut);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/large-message/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/large-message/src/main/resources/activemq/server0/artemis-roles.properties b/examples/jms/large-message/src/main/resources/activemq/server0/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/large-message/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/large-message/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/large-message/src/main/resources/activemq/server0/artemis-users.properties b/examples/jms/large-message/src/main/resources/activemq/server0/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/large-message/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/large-message/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/large-message/src/main/resources/activemq/server0/broker.xml b/examples/jms/large-message/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index 7690094..0000000
--- a/examples/jms/large-message/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,60 +0,0 @@
-<?xml version='1.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.
--->
-
-<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-               xmlns="urn:activemq"
-               xsi:schemaLocation="urn:activemq /schema/artemis-server.xsd">
-
-   <jms xmlns="urn:activemq:jms">
-      <!--the queue used by the example-->
-      <queue name="exampleQueue"/>
-   </jms>
-
-   <core xmlns="urn:activemq:core">
-
-      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
-
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
-
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
-
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
-      </acceptors>
-
-      <!-- Other config -->
-
-      <security-settings>
-         <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
-            <permission type="createDurableQueue" roles="guest"/>
-            <permission type="deleteDurableQueue" roles="guest"/>
-            <permission type="createNonDurableQueue" roles="guest"/>
-            <permission type="deleteNonDurableQueue" roles="guest"/>
-            <permission type="consume" roles="guest"/>
-            <permission type="send" roles="guest"/>
-         </security-setting>
-      </security-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/last-value-queue/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/last-value-queue/pom.xml b/examples/jms/last-value-queue/pom.xml
index 61f9b7b..15e9d38 100644
--- a/examples/jms/last-value-queue/pom.xml
+++ b/examples/jms/last-value-queue/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>
@@ -61,9 +56,18 @@ under the License.
                         <goals>
                            <goal>create</goal>
                         </goals>
+                     </execution>
+                     <execution>
+                        <id>start</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
                         <configuration>
-                           <instance>${basedir}/target/server0</instance>
-                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                           <spawn>true</spawn>
+                           <testURI>tcp://localhost:61616</testURI>
+                           <args>
+                              <param>run</param>
+                           </args>
                         </configuration>
                      </execution>
                      <execution>
@@ -73,8 +77,16 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.LastValueQueueExample</clientClass>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>stop</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
                            <args>
-                              <param>${basedir}/target/server0</param>
+                              <param>stop</param>
                            </args>
                         </configuration>
                      </execution>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/last-value-queue/src/main/java/org/apache/activemq/artemis/jms/example/LastValueQueueExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/last-value-queue/src/main/java/org/apache/activemq/artemis/jms/example/LastValueQueueExample.java b/examples/jms/last-value-queue/src/main/java/org/apache/activemq/artemis/jms/example/LastValueQueueExample.java
index ed0b6f8..72b001b 100644
--- a/examples/jms/last-value-queue/src/main/java/org/apache/activemq/artemis/jms/example/LastValueQueueExample.java
+++ b/examples/jms/last-value-queue/src/main/java/org/apache/activemq/artemis/jms/example/LastValueQueueExample.java
@@ -28,21 +28,13 @@ import javax.jms.Session;
 import javax.jms.TextMessage;
 import javax.naming.InitialContext;
 
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
-
 /**
  * This example shows how to configure and use a <em>Last-Value</em> queues.
  * Only the last message with a well-defined property is hold by the queue.
  */
-public class LastValueQueueExample extends ActiveMQExample
+public class LastValueQueueExample
 {
-   public static void main(final String[] args)
-   {
-      new LastValueQueueExample().run(args);
-   }
-
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(final String[] args) throws Exception
    {
       Connection connection = null;
       InitialContext initialContext = null;
@@ -108,8 +100,6 @@ public class LastValueQueueExample extends ActiveMQExample
          System.out.format("Received message: %s%n", messageReceived);
 
          initialContext.close();
-
-         return true;
       }
       finally
       {
@@ -124,5 +114,4 @@ public class LastValueQueueExample extends ActiveMQExample
          }
       }
    }
-
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/management-notifications/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/management-notifications/pom.xml b/examples/jms/management-notifications/pom.xml
index 9e023e0..8caa70f 100644
--- a/examples/jms/management-notifications/pom.xml
+++ b/examples/jms/management-notifications/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>
@@ -61,9 +56,18 @@ under the License.
                         <goals>
                            <goal>create</goal>
                         </goals>
+                     </execution>
+                     <execution>
+                        <id>start</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
                         <configuration>
-                           <instance>${basedir}/target/server0</instance>
-                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                           <spawn>true</spawn>
+                           <testURI>tcp://localhost:61616</testURI>
+                           <args>
+                              <param>run</param>
+                           </args>
                         </configuration>
                      </execution>
                      <execution>
@@ -73,8 +77,16 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.ManagementNotificationExample</clientClass>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>stop</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
                            <args>
-                              <param>${basedir}/target/server0</param>
+                              <param>stop</param>
                            </args>
                         </configuration>
                      </execution>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/management-notifications/src/main/java/org/apache/activemq/artemis/jms/example/ManagementNotificationExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/management-notifications/src/main/java/org/apache/activemq/artemis/jms/example/ManagementNotificationExample.java b/examples/jms/management-notifications/src/main/java/org/apache/activemq/artemis/jms/example/ManagementNotificationExample.java
index bdbceb9..9b26ae4 100644
--- a/examples/jms/management-notifications/src/main/java/org/apache/activemq/artemis/jms/example/ManagementNotificationExample.java
+++ b/examples/jms/management-notifications/src/main/java/org/apache/activemq/artemis/jms/example/ManagementNotificationExample.java
@@ -30,20 +30,12 @@ import javax.jms.Session;
 import javax.jms.Topic;
 import javax.naming.InitialContext;
 
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
-
 /**
  * An example that shows how to receive management notifications using JMS messages.
  */
-public class ManagementNotificationExample extends ActiveMQExample
+public class ManagementNotificationExample
 {
-   public static void main(final String[] args)
-   {
-      new ManagementNotificationExample().run(args);
-   }
-
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(final String[] args) throws Exception
    {
       Connection connection = null;
       InitialContext initialContext = null;
@@ -112,8 +104,6 @@ public class ManagementNotificationExample extends ActiveMQExample
          // sleep a little bit to be sure to receive the notification for the security
          // authentication violation before leaving the example
          Thread.sleep(2000);
-
-         return true;
       }
       finally
       {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/management/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/management/pom.xml b/examples/jms/management/pom.xml
index 1797ce1..d287c28 100644
--- a/examples/jms/management/pom.xml
+++ b/examples/jms/management/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-jms-client</artifactId>
          <version>${project.version}</version>
       </dependency>
       <dependency>
@@ -61,9 +61,18 @@ under the License.
                         <goals>
                            <goal>create</goal>
                         </goals>
+                     </execution>
+                     <execution>
+                        <id>start</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
                         <configuration>
-                           <instance>${basedir}/target/server0</instance>
-                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                           <spawn>true</spawn>
+                           <testURI>tcp://localhost:61616</testURI>
+                           <args>
+                              <param>run</param>
+                           </args>
                         </configuration>
                      </execution>
                      <execution>
@@ -73,8 +82,16 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.ManagementExample</clientClass>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>stop</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
                            <args>
-                              <param>${basedir}/target/server0</param>
+                              <param>stop</param>
                            </args>
                         </configuration>
                      </execution>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/management/src/main/java/org/apache/activemq/artemis/jms/example/ManagementExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/management/src/main/java/org/apache/activemq/artemis/jms/example/ManagementExample.java b/examples/jms/management/src/main/java/org/apache/activemq/artemis/jms/example/ManagementExample.java
index 4ed1a59..fd92ddc 100644
--- a/examples/jms/management/src/main/java/org/apache/activemq/artemis/jms/example/ManagementExample.java
+++ b/examples/jms/management/src/main/java/org/apache/activemq/artemis/jms/example/ManagementExample.java
@@ -30,20 +30,13 @@ import javax.naming.InitialContext;
 
 import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
 import org.apache.activemq.artemis.api.jms.management.JMSManagementHelper;
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
 
 /**
  * An example that shows how to manage ActiveMQ Artemis using JMS messages.
  */
-public class ManagementExample extends ActiveMQExample
+public class ManagementExample
 {
-   public static void main(final String[] args)
-   {
-      new ManagementExample().run(args);
-   }
-
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(final String[] args) throws Exception
    {
       QueueConnection connection = null;
       InitialContext initialContext = null;
@@ -131,8 +124,6 @@ public class ManagementExample extends ActiveMQExample
          // there is none to consume. The call will timeout after 5000ms and messageReceived will be null
          TextMessage messageReceived = (TextMessage)messageConsumer.receive(5000);
          System.out.println("Received message: " + messageReceived);
-
-         return true;
       }
       finally
       {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/message-counters/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/message-counters/pom.xml b/examples/jms/message-counters/pom.xml
index f4d8753..7cd17e3 100644
--- a/examples/jms/message-counters/pom.xml
+++ b/examples/jms/message-counters/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-jms-client</artifactId>
          <version>${project.version}</version>
       </dependency>
       <dependency>
@@ -67,21 +67,39 @@ under the License.
                            <goal>create</goal>
                         </goals>
                         <configuration>
-                           <instance>${basedir}/target/server0</instance>
-                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
-                           <!-- options used for JMX on the example -->
                            <javaOptions>-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=3001 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false</javaOptions>
                         </configuration>
                      </execution>
                      <execution>
+                        <id>start</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
+                           <spawn>true</spawn>
+                           <testURI>tcp://localhost:61616</testURI>
+                           <args>
+                              <param>run</param>
+                           </args>
+                        </configuration>
+                     </execution>
+                     <execution>
                         <id>runClient</id>
                         <goals>
                            <goal>runClient</goal>
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.MessageCounterExample</clientClass>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>stop</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
                            <args>
-                              <param>${basedir}/target/server0</param>
+                              <param>stop</param>
                            </args>
                         </configuration>
                      </execution>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/message-counters/src/main/java/org/apache/activemq/artemis/jms/example/MessageCounterExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/message-counters/src/main/java/org/apache/activemq/artemis/jms/example/MessageCounterExample.java b/examples/jms/message-counters/src/main/java/org/apache/activemq/artemis/jms/example/MessageCounterExample.java
index 5f8e4e0..1e9865f 100644
--- a/examples/jms/message-counters/src/main/java/org/apache/activemq/artemis/jms/example/MessageCounterExample.java
+++ b/examples/jms/message-counters/src/main/java/org/apache/activemq/artemis/jms/example/MessageCounterExample.java
@@ -37,22 +37,15 @@ import javax.naming.InitialContext;
 import org.apache.activemq.artemis.api.core.management.MessageCounterInfo;
 import org.apache.activemq.artemis.api.core.management.ObjectNameBuilder;
 import org.apache.activemq.artemis.api.jms.management.JMSQueueControl;
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
 
 /**
  * An example showing how to use message counters to have information on a queue.
  */
-public class MessageCounterExample extends ActiveMQExample
+public class MessageCounterExample
 {
    private static final String JMX_URL = "service:jmx:rmi:///jndi/rmi://localhost:3001/jmxrmi";
 
-   public static void main(final String[] args)
-   {
-      new MessageCounterExample().run(args);
-   }
-
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(final String[] args) throws Exception
    {
       QueueConnection connection = null;
       InitialContext initialContext = null;
@@ -84,7 +77,7 @@ public class MessageCounterExample extends ActiveMQExample
          // Step 7. Use JMX to retrieve the message counters using the JMSQueueControl
          ObjectName on = ObjectNameBuilder.DEFAULT.getJMSQueueObjectName(queue.getQueueName());
          JMXConnector connector =
-                  JMXConnectorFactory.connect(new JMXServiceURL(JMX_URL), new HashMap<String, Object>());
+                 JMXConnectorFactory.connect(new JMXServiceURL(JMX_URL), new HashMap<String, Object>());
          MBeanServerConnection mbsc = connector.getMBeanServerConnection();
          JMSQueueControl queueControl = MBeanServerInvocationHandler.newProxyInstance(mbsc,
                                                                                       on,
@@ -125,8 +118,6 @@ public class MessageCounterExample extends ActiveMQExample
          counters = queueControl.listMessageCounter();
          messageCounter = MessageCounterInfo.fromJSON(counters);
          displayMessageCounter(messageCounter);
-
-         return true;
       }
       finally
       {
@@ -142,7 +133,7 @@ public class MessageCounterExample extends ActiveMQExample
       }
    }
 
-   private void displayMessageCounter(final MessageCounterInfo counter)
+   private static void displayMessageCounter(final MessageCounterInfo counter)
    {
       System.out.format("%s (sample updated at %s)%n", counter.getName(), counter.getUdpateTimestamp());
       System.out.format("   %s message(s) added to the queue (since last sample: %s)%n",

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/message-group/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/message-group/pom.xml b/examples/jms/message-group/pom.xml
index e2e6b14..cfd67fb 100644
--- a/examples/jms/message-group/pom.xml
+++ b/examples/jms/message-group/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>
@@ -61,9 +56,18 @@ under the License.
                         <goals>
                            <goal>create</goal>
                         </goals>
+                     </execution>
+                     <execution>
+                        <id>start</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
                         <configuration>
-                           <instance>${basedir}/target/server0</instance>
-                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                           <spawn>true</spawn>
+                           <testURI>tcp://localhost:61616</testURI>
+                           <args>
+                              <param>run</param>
+                           </args>
                         </configuration>
                      </execution>
                      <execution>
@@ -73,8 +77,16 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.MessageGroupExample</clientClass>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>stop</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
                            <args>
-                              <param>${basedir}/target/server0</param>
+                              <param>stop</param>
                            </args>
                         </configuration>
                      </execution>


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

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/static-selector/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/static-selector/pom.xml b/examples/jms/static-selector/pom.xml
index cf08771..54881c9 100644
--- a/examples/jms/static-selector/pom.xml
+++ b/examples/jms/static-selector/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>
@@ -61,9 +56,18 @@ under the License.
                         <goals>
                            <goal>create</goal>
                         </goals>
+                     </execution>
+                     <execution>
+                        <id>start</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
                         <configuration>
-                           <instance>${basedir}/target/server0</instance>
-                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                           <spawn>true</spawn>
+                           <testURI>tcp://localhost:61616</testURI>
+                           <args>
+                              <param>run</param>
+                           </args>
                         </configuration>
                      </execution>
                      <execution>
@@ -73,8 +77,16 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.StaticSelectorExample</clientClass>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>stop</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
                            <args>
-                              <param>${basedir}/target/server0</param>
+                              <param>stop</param>
                            </args>
                         </configuration>
                      </execution>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/static-selector/src/main/java/org/apache/activemq/artemis/jms/example/StaticSelectorExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/static-selector/src/main/java/org/apache/activemq/artemis/jms/example/StaticSelectorExample.java b/examples/jms/static-selector/src/main/java/org/apache/activemq/artemis/jms/example/StaticSelectorExample.java
index b844994..532ca50 100644
--- a/examples/jms/static-selector/src/main/java/org/apache/activemq/artemis/jms/example/StaticSelectorExample.java
+++ b/examples/jms/static-selector/src/main/java/org/apache/activemq/artemis/jms/example/StaticSelectorExample.java
@@ -27,24 +27,16 @@ import javax.jms.Queue;
 import javax.jms.Session;
 import javax.jms.TextMessage;
 import javax.naming.InitialContext;
-
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
+import java.util.concurrent.atomic.AtomicBoolean;
 
 /**
  * A simple JMS example that shows how static message selectors work.
  */
-public class StaticSelectorExample extends ActiveMQExample
+public class StaticSelectorExample
 {
-   private volatile boolean result = true;
-
-   public static void main(final String[] args)
-   {
-      new StaticSelectorExample().run(args);
-   }
-
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(final String[] args) throws Exception
    {
+      AtomicBoolean result = new AtomicBoolean(true);
       Connection connection = null;
       InitialContext initialContext = null;
       try
@@ -73,7 +65,7 @@ public class StaticSelectorExample extends ActiveMQExample
 
          // Step 8. Create a JMS Message Consumer that receives 'red' messages
          MessageConsumer redConsumer = session.createConsumer(queue);
-         redConsumer.setMessageListener(new SimpleMessageListener("red"));
+         redConsumer.setMessageListener(new SimpleMessageListener("red", result));
 
          // Step 9. Create five messages with different 'color' properties
          TextMessage redMessage1 = session.createTextMessage("Red-1");
@@ -101,7 +93,8 @@ public class StaticSelectorExample extends ActiveMQExample
          // Step 11. Waiting for the message listener to check the received messages.
          Thread.sleep(5000);
 
-         return result;
+         if (!result.get())
+            throw new IllegalStateException();
       }
       finally
       {
@@ -116,38 +109,40 @@ public class StaticSelectorExample extends ActiveMQExample
          }
       }
    }
+}
 
-   public class SimpleMessageListener implements MessageListener
-   {
-      private final String name;
 
-      public SimpleMessageListener(final String listener)
-      {
-         name = listener;
-      }
+class SimpleMessageListener implements MessageListener
+{
+   private final String name;
+   private AtomicBoolean result;
 
-      public void onMessage(final Message msg)
+   public SimpleMessageListener(final String listener, AtomicBoolean result)
+   {
+      name = listener;
+      this.result = result;
+   }
+
+   public void onMessage(final Message msg)
+   {
+      TextMessage textMessage = (TextMessage)msg;
+      try
       {
-         TextMessage textMessage = (TextMessage)msg;
-         try
+         String colorProp = msg.getStringProperty("color");
+         System.out.println("Receiver " + name +
+                                    " receives message [" +
+                                    textMessage.getText() +
+                                    "] with color property: " +
+                                    colorProp);
+         if (colorProp != null && !colorProp.equals(name))
          {
-            String colorProp = msg.getStringProperty("color");
-            System.out.println("Receiver " + name +
-                               " receives message [" +
-                               textMessage.getText() +
-                               "] with color property: " +
-                               colorProp);
-            if (colorProp != null && !colorProp.equals(name))
-            {
-               result = false;
-            }
-         }
-         catch (JMSException e)
-         {
-            e.printStackTrace();
-            result = false;
+            result.set(false);
          }
       }
+      catch (JMSException e)
+      {
+         e.printStackTrace();
+         result.set(false);
+      }
    }
-
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/stomp-websockets/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/stomp-websockets/pom.xml b/examples/jms/stomp-websockets/pom.xml
index d64b66d..64c3ced 100644
--- a/examples/jms/stomp-websockets/pom.xml
+++ b/examples/jms/stomp-websockets/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>
@@ -61,9 +56,18 @@ under the License.
                         <goals>
                            <goal>create</goal>
                         </goals>
+                     </execution>
+                     <execution>
+                        <id>start</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
                         <configuration>
-                           <instance>${basedir}/target/server0</instance>
-                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                           <spawn>true</spawn>
+                           <testURI>tcp://localhost:61616</testURI>
+                           <args>
+                              <param>run</param>
+                           </args>
                         </configuration>
                      </execution>
                      <execution>
@@ -73,8 +77,16 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.StompWebSocketExample</clientClass>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>stop</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
                            <args>
-                              <param>${basedir}/target/server0</param>
+                              <param>stop</param>
                            </args>
                         </configuration>
                      </execution>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/stomp-websockets/src/main/java/org/apache/activemq/artemis/jms/example/StompWebSocketExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/stomp-websockets/src/main/java/org/apache/activemq/artemis/jms/example/StompWebSocketExample.java b/examples/jms/stomp-websockets/src/main/java/org/apache/activemq/artemis/jms/example/StompWebSocketExample.java
index fcaa63a..7260a09 100644
--- a/examples/jms/stomp-websockets/src/main/java/org/apache/activemq/artemis/jms/example/StompWebSocketExample.java
+++ b/examples/jms/stomp-websockets/src/main/java/org/apache/activemq/artemis/jms/example/StompWebSocketExample.java
@@ -27,21 +27,13 @@ import javax.jms.TextMessage;
 import javax.jms.Topic;
 import javax.naming.InitialContext;
 
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
-
 /**
  * An example where a client will send a JMS message to a Topic.
  * Browser clients connected using Web Sockets will be able to receive the message.
  */
-public class StompWebSocketExample extends ActiveMQExample
+public class StompWebSocketExample
 {
-   public static void main(final String[] args)
-   {
-      new StompWebSocketExample().run(args);
-   }
-
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(final String[] args) throws Exception
    {
       Connection connection = null;
       InitialContext initialContext = null;
@@ -70,8 +62,6 @@ public class StompWebSocketExample extends ActiveMQExample
 
          message = (TextMessage)consumer.receive();
          System.out.println("Received message: " + message.getText());
-
-         return true;
       }
       finally
       {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/stomp-websockets/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/stomp-websockets/src/main/resources/activemq/server0/artemis-roles.properties b/examples/jms/stomp-websockets/src/main/resources/activemq/server0/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/stomp-websockets/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/stomp-websockets/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/stomp-websockets/src/main/resources/activemq/server0/artemis-users.properties b/examples/jms/stomp-websockets/src/main/resources/activemq/server0/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/stomp-websockets/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/stomp-websockets/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/stomp-websockets/src/main/resources/activemq/server0/broker.xml b/examples/jms/stomp-websockets/src/main/resources/activemq/server0/broker.xml
index ce256a9..efceecf 100644
--- a/examples/jms/stomp-websockets/src/main/resources/activemq/server0/broker.xml
+++ b/examples/jms/stomp-websockets/src/main/resources/activemq/server0/broker.xml
@@ -29,13 +29,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
+      <bindings-directory>${data.dir:./data}/bindings</bindings-directory>
 
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
+      <journal-directory>${data.dir:./data}/journal</journal-directory>
 
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
+      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
+      <paging-directory>${data.dir:./data}/paging</paging-directory>
 
       <!-- Acceptors -->
       <acceptors>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/stomp/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/stomp/pom.xml b/examples/jms/stomp/pom.xml
index 809e433..867827d 100644
--- a/examples/jms/stomp/pom.xml
+++ b/examples/jms/stomp/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>
@@ -61,9 +56,18 @@ under the License.
                         <goals>
                            <goal>create</goal>
                         </goals>
+                     </execution>
+                     <execution>
+                        <id>start</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
                         <configuration>
-                           <instance>${basedir}/target/server0</instance>
-                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                           <spawn>true</spawn>
+                           <testURI>tcp://localhost:61616</testURI>
+                           <args>
+                              <param>run</param>
+                           </args>
                         </configuration>
                      </execution>
                      <execution>
@@ -73,8 +77,16 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.StompExample</clientClass>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>stop</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
                            <args>
-                              <param>${basedir}/target/server0</param>
+                              <param>stop</param>
                            </args>
                         </configuration>
                      </execution>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/stomp/src/main/java/org/apache/activemq/artemis/jms/example/StompExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/stomp/src/main/java/org/apache/activemq/artemis/jms/example/StompExample.java b/examples/jms/stomp/src/main/java/org/apache/activemq/artemis/jms/example/StompExample.java
index bf10f6f..0d4f28f 100644
--- a/examples/jms/stomp/src/main/java/org/apache/activemq/artemis/jms/example/StompExample.java
+++ b/examples/jms/stomp/src/main/java/org/apache/activemq/artemis/jms/example/StompExample.java
@@ -29,24 +29,15 @@ import javax.jms.Session;
 import javax.jms.TextMessage;
 import javax.naming.InitialContext;
 
-
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
-
 /**
  * An example where a client will send a Stomp message on a TCP socket
  * and consume it from a JMS MessageConsumer.
  */
-public class StompExample extends ActiveMQExample
+public class StompExample
 {
    private static final String END_OF_FRAME = "\u0000";
 
-   public static void main(final String[] args)
-   {
-      new StompExample().run(args);
-   }
-
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(final String[] args) throws Exception
    {
       Connection connection = null;
       InitialContext initialContext = null;
@@ -58,11 +49,11 @@ public class StompExample extends ActiveMQExample
 
          // Step 2. Send a CONNECT frame to connect to the server
          String connectFrame = "CONNECT\n" +
-            "login: guest\n" +
-            "passcode: guest\n" +
-            "request-id: 1\n" +
-            "\n" +
-            END_OF_FRAME;
+                 "login: guest\n" +
+                 "passcode: guest\n" +
+                 "request-id: 1\n" +
+                 "\n" +
+                 END_OF_FRAME;
          sendFrame(socket, connectFrame);
 
          readFrame(socket);
@@ -71,17 +62,17 @@ public class StompExample extends ActiveMQExample
          // jms.queue.exampleQueue address with a text body
          String text = "Hello, world from Stomp!";
          String message = "SEND\n" +
-            "destination: jms.queue.exampleQueue\n" +
-            "\n" +
-            text +
-            END_OF_FRAME;
+                 "destination: jms.queue.exampleQueue\n" +
+                 "\n" +
+                 text +
+                 END_OF_FRAME;
          sendFrame(socket, message);
          System.out.println("Sent Stomp message: " + text);
 
          // Step 4. Send a DISCONNECT frame to disconnect from the server
          String disconnectFrame = "DISCONNECT\n" +
-            "\n" +
-            END_OF_FRAME;
+                 "\n" +
+                 END_OF_FRAME;
          sendFrame(socket, disconnectFrame);
 
          // Step 5. Slose the TCP socket
@@ -107,8 +98,6 @@ public class StompExample extends ActiveMQExample
          // Step 10. Receive the message
          TextMessage messageReceived = (TextMessage)consumer.receive(5000);
          System.out.println("Received JMS message: " + messageReceived.getText());
-
-         return true;
       }
       finally
       {

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

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/stomp1.1/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/stomp1.1/pom.xml b/examples/jms/stomp1.1/pom.xml
index 14e9a76..b17e9c0 100644
--- a/examples/jms/stomp1.1/pom.xml
+++ b/examples/jms/stomp1.1/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>
@@ -61,9 +56,18 @@ under the License.
                         <goals>
                            <goal>create</goal>
                         </goals>
+                     </execution>
+                     <execution>
+                        <id>start</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
                         <configuration>
-                           <instance>${basedir}/target/server0</instance>
-                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                           <spawn>true</spawn>
+                           <testURI>tcp://localhost:61616</testURI>
+                           <args>
+                              <param>run</param>
+                           </args>
                         </configuration>
                      </execution>
                      <execution>
@@ -73,8 +77,16 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.StompExample</clientClass>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>stop</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
                            <args>
-                              <param>${basedir}/target/server0</param>
+                              <param>stop</param>
                            </args>
                         </configuration>
                      </execution>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/stomp1.1/src/main/java/org/apache/activemq/artemis/jms/example/StompExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/stomp1.1/src/main/java/org/apache/activemq/artemis/jms/example/StompExample.java b/examples/jms/stomp1.1/src/main/java/org/apache/activemq/artemis/jms/example/StompExample.java
index ee03b85..7d3b3cc 100644
--- a/examples/jms/stomp1.1/src/main/java/org/apache/activemq/artemis/jms/example/StompExample.java
+++ b/examples/jms/stomp1.1/src/main/java/org/apache/activemq/artemis/jms/example/StompExample.java
@@ -29,23 +29,15 @@ import javax.jms.Session;
 import javax.jms.TextMessage;
 import javax.naming.InitialContext;
 
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
-
 /**
  * An example where a Stomp 1.1 client sends a message on a TCP socket
  * and consumes it from a JMS MessageConsumer.
  */
-public class StompExample extends ActiveMQExample
+public class StompExample
 {
    private static final String END_OF_FRAME = "\u0000";
 
-   public static void main(final String[] args)
-   {
-      new StompExample().run(args);
-   }
-
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(final String[] args) throws Exception
    {
       Connection connection = null;
       InitialContext initialContext = null;
@@ -57,13 +49,13 @@ public class StompExample extends ActiveMQExample
 
          // Step 2. Send a CONNECT frame to connect to the server
          String connectFrame = "CONNECT\n" +
-            "accept-version:1.1\n" +
-            "host:localhost\n" +
-            "login:guest\n" +
-            "passcode:guest\n" +
-            "request-id:1\n" +
-            "\n" +
-            END_OF_FRAME;
+                 "accept-version:1.1\n" +
+                 "host:localhost\n" +
+                 "login:guest\n" +
+                 "passcode:guest\n" +
+                 "request-id:1\n" +
+                 "\n" +
+                 END_OF_FRAME;
          sendFrame(socket, connectFrame);
 
          String response = receiveFrame(socket);
@@ -73,17 +65,17 @@ public class StompExample extends ActiveMQExample
          // jms.queue.exampleQueue address with a text body
          String text = "Hello World from Stomp 1.1 !";
          String message = "SEND\n" +
-            "destination:jms.queue.exampleQueue\n" +
-            "\n" +
-            text +
-            END_OF_FRAME;
+                 "destination:jms.queue.exampleQueue\n" +
+                 "\n" +
+                 text +
+                 END_OF_FRAME;
          sendFrame(socket, message);
          System.out.println("Sent Stomp message: " + text);
 
          // Step 4. Send a DISCONNECT frame to disconnect from the server
          String disconnectFrame = "DISCONNECT\n" +
-            "\n" +
-            END_OF_FRAME;
+                 "\n" +
+                 END_OF_FRAME;
          sendFrame(socket, disconnectFrame);
 
          // Step 5. Slose the TCP socket
@@ -109,8 +101,6 @@ public class StompExample extends ActiveMQExample
          // Step 10. Receive the message
          TextMessage messageReceived = (TextMessage)consumer.receive(5000);
          System.out.println("Received JMS message: " + messageReceived.getText());
-
-         return true;
       }
       finally
       {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/stomp1.1/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/stomp1.1/src/main/resources/activemq/server0/artemis-roles.properties b/examples/jms/stomp1.1/src/main/resources/activemq/server0/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/stomp1.1/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/stomp1.1/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/stomp1.1/src/main/resources/activemq/server0/artemis-users.properties b/examples/jms/stomp1.1/src/main/resources/activemq/server0/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/stomp1.1/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/stomp1.1/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/stomp1.1/src/main/resources/activemq/server0/broker.xml b/examples/jms/stomp1.1/src/main/resources/activemq/server0/broker.xml
index b24f1da..9688ae9 100644
--- a/examples/jms/stomp1.1/src/main/resources/activemq/server0/broker.xml
+++ b/examples/jms/stomp1.1/src/main/resources/activemq/server0/broker.xml
@@ -29,13 +29,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
+      <bindings-directory>${data.dir:./data}/bindings</bindings-directory>
 
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
+      <journal-directory>${data.dir:./data}/journal</journal-directory>
 
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
+      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
+      <paging-directory>${data.dir:./data}/paging</paging-directory>
 
       <!-- Acceptors -->
       <acceptors>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/stomp1.2/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/stomp1.2/pom.xml b/examples/jms/stomp1.2/pom.xml
index c696d8b..e673181 100644
--- a/examples/jms/stomp1.2/pom.xml
+++ b/examples/jms/stomp1.2/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>
@@ -61,9 +56,18 @@ under the License.
                         <goals>
                            <goal>create</goal>
                         </goals>
+                     </execution>
+                     <execution>
+                        <id>start</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
                         <configuration>
-                           <instance>${basedir}/target/server0</instance>
-                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                           <spawn>true</spawn>
+                           <testURI>tcp://localhost:61616</testURI>
+                           <args>
+                              <param>run</param>
+                           </args>
                         </configuration>
                      </execution>
                      <execution>
@@ -73,8 +77,16 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.StompExample</clientClass>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>stop</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
                            <args>
-                              <param>${basedir}/target/server0</param>
+                              <param>stop</param>
                            </args>
                         </configuration>
                      </execution>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/stomp1.2/src/main/java/org/apache/activemq/artemis/jms/example/StompExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/stomp1.2/src/main/java/org/apache/activemq/artemis/jms/example/StompExample.java b/examples/jms/stomp1.2/src/main/java/org/apache/activemq/artemis/jms/example/StompExample.java
index f3a0ad7..fc978f7 100644
--- a/examples/jms/stomp1.2/src/main/java/org/apache/activemq/artemis/jms/example/StompExample.java
+++ b/examples/jms/stomp1.2/src/main/java/org/apache/activemq/artemis/jms/example/StompExample.java
@@ -28,23 +28,15 @@ import javax.jms.Session;
 import javax.jms.TextMessage;
 import javax.naming.InitialContext;
 
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
-
 /**
  * An example where a Stomp 1.2 client sends a message on a TCP socket
  * and consumes it from a JMS MessageConsumer.
  */
-public class StompExample extends ActiveMQExample
+public class StompExample
 {
    private static final String END_OF_FRAME = "\u0000";
 
-   public static void main(final String[] args)
-   {
-      new StompExample().run(args);
-   }
-
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(final String[] args) throws Exception
    {
       Connection connection = null;
       InitialContext initialContext = null;
@@ -56,13 +48,13 @@ public class StompExample extends ActiveMQExample
 
          // Step 2. Send a CONNECT frame to connect to the server
          String connectFrame = "CONNECT\n" +
-            "accept-version:1.2\n" +
-            "host:localhost\n" +
-            "login:guest\n" +
-            "passcode:guest\n" +
-            "request-id:1\n" +
-            "\n" +
-            END_OF_FRAME;
+                 "accept-version:1.2\n" +
+                 "host:localhost\n" +
+                 "login:guest\n" +
+                 "passcode:guest\n" +
+                 "request-id:1\n" +
+                 "\n" +
+                 END_OF_FRAME;
          sendFrame(socket, connectFrame);
 
          String response = receiveFrame(socket);
@@ -72,17 +64,17 @@ public class StompExample extends ActiveMQExample
          // jms.queue.exampleQueue address with a text body
          String text = "Hello World from Stomp 1.2 !";
          String message = "SEND\n" +
-            "destination:jms.queue.exampleQueue\n" +
-            "\n" +
-            text +
-            END_OF_FRAME;
+                 "destination:jms.queue.exampleQueue\n" +
+                 "\n" +
+                 text +
+                 END_OF_FRAME;
          sendFrame(socket, message);
          System.out.println("Sent Stomp message: " + text);
 
          // Step 4. Send a DISCONNECT frame to disconnect from the server
          String disconnectFrame = "DISCONNECT\n" +
-            "\n" +
-            END_OF_FRAME;
+                 "\n" +
+                 END_OF_FRAME;
          sendFrame(socket, disconnectFrame);
 
          // Step 5. Slose the TCP socket
@@ -108,8 +100,6 @@ public class StompExample extends ActiveMQExample
          // Step 10. Receive the message
          TextMessage messageReceived = (TextMessage)consumer.receive(5000);
          System.out.println("Received JMS message: " + messageReceived.getText());
-
-         return true;
       }
       finally
       {
@@ -147,7 +137,5 @@ public class StompExample extends ActiveMQExample
 
       String frame = new String(data, "UTF-8");
       return frame;
-
    }
-
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/stomp1.2/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/stomp1.2/src/main/resources/activemq/server0/artemis-roles.properties b/examples/jms/stomp1.2/src/main/resources/activemq/server0/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/stomp1.2/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/stomp1.2/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/stomp1.2/src/main/resources/activemq/server0/artemis-users.properties b/examples/jms/stomp1.2/src/main/resources/activemq/server0/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/stomp1.2/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/stomp1.2/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/stomp1.2/src/main/resources/activemq/server0/broker.xml b/examples/jms/stomp1.2/src/main/resources/activemq/server0/broker.xml
index b24f1da..9688ae9 100644
--- a/examples/jms/stomp1.2/src/main/resources/activemq/server0/broker.xml
+++ b/examples/jms/stomp1.2/src/main/resources/activemq/server0/broker.xml
@@ -29,13 +29,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
+      <bindings-directory>${data.dir:./data}/bindings</bindings-directory>
 
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
+      <journal-directory>${data.dir:./data}/journal</journal-directory>
 
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
+      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
+      <paging-directory>${data.dir:./data}/paging</paging-directory>
 
       <!-- Acceptors -->
       <acceptors>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/stop-server-failover/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/stop-server-failover/pom.xml b/examples/jms/stop-server-failover/pom.xml
index e1ebe90..2ba5e69 100644
--- a/examples/jms/stop-server-failover/pom.xml
+++ b/examples/jms/stop-server-failover/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,25 +52,59 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>create</id>
+                        <id>create0</id>
                         <goals>
                            <goal>create</goal>
                         </goals>
                         <configuration>
                            <instance>${basedir}/target/server0</instance>
-                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
-                           <javaOptions>-Dudp-address=${udp-address}</javaOptions>
+                           <sharedStore>true</sharedStore>
+                           <slave>false</slave>
+                           <dataFolder>../data</dataFolder>
+                           <failoverOnShutdown>true</failoverOnShutdown>
                         </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>
-                           <javaOptions>-Dudp-address=${udp-address}</javaOptions>
+                           <sharedStore>true</sharedStore>
+                           <slave>true</slave>
+                           <dataFolder>../data</dataFolder>
+                           <failoverOnShutdown>true</failoverOnShutdown>
+                        </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>
@@ -85,9 +114,29 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.StopServerFailoverExample</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>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/stop-server-failover/src/main/java/org/apache/activemq/artemis/jms/example/StopServerFailoverExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/stop-server-failover/src/main/java/org/apache/activemq/artemis/jms/example/StopServerFailoverExample.java b/examples/jms/stop-server-failover/src/main/java/org/apache/activemq/artemis/jms/example/StopServerFailoverExample.java
index 7f170f6..01ee51b 100644
--- a/examples/jms/stop-server-failover/src/main/java/org/apache/activemq/artemis/jms/example/StopServerFailoverExample.java
+++ b/examples/jms/stop-server-failover/src/main/java/org/apache/activemq/artemis/jms/example/StopServerFailoverExample.java
@@ -16,8 +16,6 @@
  */
 package org.apache.activemq.artemis.jms.example;
 
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
-
 import javax.jms.Connection;
 import javax.jms.ConnectionFactory;
 import javax.jms.JMSException;
@@ -32,15 +30,9 @@ import javax.naming.InitialContext;
  * A simple example that demonstrates failover of the JMS connection from one node to another
  * when the live server crashes using a JMS <em>non-transacted</em> session.
  */
-public class StopServerFailoverExample extends ActiveMQExample
+public class StopServerFailoverExample
 {
-   public static void main(final String[] args)
-   {
-      new StopServerFailoverExample().run(args);
-   }
-
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(final String[] args) throws Exception
    {
       final int numMessages = 10;
 
@@ -94,10 +86,9 @@ public class StopServerFailoverExample extends ActiveMQExample
             System.out.println("Got message: " + message0.getText());
          }
 
-         // Step 10. Crash server #1, the live server, and wait a little while to make sure
+         // Step 10. Crash server #0, the live server, and wait a little while to make sure
          // it has really crashed
-         Thread.sleep(5000);
-         System.out.println("stop the server by logging into jconsole");
+         System.out.println("Stop the live server by logging into JConsole and then press any key to continue...");
          System.in.read();
 
          // Step 11. Acknowledging the 2nd half of the sent messages will fail as failover to the
@@ -118,8 +109,6 @@ public class StopServerFailoverExample extends ActiveMQExample
             System.out.printf("Got message: %s (redelivered?: %s)\n", message0.getText(), message0.getJMSRedelivered());
          }
          message0.acknowledge();
-
-         return true;
       }
       finally
       {
@@ -136,5 +125,4 @@ public class StopServerFailoverExample extends ActiveMQExample
          }
       }
    }
-
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/stop-server-failover/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/stop-server-failover/src/main/resources/activemq/server0/artemis-roles.properties b/examples/jms/stop-server-failover/src/main/resources/activemq/server0/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/stop-server-failover/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/stop-server-failover/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/stop-server-failover/src/main/resources/activemq/server0/artemis-users.properties b/examples/jms/stop-server-failover/src/main/resources/activemq/server0/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/stop-server-failover/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/stop-server-failover/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/stop-server-failover/src/main/resources/activemq/server0/broker.xml b/examples/jms/stop-server-failover/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index 6ea24c1..0000000
--- a/examples/jms/stop-server-failover/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,94 +0,0 @@
-<?xml version='1.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.
--->
-
-<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-               xmlns="urn:activemq"
-               xsi:schemaLocation="urn:activemq /schema/artemis-server.xsd">
-
-   <jms xmlns="urn:activemq:jms">
-      <!--the queue used by the example-->
-      <queue name="exampleQueue"/>
-   </jms>
-
-   <core xmlns="urn:activemq:core">
-
-      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
-
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
-
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
-
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
-
-      <ha-policy>
-         <shared-store>
-            <master/>
-         </shared-store>
-      </ha-policy>
-
-      <!-- Connectors -->
-      <connectors>
-         <connector name="netty-connector">tcp://localhost:61616</connector>
-      </connectors>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
-      </acceptors>
-
-      <broadcast-groups>
-         <broadcast-group name="bg-group1">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <broadcast-period>1000</broadcast-period>
-            <connector-ref>netty-connector</connector-ref>
-         </broadcast-group>
-      </broadcast-groups>
-
-      <discovery-groups>
-         <discovery-group name="dg-group1">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <refresh-timeout>60000</refresh-timeout>
-         </discovery-group>
-      </discovery-groups>
-
-      <cluster-connections>
-         <cluster-connection name="my-cluster">
-            <address>jms</address>
-            <connector-ref>netty-connector</connector-ref>
-            <discovery-group-ref discovery-group-name="dg-group1"/>
-         </cluster-connection>
-      </cluster-connections>
-
-      <security-settings>
-         <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
-            <permission type="createDurableQueue" roles="guest"/>
-            <permission type="deleteDurableQueue" roles="guest"/>
-            <permission type="createNonDurableQueue" roles="guest"/>
-            <permission type="deleteNonDurableQueue" roles="guest"/>
-            <permission type="consume" roles="guest"/>
-            <permission type="send" roles="guest"/>
-         </security-setting>
-      </security-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/stop-server-failover/src/main/resources/activemq/server1/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/stop-server-failover/src/main/resources/activemq/server1/artemis-roles.properties b/examples/jms/stop-server-failover/src/main/resources/activemq/server1/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/stop-server-failover/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/stop-server-failover/src/main/resources/activemq/server1/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/stop-server-failover/src/main/resources/activemq/server1/artemis-users.properties b/examples/jms/stop-server-failover/src/main/resources/activemq/server1/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/stop-server-failover/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/stop-server-failover/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/stop-server-failover/src/main/resources/activemq/server1/broker.xml b/examples/jms/stop-server-failover/src/main/resources/activemq/server1/broker.xml
deleted file mode 100644
index da69fce..0000000
--- a/examples/jms/stop-server-failover/src/main/resources/activemq/server1/broker.xml
+++ /dev/null
@@ -1,94 +0,0 @@
-<?xml version='1.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.
--->
-
-<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-               xmlns="urn:activemq"
-               xsi:schemaLocation="urn:activemq /schema/artemis-server.xsd">
-
-   <jms xmlns="urn:activemq:jms">
-      <!--the queue used by the example-->
-      <queue name="exampleQueue"/>
-   </jms>
-
-   <core xmlns="urn:activemq:core">
-
-      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
-
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
-
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
-
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
-
-      <ha-policy>
-         <shared-store>
-            <slave/>
-         </shared-store>
-      </ha-policy>
-
-      <!-- Connectors -->
-      <connectors>
-         <connector name="netty-connector">tcp://localhost:61617</connector>
-      </connectors>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <acceptor name="netty-acceptor">tcp://localhost:61617</acceptor>
-      </acceptors>
-
-      <broadcast-groups>
-         <broadcast-group name="bg-group1">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <broadcast-period>1000</broadcast-period>
-            <connector-ref>netty-connector</connector-ref>
-         </broadcast-group>
-      </broadcast-groups>
-
-      <discovery-groups>
-         <discovery-group name="dg-group1">
-            <group-address>${udp-address:231.7.7.7}</group-address>
-            <group-port>9876</group-port>
-            <refresh-timeout>60000</refresh-timeout>
-         </discovery-group>
-      </discovery-groups>
-
-      <cluster-connections>
-         <cluster-connection name="my-cluster">
-            <address>jms</address>
-            <connector-ref>netty-connector</connector-ref>
-            <discovery-group-ref discovery-group-name="dg-group1"/>
-         </cluster-connection>
-      </cluster-connections>
-
-      <security-settings>
-         <!--security for example queue-->
-         <security-setting match="jms.queue.exampleQueue">
-            <permission type="createDurableQueue" roles="guest"/>
-            <permission type="deleteDurableQueue" roles="guest"/>
-            <permission type="createNonDurableQueue" roles="guest"/>
-            <permission type="deleteNonDurableQueue" roles="guest"/>
-            <permission type="consume" roles="guest"/>
-            <permission type="send" roles="guest"/>
-         </security-setting>
-      </security-settings>
-
-   </core>
-</configuration>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/symmetric-cluster/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/symmetric-cluster/pom.xml b/examples/jms/symmetric-cluster/pom.xml
index a7d35f7..d6ed189 100644
--- a/examples/jms/symmetric-cluster/pom.xml
+++ b/examples/jms/symmetric-cluster/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-jms-client</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>
@@ -122,7 +122,96 @@ under the License.
                            <javaOptions>-Dudp-address=${udp-address}</javaOptions>
                         </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>
+                        <id>start4</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
+                           <spawn>true</spawn>
+                           <location>${basedir}/target/server4</location>
+                           <testURI>tcp://localhost:61620</testURI>
+                           <args>
+                              <param>run</param>
+                           </args>
+                           <name>server4</name>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>start5</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
+                           <spawn>true</spawn>
+                           <location>${basedir}/target/server5</location>
+                           <testURI>tcp://localhost:61621</testURI>
+                           <args>
+                              <param>run</param>
+                           </args>
+                           <name>server5</name>
+                        </configuration>
+                     </execution>
                      <execution>
                         <id>runClient</id>
                         <goals>
@@ -130,13 +219,77 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.SymmetricClusterExample</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>stop</param>
+                           </args>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>stop4</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
+                           <location>${basedir}/target/server4</location>
+                           <args>
+                              <param>stop</param>
+                           </args>
+                        </configuration>
+                     </execution>
+                     <execution>
+                        <id>stop5</id>
+                        <goals>
+                           <goal>cli</goal>
+                        </goals>
+                        <configuration>
+                           <location>${basedir}/target/server5</location>
                            <args>
-                              <param>${basedir}/target/server0</param>
-                              <param>${basedir}/target/server1</param>
-                              <param>${basedir}/target/server2</param>
-                              <param>${basedir}/target/server3</param>
-                              <param>${basedir}/target/server4</param>
-                              <param>${basedir}/target/server5</param>
+                              <param>stop</param>
                            </args>
                         </configuration>
                      </execution>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/symmetric-cluster/src/main/java/org/apache/activemq/artemis/jms/example/SymmetricClusterExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/symmetric-cluster/src/main/java/org/apache/activemq/artemis/jms/example/SymmetricClusterExample.java b/examples/jms/symmetric-cluster/src/main/java/org/apache/activemq/artemis/jms/example/SymmetricClusterExample.java
index 24e75f0..e332f04 100644
--- a/examples/jms/symmetric-cluster/src/main/java/org/apache/activemq/artemis/jms/example/SymmetricClusterExample.java
+++ b/examples/jms/symmetric-cluster/src/main/java/org/apache/activemq/artemis/jms/example/SymmetricClusterExample.java
@@ -29,7 +29,6 @@ import org.apache.activemq.artemis.api.core.DiscoveryGroupConfiguration;
 import org.apache.activemq.artemis.api.core.UDPBroadcastEndpointFactory;
 import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
 import org.apache.activemq.artemis.api.jms.JMSFactoryType;
-import org.apache.activemq.artemis.common.example.ActiveMQExample;
 
 /**
  * This example demonstrates a cluster of three nodes set up in a symmetric topology - i.e. each
@@ -48,15 +47,9 @@ import org.apache.activemq.artemis.common.example.ActiveMQExample;
  * <p>
  * Please see the readme.html file for more information.
  */
-public class SymmetricClusterExample extends ActiveMQExample
+public class SymmetricClusterExample
 {
-   public static void main(final String[] args)
-   {
-      new SymmetricClusterExample().run(args);
-   }
-
-   @Override
-   public boolean runExample() throws Exception
+   public static void main(final String[] args) throws Exception
    {
       Connection connection0 = null;
 
@@ -180,53 +173,51 @@ public class SymmetricClusterExample extends ActiveMQExample
 
             if (received0 == null)
             {
-               return false;
+               throw new IllegalStateException("Message is null!");
             }
 
             TextMessage received1 = (TextMessage)subscriber1.receive(5000);
 
             if (received1 == null)
             {
-               return false;
+               throw new IllegalStateException("Message is null!");
             }
 
             TextMessage received2 = (TextMessage)subscriber2.receive(5000);
 
             if (received2 == null)
             {
-               return false;
+               throw new IllegalStateException("Message is null!");
             }
 
             TextMessage received3 = (TextMessage)subscriber3.receive(5000);
 
             if (received3 == null)
             {
-               return false;
+               throw new IllegalStateException("Message is null!");
             }
 
             TextMessage received4 = (TextMessage)subscriber4.receive(5000);
 
             if (received4 == null)
             {
-               return false;
+               throw new IllegalStateException("Message is null!");
             }
 
             TextMessage received5 = (TextMessage)subscriber5.receive(5000);
 
             if (received5 == null)
             {
-               return false;
+               throw new IllegalStateException("Message is null!");
             }
 
             TextMessage received6 = (TextMessage)consumer0.receive(5000);
 
             if (received6 == null)
             {
-               return false;
+               throw new IllegalStateException("Message is null!");
             }
          }
-
-         return true;
       }
       finally
       {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/54d0d2b4/examples/jms/symmetric-cluster/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/symmetric-cluster/src/main/resources/activemq/server0/artemis-roles.properties b/examples/jms/symmetric-cluster/src/main/resources/activemq/server0/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/symmetric-cluster/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/symmetric-cluster/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/symmetric-cluster/src/main/resources/activemq/server0/artemis-users.properties b/examples/jms/symmetric-cluster/src/main/resources/activemq/server0/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/symmetric-cluster/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/symmetric-cluster/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/symmetric-cluster/src/main/resources/activemq/server0/broker.xml b/examples/jms/symmetric-cluster/src/main/resources/activemq/server0/broker.xml
index 27b7489..9c672d7 100644
--- a/examples/jms/symmetric-cluster/src/main/resources/activemq/server0/broker.xml
+++ b/examples/jms/symmetric-cluster/src/main/resources/activemq/server0/broker.xml
@@ -30,14 +30,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/symmetric-cluster/src/main/resources/activemq/server1/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/symmetric-cluster/src/main/resources/activemq/server1/artemis-roles.properties b/examples/jms/symmetric-cluster/src/main/resources/activemq/server1/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/symmetric-cluster/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/symmetric-cluster/src/main/resources/activemq/server1/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/symmetric-cluster/src/main/resources/activemq/server1/artemis-users.properties b/examples/jms/symmetric-cluster/src/main/resources/activemq/server1/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/symmetric-cluster/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/symmetric-cluster/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/symmetric-cluster/src/main/resources/activemq/server1/broker.xml b/examples/jms/symmetric-cluster/src/main/resources/activemq/server1/broker.xml
index 16a7931..f02759b 100644
--- a/examples/jms/symmetric-cluster/src/main/resources/activemq/server1/broker.xml
+++ b/examples/jms/symmetric-cluster/src/main/resources/activemq/server1/broker.xml
@@ -30,14 +30,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 -->
 


[17/24] activemq-artemis git commit: ARTEMIS-178 Refactor examples to use CLI

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/multiple-failover-failback/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/multiple-failover-failback/pom.xml b/examples/jms/multiple-failover-failback/pom.xml
index 62bb695..0e429b7 100644
--- a/examples/jms/multiple-failover-failback/pom.xml
+++ b/examples/jms/multiple-failover-failback/pom.xml
@@ -57,62 +57,33 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start0</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                              <property>
-                                 <name>udp-address</name>
-                                 <value>${udp-address}</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
                         </configuration>
                      </execution>
                      <execution>
-                        <id>start1</id>
+                        <id>create1</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
-                           <fork>true</fork>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                              <property>
-                                 <name>udp-address</name>
-                                 <value>${udp-address}</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server1</instance>
+                           <configuration>${basedir}/target/classes/activemq/server1</configuration>
                         </configuration>
                      </execution>
                      <execution>
-                        <id>start2</id>
+                        <id>create2</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server2</configurationDir>
-                           <fork>true</fork>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                              <property>
-                                 <name>udp-address</name>
-                                 <value>${udp-address}</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server2</instance>
+                           <configuration>${basedir}/target/classes/activemq/server2</configuration>
                         </configuration>
                      </execution>
                      <execution>
@@ -122,39 +93,11 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.MultipleFailoverFailbackExample</clientClass>
-                           <systemProperties>
-                              <property>
-                                 <name>exampleConfigDir</name>
-                                 <value>${basedir}/target/classes/activemq</value>
-                              </property>
-                           </systemProperties>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop0</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop1</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop2</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server2</configurationDir>
+                           <args>
+                              <param>${basedir}/target/server0</param>
+                              <param>${basedir}/target/server1</param>
+                              <param>${basedir}/target/server2</param>
+                           </args>
                         </configuration>
                      </execution>
                   </executions>
@@ -164,47 +107,8 @@ under the License.
                         <artifactId>artemis-jms-multiple-failover-failback-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <systemProperties>
-                        <property>
-                           <name>data.dir</name>
-                           <value>${basedir}/target/</value>
-                        </property>
-                     </systemProperties>
-                  </configuration>
-               </plugin>
+                </plugin>
             </plugins>
          </build>
       </profile>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/multiple-failover-failback/src/main/java/org/apache/activemq/artemis/jms/example/MultipleFailoverFailbackExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/multiple-failover-failback/src/main/java/org/apache/activemq/artemis/jms/example/MultipleFailoverFailbackExample.java b/examples/jms/multiple-failover-failback/src/main/java/org/apache/activemq/artemis/jms/example/MultipleFailoverFailbackExample.java
index d59e494..9ea1dc9 100644
--- a/examples/jms/multiple-failover-failback/src/main/java/org/apache/activemq/artemis/jms/example/MultipleFailoverFailbackExample.java
+++ b/examples/jms/multiple-failover-failback/src/main/java/org/apache/activemq/artemis/jms/example/MultipleFailoverFailbackExample.java
@@ -30,11 +30,22 @@ import org.apache.activemq.artemis.common.example.ActiveMQExample;
 
 public class MultipleFailoverFailbackExample extends ActiveMQExample
 {
-   public static void main(final String[] args)
+   public static void main(final String[] args) throws Exception
    {
       new MultipleFailoverFailbackExample().run(args);
    }
 
+   protected void startServers(String[] serversArgs) throws Exception
+   {
+      for (int i = 0; i < serversArgs.length; i++)
+      {
+         startServer(i, i == 0 ? 5000 : 0);
+      }
+
+      Thread.sleep(5000);
+   }
+
+
    @Override
    public boolean runExample() throws Exception
    {
@@ -94,6 +105,7 @@ public class MultipleFailoverFailbackExample extends ActiveMQExample
          // it has really crashed
          Thread.sleep(2000);
          killServer(0);
+         Thread.sleep(5000);
 
          // Step 11. Acknowledging the 2nd half of the sent messages will fail as failover to the
          // backup server has occurred
@@ -115,7 +127,7 @@ public class MultipleFailoverFailbackExample extends ActiveMQExample
          message0.acknowledge();
 
          Thread.sleep(2000);
-         reStartServer(0, 10000);
+         startServer(0, 10000);
 
          // Step 11. Acknowledging the 2nd half of the sent messages will fail as failover to the
          // backup server has occurred

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/multiple-failover-failback/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/multiple-failover-failback/src/main/resources/activemq/server0/broker.xml b/examples/jms/multiple-failover-failback/src/main/resources/activemq/server0/broker.xml
index 52eb917..4cf5582 100644
--- a/examples/jms/multiple-failover-failback/src/main/resources/activemq/server0/broker.xml
+++ b/examples/jms/multiple-failover-failback/src/main/resources/activemq/server0/broker.xml
@@ -29,13 +29,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
+      <bindings-directory>../../server0/data/messaging/bindings</bindings-directory>
 
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
+      <journal-directory>../../server0/data/messaging/journal</journal-directory>
 
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
+      <large-messages-directory>../../server0/data/messaging/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
+      <paging-directory>../../server0/data/messaging/paging</paging-directory>
 
       <ha-policy>
          <shared-store>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/multiple-failover-failback/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/multiple-failover-failback/src/main/resources/activemq/server1/broker.xml b/examples/jms/multiple-failover-failback/src/main/resources/activemq/server1/broker.xml
index eb70455..f910045 100644
--- a/examples/jms/multiple-failover-failback/src/main/resources/activemq/server1/broker.xml
+++ b/examples/jms/multiple-failover-failback/src/main/resources/activemq/server1/broker.xml
@@ -29,13 +29,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
+      <bindings-directory>../../server0/data/messaging/bindings</bindings-directory>
 
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
+      <journal-directory>../../server0/data/messaging/journal</journal-directory>
 
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
+      <large-messages-directory>../../server0/data/messaging/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
+      <paging-directory>../../server0/data/messaging/paging</paging-directory>
 
       <ha-policy>
          <shared-store>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/multiple-failover-failback/src/main/resources/activemq/server2/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/multiple-failover-failback/src/main/resources/activemq/server2/broker.xml b/examples/jms/multiple-failover-failback/src/main/resources/activemq/server2/broker.xml
index dff08b3..76a521a 100644
--- a/examples/jms/multiple-failover-failback/src/main/resources/activemq/server2/broker.xml
+++ b/examples/jms/multiple-failover-failback/src/main/resources/activemq/server2/broker.xml
@@ -29,13 +29,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
+      <bindings-directory>../../server0/data/messaging/bindings</bindings-directory>
 
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
+      <journal-directory>../../server0/data/messaging/journal</journal-directory>
 
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
+      <large-messages-directory>../../server0/data/messaging/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
+      <paging-directory>../../server0/data/messaging/paging</paging-directory>
 
       <ha-policy>
          <shared-store>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/multiple-failover/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/multiple-failover/pom.xml b/examples/jms/multiple-failover/pom.xml
index 2bd00f8..a68679d 100644
--- a/examples/jms/multiple-failover/pom.xml
+++ b/examples/jms/multiple-failover/pom.xml
@@ -57,62 +57,33 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start0</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                              <property>
-                                 <name>udp-address</name>
-                                 <value>${udp-address}</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
                         </configuration>
                      </execution>
                      <execution>
-                        <id>start1</id>
+                        <id>create1</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
-                           <fork>true</fork>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                              <property>
-                                 <name>udp-address</name>
-                                 <value>${udp-address}</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server1</instance>
+                           <configuration>${basedir}/target/classes/activemq/server1</configuration>
                         </configuration>
                      </execution>
                      <execution>
-                        <id>start2</id>
+                        <id>create2</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server2</configurationDir>
-                           <fork>true</fork>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                              <property>
-                                 <name>udp-address</name>
-                                 <value>${udp-address}</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server2</instance>
+                           <configuration>${basedir}/target/classes/activemq/server2</configuration>
                         </configuration>
                      </execution>
                      <execution>
@@ -122,39 +93,11 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.MultipleFailoverExample</clientClass>
-                           <systemProperties>
-                              <property>
-                                 <name>exampleConfigDir</name>
-                                 <value>${basedir}/target/classes/activemq</value>
-                              </property>
-                           </systemProperties>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop0</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop1</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop2</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server2</configurationDir>
+                           <args>
+                              <param>${basedir}/target/server0</param>
+                              <param>${basedir}/target/server1</param>
+                              <param>${basedir}/target/server2</param>
+                           </args>
                         </configuration>
                      </execution>
                   </executions>
@@ -164,46 +107,7 @@ under the License.
                         <artifactId>artemis-jms-multiple-failover-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <systemProperties>
-                        <property>
-                           <name>data.dir</name>
-                           <value>${basedir}/target/</value>
-                        </property>
-                     </systemProperties>
-                  </configuration>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/multiple-failover/src/main/java/org/apache/activemq/artemis/jms/example/MultipleFailoverExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/multiple-failover/src/main/java/org/apache/activemq/artemis/jms/example/MultipleFailoverExample.java b/examples/jms/multiple-failover/src/main/java/org/apache/activemq/artemis/jms/example/MultipleFailoverExample.java
index dfa5402..a2b55e4 100644
--- a/examples/jms/multiple-failover/src/main/java/org/apache/activemq/artemis/jms/example/MultipleFailoverExample.java
+++ b/examples/jms/multiple-failover/src/main/java/org/apache/activemq/artemis/jms/example/MultipleFailoverExample.java
@@ -30,11 +30,22 @@ import org.apache.activemq.artemis.common.example.ActiveMQExample;
 
 public class MultipleFailoverExample extends ActiveMQExample
 {
-   public static void main(final String[] args)
+   public static void main(final String[] args) throws Exception
    {
       new MultipleFailoverExample().run(args);
    }
 
+   protected void startServers(String[] serversArgs) throws Exception
+   {
+      for (int i = 0; i < serversArgs.length; i++)
+      {
+         startServer(i, i == 0 ? 5000 : 0);
+      }
+
+      Thread.sleep(5000);
+   }
+
+
    @Override
    public boolean runExample() throws Exception
    {
@@ -92,8 +103,9 @@ public class MultipleFailoverExample extends ActiveMQExample
 
          // Step 10. Crash server #1, the live server, and wait a little while to make sure
          // it has really crashed
-         Thread.sleep(2000);
+         Thread.sleep(1000);
          killServer(0);
+         Thread.sleep(5000);
 
          // Step 11. Acknowledging the 2nd half of the sent messages will fail as failover to the
          // backup server has occurred
@@ -114,8 +126,9 @@ public class MultipleFailoverExample extends ActiveMQExample
          }
          message0.acknowledge();
 
-         Thread.sleep(2000);
+         Thread.sleep(1000);
          killServer(getServer(connection));
+         Thread.sleep(5000);
 
          // Step 11. Acknowledging the 2nd half of the sent messages will fail as failover to the
          // backup server has occurred

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/multiple-failover/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/multiple-failover/src/main/resources/activemq/server0/broker.xml b/examples/jms/multiple-failover/src/main/resources/activemq/server0/broker.xml
index ca23965..323bfef 100644
--- a/examples/jms/multiple-failover/src/main/resources/activemq/server0/broker.xml
+++ b/examples/jms/multiple-failover/src/main/resources/activemq/server0/broker.xml
@@ -29,13 +29,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
+      <bindings-directory>../../server0/data/messaging/bindings</bindings-directory>
 
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
+      <journal-directory>../../server0/data/messaging/journal</journal-directory>
 
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
+      <large-messages-directory>../../server0/data/messaging/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
+      <paging-directory>../../server0/data/messaging/paging</paging-directory>
 
       <ha-policy>
          <shared-store>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/multiple-failover/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/multiple-failover/src/main/resources/activemq/server1/broker.xml b/examples/jms/multiple-failover/src/main/resources/activemq/server1/broker.xml
index eb70455..f910045 100644
--- a/examples/jms/multiple-failover/src/main/resources/activemq/server1/broker.xml
+++ b/examples/jms/multiple-failover/src/main/resources/activemq/server1/broker.xml
@@ -29,13 +29,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
+      <bindings-directory>../../server0/data/messaging/bindings</bindings-directory>
 
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
+      <journal-directory>../../server0/data/messaging/journal</journal-directory>
 
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
+      <large-messages-directory>../../server0/data/messaging/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
+      <paging-directory>../../server0/data/messaging/paging</paging-directory>
 
       <ha-policy>
          <shared-store>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/multiple-failover/src/main/resources/activemq/server2/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/multiple-failover/src/main/resources/activemq/server2/broker.xml b/examples/jms/multiple-failover/src/main/resources/activemq/server2/broker.xml
index 482b4ce..c114ed2 100644
--- a/examples/jms/multiple-failover/src/main/resources/activemq/server2/broker.xml
+++ b/examples/jms/multiple-failover/src/main/resources/activemq/server2/broker.xml
@@ -29,13 +29,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>${data.dir}/server0/data/messaging/bindings</bindings-directory>
+      <bindings-directory>../../server0/data/messaging/bindings</bindings-directory>
 
-      <journal-directory>${data.dir}/server0/data/messaging/journal</journal-directory>
+      <journal-directory>../../server0/data/messaging/journal</journal-directory>
 
-      <large-messages-directory>${data.dir}/server0/data/messaging/largemessages</large-messages-directory>
+      <large-messages-directory>../../server0/data/messaging/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir}/server0/data/messaging/paging</paging-directory>
+      <paging-directory>../../server0/data/messaging/paging</paging-directory>
 
       <ha-policy>
          <shared-store>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/no-consumer-buffering/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/no-consumer-buffering/pom.xml b/examples/jms/no-consumer-buffering/pom.xml
index 7373bb4..6e4818f 100644
--- a/examples/jms/no-consumer-buffering/pom.xml
+++ b/examples/jms/no-consumer-buffering/pom.xml
@@ -57,17 +57,13 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
                         </configuration>
                      </execution>
                      <execution>
@@ -77,14 +73,11 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.NoConsumerBufferingExample</clientClass>
+                           <args>
+                              <param>${basedir}/target/server0</param>
+                           </args>
                         </configuration>
                      </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                     </execution>
                   </executions>
                   <dependencies>
                      <dependency>
@@ -92,41 +85,7 @@ under the License.
                         <artifactId>artemis-jms-no-consumer-buffering-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                  </configuration>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/non-transaction-failover/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/non-transaction-failover/pom.xml b/examples/jms/non-transaction-failover/pom.xml
index d90c9d4..675dc23 100644
--- a/examples/jms/non-transaction-failover/pom.xml
+++ b/examples/jms/non-transaction-failover/pom.xml
@@ -57,42 +57,23 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start0</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                              <property>
-                                 <name>udp-address</name>
-                                 <value>${udp-address}</value>
-                              </property>
-                           </systemProperties>
-                           <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
                         </configuration>
                      </execution>
                      <execution>
-                        <id>start1</id>
+                        <id>create1</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
-                           <fork>true</fork>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                              <property>
-                                 <name>udp-address</name>
-                                 <value>${udp-address}</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server1</instance>
+                           <configuration>${basedir}/target/classes/activemq/server1</configuration>
                         </configuration>
                      </execution>
                      <execution>
@@ -102,30 +83,10 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.NonTransactionFailoverExample</clientClass>
-                           <systemProperties>
-                              <property>
-                                 <name>exampleConfigDir</name>
-                                 <value>${basedir}/target/classes/activemq</value>
-                              </property>
-                           </systemProperties>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop0</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop1</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                        <configuration>
-                           <configurationDir>${basedir}/target/classes/activemq/server1</configurationDir>
+                           <args>
+                              <param>${basedir}/target/server0</param>
+                              <param>${basedir}/target/server1</param>
+                           </args>
                         </configuration>
                      </execution>
                   </executions>
@@ -135,40 +96,7 @@ under the License.
                         <artifactId>non-transaction-failover</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
-                  </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                  </configuration>
+                   </dependencies>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/non-transaction-failover/src/main/java/org/apache/activemq/artemis/jms/example/NonTransactionFailoverExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/non-transaction-failover/src/main/java/org/apache/activemq/artemis/jms/example/NonTransactionFailoverExample.java b/examples/jms/non-transaction-failover/src/main/java/org/apache/activemq/artemis/jms/example/NonTransactionFailoverExample.java
index 021835e..e690fd6 100644
--- a/examples/jms/non-transaction-failover/src/main/java/org/apache/activemq/artemis/jms/example/NonTransactionFailoverExample.java
+++ b/examples/jms/non-transaction-failover/src/main/java/org/apache/activemq/artemis/jms/example/NonTransactionFailoverExample.java
@@ -34,11 +34,21 @@ import org.apache.activemq.artemis.common.example.ActiveMQExample;
  */
 public class NonTransactionFailoverExample extends ActiveMQExample
 {
-   public static void main(final String[] args)
+   public static void main(final String[] args) throws Exception
    {
       new NonTransactionFailoverExample().run(args);
    }
 
+   protected void startServers(String[] serversArgs) throws Exception
+   {
+      for (int i = 0; i < serversArgs.length; i++)
+      {
+         startServer(i, i == 0 ? 5000 : 0);
+      }
+
+      Thread.sleep(5000);
+   }
+
    @Override
    public boolean runExample() throws Exception
    {
@@ -98,6 +108,7 @@ public class NonTransactionFailoverExample extends ActiveMQExample
          // pending Acks are on the server's side
          Thread.sleep(2000);
          killServer(0);
+         Thread.sleep(5000);
 
          // Step 11. Acknowledging the 2nd half of the sent messages will fail as failover to the
          // backup server has occurred

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/non-transaction-failover/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/non-transaction-failover/src/main/resources/activemq/server0/broker.xml b/examples/jms/non-transaction-failover/src/main/resources/activemq/server0/broker.xml
index 1a5bc0b..00e724b 100644
--- a/examples/jms/non-transaction-failover/src/main/resources/activemq/server0/broker.xml
+++ b/examples/jms/non-transaction-failover/src/main/resources/activemq/server0/broker.xml
@@ -71,10 +71,10 @@ under the License.
          </cluster-connection>
       </cluster-connections>
 
-      <large-messages-directory>target/server0/data/large-messages</large-messages-directory>
-      <bindings-directory>target/server0/data/bindings</bindings-directory>
-      <journal-directory>target/server0/data/journal</journal-directory>
-      <paging-directory>target/server0/data/paging</paging-directory>
+      <large-messages-directory>../../server0/data/large-messages</large-messages-directory>
+      <bindings-directory>../../server0/data/bindings</bindings-directory>
+      <journal-directory>../../server0/data/journal</journal-directory>
+      <paging-directory>../../server0/data/paging</paging-directory>
       <!-- Other config -->
 
       <security-settings>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/non-transaction-failover/src/main/resources/activemq/server1/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/non-transaction-failover/src/main/resources/activemq/server1/broker.xml b/examples/jms/non-transaction-failover/src/main/resources/activemq/server1/broker.xml
index ecb5cda..0406b8f 100644
--- a/examples/jms/non-transaction-failover/src/main/resources/activemq/server1/broker.xml
+++ b/examples/jms/non-transaction-failover/src/main/resources/activemq/server1/broker.xml
@@ -71,10 +71,10 @@ under the License.
          </cluster-connection>
       </cluster-connections>
 
-      <large-messages-directory>target/server0/data/large-messages</large-messages-directory>
-      <bindings-directory>target/server0/data/bindings</bindings-directory>
-      <journal-directory>target/server0/data/journal</journal-directory>
-      <paging-directory>target/server0/data/paging</paging-directory>
+      <large-messages-directory>../../server0/data/large-messages</large-messages-directory>
+      <bindings-directory>../../server0/data/bindings</bindings-directory>
+      <journal-directory>../../server0/data/journal</journal-directory>
+      <paging-directory>../../server0/data/paging</paging-directory>
 
       <!-- Other config -->
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/openwire/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/openwire/pom.xml b/examples/jms/openwire/pom.xml
index 2de0c1d..1ee5cfc 100644
--- a/examples/jms/openwire/pom.xml
+++ b/examples/jms/openwire/pom.xml
@@ -45,17 +45,13 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
                         </configuration>
                      </execution>
                      <execution>
@@ -65,14 +61,11 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.OpenWireExample</clientClass>
+                           <args>
+                              <param>${basedir}/target/server0</param>
+                           </args>
                         </configuration>
                      </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                     </execution>
                   </executions>
                   <dependencies>
                      <dependency>
@@ -80,46 +73,7 @@ under the License.
                         <artifactId>artemis-jms-openwire-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-openwire-protocol</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                  </configuration>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/openwire/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/openwire/src/main/resources/activemq/server0/broker.xml b/examples/jms/openwire/src/main/resources/activemq/server0/broker.xml
index dbb0ca6..c281c60 100644
--- a/examples/jms/openwire/src/main/resources/activemq/server0/broker.xml
+++ b/examples/jms/openwire/src/main/resources/activemq/server0/broker.xml
@@ -43,7 +43,9 @@ under the License.
 
       <!-- Acceptors -->
       <acceptors>
-         <acceptor name="openwire-acceptor">tcp://localhost:61616?protocols=OPENWIRE</acceptor>
+         <!-- the same acceptor can deal with more than one protocol. We are adding CORE here as some of
+              the example super classes will check for if the server is alive after starting it -->
+         <acceptor name="openwire-acceptor">tcp://localhost:61616?protocols=OPENWIRE,CORE</acceptor>
       </acceptors>
 
       <!-- Other config -->

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/paging/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/paging/pom.xml b/examples/jms/paging/pom.xml
index a0251a0..83103ed 100644
--- a/examples/jms/paging/pom.xml
+++ b/examples/jms/paging/pom.xml
@@ -57,17 +57,13 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
                         </configuration>
                      </execution>
                      <execution>
@@ -77,14 +73,11 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.PagingExample</clientClass>
+                           <args>
+                              <param>${basedir}/target/server0</param>
+                           </args>
                         </configuration>
                      </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                     </execution>
                   </executions>
                   <dependencies>
                      <dependency>
@@ -92,41 +85,7 @@ under the License.
                         <artifactId>artemis-jms-paging-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                  </configuration>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/perf/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/perf/pom.xml b/examples/jms/perf/pom.xml
index 07e3410..2db189a 100644
--- a/examples/jms/perf/pom.xml
+++ b/examples/jms/perf/pom.xml
@@ -70,65 +70,37 @@ under the License.
                <plugin>
                   <groupId>org.apache.activemq</groupId>
                   <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>start</id>
-                        <goals>
-                           <goal>start</goal>
-                        </goals>
-                        <configuration>
-                           <waitOnStart>true</waitOnStart>
-                           <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                           </systemProperties>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                  </configuration>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-perf-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
-                  </dependencies>
+                     <executions>
+                        <execution>
+                           <id>create</id>
+                           <goals>
+                              <goal>create</goal>
+                           </goals>
+                           <configuration>
+                              <instance>${basedir}/target/server0</instance>
+                              <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                           </configuration>
+                        </execution>
+                        <execution>
+                           <id>runClient</id>
+                           <goals>
+                              <goal>runClient</goal>
+                           </goals>
+                           <configuration>
+                              <clientClass>org.apache.activemq.artemis.jms.example.Server</clientClass>
+                              <args>
+                                 <param>${basedir}/target/server0</param>
+                              </args>
+                           </configuration>
+                        </execution>
+                     </executions>
+                     <dependencies>
+                        <dependency>
+                           <groupId>org.apache.activemq.examples.jms</groupId>
+                           <artifactId>artemis-jms-perf-example</artifactId>
+                           <version>${project.version}</version>
+                        </dependency>
+                     </dependencies>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/perf/src/main/java/org/apache/activemq/artemis/jms/example/Server.java
----------------------------------------------------------------------
diff --git a/examples/jms/perf/src/main/java/org/apache/activemq/artemis/jms/example/Server.java b/examples/jms/perf/src/main/java/org/apache/activemq/artemis/jms/example/Server.java
new file mode 100644
index 0000000..d844c40
--- /dev/null
+++ b/examples/jms/perf/src/main/java/org/apache/activemq/artemis/jms/example/Server.java
@@ -0,0 +1,28 @@
+/*
+ * 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.
+ */
+
+package org.apache.activemq.artemis.jms.example;
+
+public class Server
+{
+   public static void main(String arg[])
+   {
+      System.out.println("***********************************************************************************");
+      System.out.println("You need to start manually under ./target/server/bin just run ./artemis run");
+      System.out.println("***********************************************************************************");
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/perf/src/main/resources/perf.properties
----------------------------------------------------------------------
diff --git a/examples/jms/perf/src/main/resources/perf.properties b/examples/jms/perf/src/main/resources/perf.properties
index 8dbf02a..5f6f975 100644
--- a/examples/jms/perf/src/main/resources/perf.properties
+++ b/examples/jms/perf/src/main/resources/perf.properties
@@ -15,10 +15,10 @@
 # specific language governing permissions and limitations
 # under the License.
 
-num-messages=1
-num-warmup-messages=0
+num-messages=100000
+num-warmup-messages=1000
 message-size=1024
-durable=true
+durable=false
 transacted=false
 batch-size=1000
 drain-queue=false

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/pre-acknowledge/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/pre-acknowledge/pom.xml b/examples/jms/pre-acknowledge/pom.xml
index d644d80..030d77f 100644
--- a/examples/jms/pre-acknowledge/pom.xml
+++ b/examples/jms/pre-acknowledge/pom.xml
@@ -57,17 +57,13 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
                         </configuration>
                      </execution>
                      <execution>
@@ -78,16 +74,10 @@ under the License.
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.PreacknowledgeExample</clientClass>
                            <args>
-                              <param>tcp://localhost:61616</param>
+                              <param>${basedir}/target/server0</param>
                            </args>
                         </configuration>
                      </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                     </execution>
                   </executions>
                   <dependencies>
                      <dependency>
@@ -95,41 +85,7 @@ under the License.
                         <artifactId>artemis-jms-pre-acknowledge-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                  </configuration>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/producer-rate-limit/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/producer-rate-limit/pom.xml b/examples/jms/producer-rate-limit/pom.xml
index 2b2dbe0..535a7d5 100644
--- a/examples/jms/producer-rate-limit/pom.xml
+++ b/examples/jms/producer-rate-limit/pom.xml
@@ -57,17 +57,13 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
                         </configuration>
                      </execution>
                      <execution>
@@ -77,14 +73,11 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.ProducerRateLimitExample</clientClass>
+                           <args>
+                              <param>${basedir}/target/server0</param>
+                           </args>
                         </configuration>
                      </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                     </execution>
                   </executions>
                   <dependencies>
                      <dependency>
@@ -92,41 +85,7 @@ under the License.
                         <artifactId>artemis-jms-producer-rate-limit-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                  </configuration>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/proton-cpp/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/proton-cpp/pom.xml b/examples/jms/proton-cpp/pom.xml
index 9422c83..c5e41a4 100644
--- a/examples/jms/proton-cpp/pom.xml
+++ b/examples/jms/proton-cpp/pom.xml
@@ -55,20 +55,15 @@ under the License.
                <plugin>
                   <groupId>org.apache.activemq</groupId>
                   <artifactId>artemis-maven-plugin</artifactId>
-                  <version>${project.version}</version>
                   <executions>
                      <execution>
-                        <id>start</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
                         </configuration>
                      </execution>
                      <execution>
@@ -78,14 +73,11 @@ under the License.
                         </goals>
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.ProtonCPPExample</clientClass>
+                           <args>
+                              <param>${basedir}/target/server0</param>
+                           </args>
                         </configuration>
                      </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                     </execution>
                   </executions>
                   <dependencies>
                      <dependency>
@@ -93,46 +85,7 @@ under the License.
                         <artifactId>artemis-jms-protoncpp</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-amqp-protocol</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                  </configuration>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/proton-cpp/src/main/java/org/apache/activemq/artemis/jms/example/ProtonCPPExample.java
----------------------------------------------------------------------
diff --git a/examples/jms/proton-cpp/src/main/java/org/apache/activemq/artemis/jms/example/ProtonCPPExample.java b/examples/jms/proton-cpp/src/main/java/org/apache/activemq/artemis/jms/example/ProtonCPPExample.java
index df4503e..b23dc55 100644
--- a/examples/jms/proton-cpp/src/main/java/org/apache/activemq/artemis/jms/example/ProtonCPPExample.java
+++ b/examples/jms/proton-cpp/src/main/java/org/apache/activemq/artemis/jms/example/ProtonCPPExample.java
@@ -26,13 +26,10 @@ import javax.jms.QueueConnection;
 import javax.jms.QueueRequestor;
 import javax.jms.QueueSession;
 import javax.jms.Session;
-import javax.jms.TextMessage;
 import javax.naming.InitialContext;
 
 import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
-import org.apache.activemq.artemis.api.jms.ActiveMQJMSConstants;
 import org.apache.activemq.artemis.api.jms.management.JMSManagementHelper;
-
 import org.apache.activemq.artemis.common.example.ActiveMQExample;
 
 /**

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/proton-j/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/proton-j/pom.xml b/examples/jms/proton-j/pom.xml
index 42e9ea9..3001867 100644
--- a/examples/jms/proton-j/pom.xml
+++ b/examples/jms/proton-j/pom.xml
@@ -58,17 +58,13 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
                         </configuration>
                      </execution>
                      <execution>
@@ -79,16 +75,10 @@ under the License.
                         <configuration>
                            <clientClass>org.apache.activemq.artemis.jms.example.ProtonJExample</clientClass>
                            <args>
-                              <param>tcp://localhost:61616</param>
+                              <param>${basedir}/target/server0</param>
                            </args>
                         </configuration>
                      </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>stop</goal>
-                        </goals>
-                     </execution>
                   </executions>
                   <dependencies>
                      <dependency>
@@ -96,46 +86,7 @@ under the License.
                         <artifactId>artemis-proton-j-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-amqp-protocol</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                  </configuration>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/proton-j/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/proton-j/src/main/resources/activemq/server0/broker.xml b/examples/jms/proton-j/src/main/resources/activemq/server0/broker.xml
index c27781d..f1df1c6 100644
--- a/examples/jms/proton-j/src/main/resources/activemq/server0/broker.xml
+++ b/examples/jms/proton-j/src/main/resources/activemq/server0/broker.xml
@@ -41,6 +41,7 @@ under the License.
       <!-- Acceptors -->
       <acceptors>
          <acceptor name="proton-acceptor">tcp://localhost:5672</acceptor>
+         <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor>
       </acceptors>
 
       <queues>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/proton-ruby/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/proton-ruby/pom.xml b/examples/jms/proton-ruby/pom.xml
index 6db85cd..b00e308 100644
--- a/examples/jms/proton-ruby/pom.xml
+++ b/examples/jms/proton-ruby/pom.xml
@@ -53,18 +53,13 @@ under the License.
                   <artifactId>artemis-maven-plugin</artifactId>
                   <executions>
                      <execution>
-                        <id>start</id>
+                        <id>create</id>
                         <goals>
-                           <goal>start</goal>
+                           <goal>create</goal>
                         </goals>
                         <configuration>
-                           <waitOnStart>true</waitOnStart>
-                           <systemProperties>
-                              <property>
-                                 <name>data.dir</name>
-                                 <value>${basedir}/target/</value>
-                              </property>
-                           </systemProperties>
+                           <instance>${basedir}/target/server0</instance>
+                           <configuration>${basedir}/target/classes/activemq/server0</configuration>
                         </configuration>
                      </execution>
                   </executions>
@@ -74,46 +69,7 @@ under the License.
                         <artifactId>artemis-jms-proton-ruby-example</artifactId>
                         <version>${project.version}</version>
                      </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-core-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-client</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-jms-server</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.activemq</groupId>
-                        <artifactId>artemis-amqp-protocol</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>io.netty</groupId>
-                        <artifactId>netty-all</artifactId>
-                        <version>${netty.version}</version>
-                     </dependency>
-                     <dependency>
-                        <groupId>org.apache.geronimo.specs</groupId>
-                        <artifactId>geronimo-jms_2.0_spec</artifactId>
-                        <version>${geronimo.jms.2.spec.version}</version>
-                     </dependency>
                   </dependencies>
-                  <configuration>
-                     <waitOnStart>false</waitOnStart>
-                     <configurationDir>${basedir}/target/classes/activemq/server0</configurationDir>
-                  </configuration>
                </plugin>
             </plugins>
          </build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b3af4bb7/examples/jms/proton-ruby/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/proton-ruby/readme.html b/examples/jms/proton-ruby/readme.html
index 0277e7b..951a654 100644
--- a/examples/jms/proton-ruby/readme.html
+++ b/examples/jms/proton-ruby/readme.html
@@ -42,7 +42,8 @@ under the License.
      </code>
      </pre>
      <h2>Example step-by-step</h2>
-     <p>Firstly start the server by running the command <literal>mvn verify -Pexample</literal></p>
+     <p>Firstly create the server by running the command <literal>mvn verify -Pexample</literal></p>
+     <p>Start the server manually under ./target/server1/bin by calling ./artemis run</p>
      <p>Then in a separate window you can run the send ruby script by running the command <literal>ruby src/main/scripts/send.rb</literal></p>
      <p>You can then receive the message via the receive ruby script by running <literal>ruby src/main/scripts/receive.rb</literal></p>