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/08/07 21:31:20 UTC

[01/18] activemq-artemis git commit: Removing 'created by' comments

Repository: activemq-artemis
Updated Branches:
  refs/heads/master d4de65041 -> 4ed21a44c


Removing 'created by' comments


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

Branch: refs/heads/master
Commit: 138bfe968259eca3f8be0e98076195a2b4bf2946
Parents: d4de650
Author: Clebert Suconic <cl...@apache.org>
Authored: Thu Aug 6 10:24:00 2015 -0400
Committer: Clebert Suconic <cl...@apache.org>
Committed: Fri Aug 7 15:17:24 2015 -0400

----------------------------------------------------------------------
 .../artemis/core/server/impl/SharedStoreLiveActivation.java      | 3 ---
 .../activemq/artemis/core/transaction/TransactionFactory.java    | 3 ---
 .../activemq/network/MQTTNetworkOfBrokersFailoverTest.java       | 4 ----
 3 files changed, 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/138bfe96/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/SharedStoreLiveActivation.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/SharedStoreLiveActivation.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/SharedStoreLiveActivation.java
index 0e41b7a..e9b67b8 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/SharedStoreLiveActivation.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/SharedStoreLiveActivation.java
@@ -20,9 +20,6 @@ import org.apache.activemq.artemis.core.server.ActiveMQServerLogger;
 import org.apache.activemq.artemis.core.server.NodeManager;
 import org.apache.activemq.artemis.core.server.cluster.ha.SharedStoreMasterPolicy;
 
-/**
-* Created by andy on 04/09/14.
-*/
 public final class SharedStoreLiveActivation extends LiveActivation
 {
    //this is how we act when we initially start as live

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/138bfe96/artemis-server/src/main/java/org/apache/activemq/artemis/core/transaction/TransactionFactory.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/transaction/TransactionFactory.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/transaction/TransactionFactory.java
index 5252f66..9765439 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/transaction/TransactionFactory.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/transaction/TransactionFactory.java
@@ -20,9 +20,6 @@ import org.apache.activemq.artemis.core.persistence.StorageManager;
 
 import javax.transaction.xa.Xid;
 
-/**
- * Created by andy on 22/07/14.
- */
 public interface TransactionFactory
 {
    Transaction newTransaction(Xid xid, StorageManager storageManager, int timeoutSeconds);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/138bfe96/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/network/MQTTNetworkOfBrokersFailoverTest.java
----------------------------------------------------------------------
diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/network/MQTTNetworkOfBrokersFailoverTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/network/MQTTNetworkOfBrokersFailoverTest.java
index 928a7a6..d0bd3d7 100644
--- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/network/MQTTNetworkOfBrokersFailoverTest.java
+++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/network/MQTTNetworkOfBrokersFailoverTest.java
@@ -47,10 +47,6 @@ import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-/**
- * Created by ceposta
- * <a href="http://christianposta.com/blog>http://christianposta.com/blog</a>.
- */
 public class MQTTNetworkOfBrokersFailoverTest extends NetworkTestSupport {
 
     private static final Logger LOG = LoggerFactory.getLogger(MQTTNetworkOfBrokersFailoverTest.class);


[10/18] activemq-artemis git commit: ARTEMIS-180 removing -Pexample and some other improvements around the examples

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 ef5fb76..7561551 100644
--- a/examples/jms/jms-completion-listener/pom.xml
+++ b/examples/jms/jms-completion-listener/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-completion-listener-example</artifactId>
+   <artifactId>completion-listener</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS Completion Listener Example</name>
 
@@ -37,71 +38,82 @@ under the License.
 
    <dependencies>
       <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
       </dependency>
    </dependencies>
 
    <profiles>
       <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>create</id>
-                        <goals>
-                           <goal>create</goal>
-                        </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.JMSCompletionListenerExample</clientClass>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>cli</goal>
-                        </goals>
-                        <configuration>
-                           <args>
-                              <param>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-completion-listener-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                   </dependencies>
-               </plugin>
-            </plugins>
-         </build>
+         <!-- specify -PnoServer if you don't want to start the server -->
+         <id>noServer</id>
+         <properties>
+            <noServer>true</noServer>
+         </properties>
       </profile>
    </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <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.JMSCompletionListenerExample</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>completion-listener</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/jms-completion-listener/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/jms-completion-listener/readme.html b/examples/jms/jms-completion-listener/readme.html
index c29066a..f9d39ad 100644
--- a/examples/jms/jms-completion-listener/readme.html
+++ b/examples/jms/jms-completion-listener/readme.html
@@ -27,11 +27,12 @@ under the License.
   <body onload="prettyPrint()">
      <h1>JMS Completion Listener Example</h1>
 
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
+
      <p>This example shows you how to send a message asynchronously to ActiveMQ Artemis and use a CompletionListener to be notified of
      the Broker receiving it</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>
 
      <ol>
         <li>First we need to get an initial context so we can look-up the JMS connection factory and destination objects from JNDI. This initial context will get it's properties from the <code>client-jndi.properties</code> file in the directory <code>../common/config</code></li>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 47a61cb..5de38cb 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
@@ -29,6 +29,9 @@ import java.lang.IllegalStateException;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 
+import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
+import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
+
 /**
  * A JMS Completion Listener Example.
  */
@@ -36,18 +39,14 @@ public class JMSCompletionListenerExample
 {
    public static void main(final String[] args) throws Exception
    {
-      InitialContext initialContext = null;
       JMSContext jmsContext = null;
       try
       {
-         // Step 1. Create an initial context to perform the JNDI lookup.
-         initialContext = new InitialContext();
-
          // Step 2. Perfom a lookup on the queue
-         Queue queue = (Queue)initialContext.lookup("queue/exampleQueue");
+         Queue queue = ActiveMQJMSClient.createQueue("exampleQueue");
 
          // Step 3. Perform a lookup on the Connection Factory
-         ConnectionFactory cf = (ConnectionFactory)initialContext.lookup("ConnectionFactory");
+         ConnectionFactory cf = new ActiveMQConnectionFactory("tcp://localhost:61616?confirmationWindowSize=10240");
 
          // Step 4.Create a JMS Context
          jmsContext = cf.createContext();
@@ -85,11 +84,6 @@ public class JMSCompletionListenerExample
       }
       finally
       {
-         // Step 8. Be sure to close our JMS resources!
-         if (initialContext != null)
-         {
-            initialContext.close();
-         }
          if (jmsContext != null)
          {
             jmsContext.close();

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/jms-context/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/jms-context/pom.xml b/examples/jms/jms-context/pom.xml
index d586367..fac041b 100644
--- a/examples/jms/jms-context/pom.xml
+++ b/examples/jms/jms-context/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-context-example</artifactId>
+   <artifactId>context</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS Context Example</name>
 
@@ -37,71 +38,81 @@ under the License.
 
    <dependencies>
       <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
       </dependency>
    </dependencies>
 
    <profiles>
       <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>create</id>
-                        <goals>
-                           <goal>create</goal>
-                        </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.JMSContextExample</clientClass>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>cli</goal>
-                        </goals>
-                        <configuration>
-                           <args>
-                              <param>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-context-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
+         <!-- specify -PnoServer if you don't want to start the server -->
+         <id>noServer</id>
+         <properties>
+            <noServer>true</noServer>
+         </properties>
       </profile>
    </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <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.JMSContextExample</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>context</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/jms-context/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/jms-context/readme.html b/examples/jms/jms-context/readme.html
index 253fe1b..822a474 100644
--- a/examples/jms/jms-context/readme.html
+++ b/examples/jms/jms-context/readme.html
@@ -27,67 +27,9 @@ under the License.
   <body onload="prettyPrint()">
      <h1>JMS Context Example</h1>
 
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
+
      <p>This example shows you how to send and receive a message to a JMS Queue using ActiveMQ Artemis by using a JMS Context</p>
      <p>A JMSContext is part of JMS 2.0 and combines the JMS Connection and Session Objects into a simple Interface</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>
-
-     <ol>
-        <li>First we need to get an initial context so we can look-up the JMS connection factory and destination objects from JNDI. This initial context will get it's properties from the <code>client-jndi.properties</code> file in the directory <code>../common/config</code></li>
-        <pre class="prettyprint">
-           <code>InitialContext initialContext = getContext();</code>
-        </pre>
-
-        <li>We look-up the JMS queue object from JNDI</li>
-        <pre class="prettyprint">
-           <code>Queue queue = (Queue) initialContext.lookup("/queue/exampleQueue");</code>
-        </pre>
-
-        <li>We look-up the JMS connection factory object from JNDI</li>
-        <pre class="prettyprint">
-           <code>ConnectionFactory cf = (ConnectionFactory) initialContext.lookup("/ConnectionFactory");</code>
-        </pre>
-
-        <li>We create a JMS context</li>
-        <pre class="prettyprint">
-           <code>jmsContext = cf.createContext();</code>
-        </pre>
-
-        <li>We create a JMS Producer, set the delivery mode and send a message all in one line. Note that we don't pass
-        a message to the send method but just a String.</li>
-        <pre class="prettyprint">
-           <code>jmsContext.createProducer().setDeliveryMode(DeliveryMode.PERSISTENT).send(queue, "this is a string")</code>
-        </pre>
-
-        <li>We create a JMS message consumer and receive the payload of the message directly</li>
-        <pre class="prettyprint">
-          <code>String payLoad = jmsContext.createConsumer(queue).receiveBody(String.class);</code>
-       </pre>
-
-        <li>We create a JMS text message that we are going to send.</li>
-        <pre class="prettyprint">
-           <code>TextMessage message = session.createTextMessage("This is a text message");</code>
-        </pre>
-
-        <li>And finally, <b>always</b> remember to close your JMS connections and resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
-
-        <pre class="prettyprint">
-           <code>finally
-           {
-              if (initialContext != null)
-              {
-                 initialContext.close();
-              }
-              if (jmsContext != null)
-              {
-                 jmsContext.close();
-              }
-           }</code>
-        </pre>
-
-
-
-     </ol>
   </body>
 </html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 bb8457f..27be3b0 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
@@ -16,12 +16,12 @@
  */
 package org.apache.activemq.artemis.jms.example;
 
-import javax.jms.ConnectionFactory;
 import javax.jms.DeliveryMode;
 import javax.jms.JMSContext;
 import javax.jms.Queue;
-import javax.naming.InitialContext;
-import java.lang.Exception;
+
+import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
+import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
 
 /**
  * A simple JMS Queue example that creates a producer and consumer on a queue and sends then receives a message.
@@ -30,41 +30,24 @@ public class JMSContextExample
 {
    public static void main(final String[] args) throws Exception
    {
-      InitialContext initialContext = null;
-      JMSContext jmsContext = null;
-      try
+      // Instantiate the queue
+      Queue queue = ActiveMQJMSClient.createQueue("exampleQueue");
+
+      // Instantiate the ConnectionFactory (Using the default URI on this case)
+      // Also instantiate the jmsContext
+      // Using closeable interface
+      try (ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory();
+           JMSContext jmsContext = cf.createContext())
       {
-         // Step 1. Create an initial context to perform the JNDI lookup.
-         initialContext = new InitialContext();
-
-         // Step 2. Perfom a lookup on the queue
-         Queue queue = (Queue)initialContext.lookup("queue/exampleQueue");
-
-         // Step 3. Perform a lookup on the Connection Factory
-         ConnectionFactory cf = (ConnectionFactory)initialContext.lookup("ConnectionFactory");
-
-         // Step 4.Create a JMS Context
-         jmsContext = cf.createContext();
-
-         // Step 5. Create a message producer, note that we can chain all this into one statement
+         // Create a message producer, note that we can chain all this into one statement
          jmsContext.createProducer().setDeliveryMode(DeliveryMode.PERSISTENT).send(queue, "this is a string");
 
-         // Step 6. Create a Consumer and receive the payload of the message direct.
+         // Create a Consumer and receive the payload of the message direct.
          String payLoad = jmsContext.createConsumer(queue).receiveBody(String.class);
 
          System.out.println("payLoad = " + payLoad);
+
       }
-      finally
-      {
-         // Step 7. Be sure to close our JMS resources!
-         if (initialContext != null)
-         {
-            initialContext.close();
-         }
-         if (jmsContext != null)
-         {
-            jmsContext.close();
-         }
-      }
+
    }
 }

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

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 af55f86..c4a2b0a 100644
--- a/examples/jms/jms-shared-consumer/pom.xml
+++ b/examples/jms/jms-shared-consumer/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-shared-consumer-example</artifactId>
+   <artifactId>shared-consumer</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS Shared Consumer Example</name>
 
@@ -37,71 +38,83 @@ under the License.
 
    <dependencies>
       <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
       </dependency>
    </dependencies>
 
    <profiles>
       <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>create</id>
-                        <goals>
-                           <goal>create</goal>
-                        </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.JMSSharedConsumerExample</clientClass>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>cli</goal>
-                        </goals>
-                        <configuration>
-                           <args>
-                              <param>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-shared-consumer-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
+         <!-- specify -PnoServer if you don't want to start the server -->
+         <id>noServer</id>
+         <properties>
+            <noServer>true</noServer>
+         </properties>
       </profile>
    </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <instance>${basedir}/target/server0</instance>
+                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <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.JMSSharedConsumerExample</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>shared-consumer</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/jms-shared-consumer/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/jms-shared-consumer/readme.html b/examples/jms/jms-shared-consumer/readme.html
index 54e57f9..edf6c33 100644
--- a/examples/jms/jms-shared-consumer/readme.html
+++ b/examples/jms/jms-shared-consumer/readme.html
@@ -27,12 +27,13 @@ under the License.
   <body onload="prettyPrint()">
      <h1>JMS Shared Consumer Example</h1>
 
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
+
      <p>This example shows you how can use shared consumers to share a subscription on a topic. In JMS 1.1 this was not allowed
      and so caused a scalability issue. In JMS 2 this restriction has been lifted so you can share the load across different
          threads and connections.</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>
 
      <ol>
         <li>First we need to get an initial context so we can look-up the JMS connection factory and destination objects from JNDI. This initial context will get it's properties from the <code>client-jndi.properties</code> file in the directory <code>../common/config</code></li>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/jmx/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/jmx/pom.xml b/examples/jms/jmx/pom.xml
index 802025d..aaedf68 100644
--- a/examples/jms/jmx/pom.xml
+++ b/examples/jms/jmx/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-jmx-example</artifactId>
+   <artifactId>jmx</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS "JMX" Example</name>
 
@@ -46,76 +47,81 @@ under the License.
          <artifactId>artemis-jms-client</artifactId>
          <version>${project.version}</version>
       </dependency>
-      <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
-      </dependency>
    </dependencies>
 
    <profiles>
       <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>create</id>
-                        <goals>
-                           <goal>create</goal>
-                        </goals>
-                        <configuration>
-                           <!-- 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>
-                        <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>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                   <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-jmx-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                   </dependencies>
-               </plugin>
-            </plugins>
-         </build>
+         <!-- specify -PnoServer if you don't want to start the server -->
+         <id>noServer</id>
+         <properties>
+            <noServer>true</noServer>
+         </properties>
       </profile>
    </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <!-- 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>
+                  <id>start</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <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>
+                     <ignore>${noServer}</ignore>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>jmx</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/jmx/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/jmx/readme.html b/examples/jms/jmx/readme.html
index 462ec6a..2ec87e7 100644
--- a/examples/jms/jmx/readme.html
+++ b/examples/jms/jmx/readme.html
@@ -27,6 +27,8 @@ under the License.
   <body onload="prettyPrint()">
      <h1>JMX Management Example</h1>
 
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
+
      <p>This example shows how to manage ActiveMQ Artemis using <a href="http://java.sun.com/javase/technologies/core/mntr-mgmt/javamanagement/">JMX</a></p>
 
      <h2>Example configuration</h2>
@@ -40,12 +42,11 @@ under the License.
              -Dcom.sun.management.jmxremote.authenticate=false</code>
         </pre>
         <p>These properties are explained in the Java 5 <a href="http://java.sun.com/j2se/1.5.0/docs/guide/management/agent.html#remote">Management guide</a>
-            (please note that for this example, we will disable user authentication for simplicity sake).</p>        
-        <p>With these properties, ActiveMQ Artemis server will be manageable remotely using standard JMX URL on port <code>3000</code>.</p> 
+            (please note that for this example, we will disable user authentication for simplicity sake).</p>
+        <p>With these properties, ActiveMQ Artemis server will be manageable remotely using standard JMX URL on port <code>3000</code>.</p>
      </p>
-         
+
      <h2>Example step-by-step</h2>
-     <p><em>To run the example, simply type <code>mvn verify -Pexample</code> from this directory</em></p>
      <ol>
         <li>First we need to get an initial context so we can look-up the JMS connection factory and destination objects from JNDI. This initial context will get its properties from <a href="server0/client-jndi.properties">client-jndi.properties</a></li>
         <pre class="prettyprint">
@@ -66,7 +67,7 @@ under the License.
         <pre class="prettyprint">
             <code>connection = cf.createConnection();</code>
         </pre>
-        
+
         <li>We create a JMS session. The session is created as non transacted and will auto acknowledge messages.</li>
         <pre class="prettyprint">
             <code>Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);</code>
@@ -89,7 +90,7 @@ under the License.
 
         <p><em>Now that we have a message in the queue, we will manage the queue by retrieving the number of messages in the queue
             (i.e. 1) and by removing the message which has been sent in step 8.</em></p>
-            
+
         <li>We retrieve the <code>ObjectName</code> corresponding to the queue using a helper class <code>ObjectNameBuilder</code></li>
         <pre class="prettyprint">
               <code>ObjectName on = ObjectNameBuilder.DEFAULT.getJMSQueueObjectName(queue.getQueueName());</code>
@@ -104,7 +105,7 @@ under the License.
         <pre class="prettyprint">
            <code>TextMessage messageReceived = (TextMessage) messageConsumer.receive(5000);</code>
         </pre>
-        
+
         <li>We create a <code>JMSQueueControl</code> proxy to manage the queue on the server</li>
         <pre class="prettyprint">
             <code>JMSQueueControl queueControl = (JMSQueueControl)MBeanServerInvocationHandler.newProxyInstance(mbsc,
@@ -113,7 +114,7 @@ under the License.
                                                                                               false);
              </code>
         </pre>
-                
+
         <li>We use this mbean proxy to retrieve the number of messages in the queue using the <code>getMessageCount</code> method</li>
         <pre class="prettyprint">
             <code>System.out.println(queueControl.getName() + " contains " + queueControl.getMessageCount() + " messages");</code>
@@ -123,36 +124,36 @@ under the License.
         <pre class="prettyprint">
             <code>System.out.println("message has been removed: " + queueControl.removeMessage(message.getJMSMessageID()));</code>
         </pre>
-        
+
         <li>We use again the mbean proxy to retrieve the number of messages. This time, it will display <code>0</code> messages</li>
         <pre class="prettyprint">
             <code>System.out.println(queueControl.getName() + " contains " + queueControl.getMessageCount() + " messages");</code>
         </pre>
-        
+
         <li>Now we have finish the management operations, we close the JMX connector</li>
         <pre class="prettyprint">
             <code>connector.close()</code>
         </pre>
 
         <p><em>We will now try to consume the message sent to the queue but it won't be there: it has been removed by the management operation</em></p>
-        
+
         <li>We create a JMS message consumer on the queue</li>
         <pre class="prettyprint">
             <code>MessageConsumer messageConsumer = session.createConsumer(queue);</code>
         </pre>
-        
+
         <li>We start the connection. In order for delivery to occur on any consumers or subscribers on a connection, the connection must be started</li>
         <pre class="prettyprint">
             <code>connection.start();</code>
         </pre>
-        
+
         <li>We try to receive a message from the queue. Since there is none, the call will timeout after 5000ms and messageReceived will be null
         </li>
         <pre class="prettyprint">
             <code>TextMessage messageReceived = (TextMessage) messageConsumer.receive(5000);
             System.out.println("Received message: " + messageReceived);</code>
         </pre>
-        
+
         <li>And finally, <b>always</b> remember to close your JMS connections and resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
 
         <pre class="prettyprint">
@@ -169,9 +170,9 @@ under the License.
            }</code>
         </pre>
      </ol>
-     
+
      <h2>More information</h2>
-     
+
      <ul>
         <li>User Manual's <a href="../../../docs/user-manual/en/html_single/index.html#management.jmx">Using Management Via JMX chapter</a></li>
         <li><a href="http://java.sun.com/j2se/1.5.0/docs/guide/management/agent.html">Java 5 Management guide</a></li>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/large-message/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/large-message/pom.xml b/examples/jms/large-message/pom.xml
index cc354e6..2382cdf 100644
--- a/examples/jms/large-message/pom.xml
+++ b/examples/jms/large-message/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-large-message-example</artifactId>
+   <artifactId>large-message</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS Large Message Example</name>
 
@@ -42,50 +43,46 @@ under the License.
          <version>${project.version}</version>
       </dependency>
       <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
       </dependency>
    </dependencies>
 
-   <profiles>
-      <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>create</id>
-                        <goals>
-                           <goal>create</goal>
-                        </goals>
-                     </execution>
-                     <execution>
-                        <id>runClient</id>
-                        <goals>
-                           <goal>runClient</goal>
-                        </goals>
-                        <configuration>
-                           <clientClass>org.apache.activemq.artemis.jms.example.LargeMessageExample</clientClass>
-                           <args>
-                              <param>${basedir}/target/server0</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-large-message-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                   </dependencies>
-               </plugin>
-            </plugins>
-         </build>
-      </profile>
-   </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+               </execution>
+               <execution>
+                  <id>runClient</id>
+                  <goals>
+                     <goal>runClient</goal>
+                  </goals>
+                  <configuration>
+                     <clientClass>org.apache.activemq.artemis.jms.example.LargeMessageExample</clientClass>
+                     <args>
+                        <param>${basedir}/target/server0</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>large-message</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/large-message/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/large-message/readme.html b/examples/jms/large-message/readme.html
index 6f0e6f8..1583a2b 100644
--- a/examples/jms/large-message/readme.html
+++ b/examples/jms/large-message/readme.html
@@ -27,6 +27,9 @@ under the License.
   <body onload="prettyPrint()">
      <h1>Large Message Example</h1>
 
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, This example will start and stop the server since it will look for a failure.</pre>
+
+
      <p>This example shows you how to send and receive very large messages with ActiveMQ Artemis.</p>
      <p>ActiveMQ Artemis supports the sending and receiving of huge messages, much larger than can fit in available RAM
      on the client or server. Effectively the only limit to message size is the amount of disk space you have on the server.</p>
@@ -35,8 +38,7 @@ under the License.
      <p>In order to do this ActiveMQ Artemis provides an extension to JMS where you can use an InputStream or OutputStream as the source and destination for your messages. You can send messages as large as it would fit in your disk.</p>
      <p>You may also choose to read LargeMessages using the regular ByteStream or ByteMessage methods, but using the InputStream and OutputStream will provide you a much better performance</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>
+     <h2>Example step-by-step</h2>
      <p>In this example we limit both the server and the client to be running in a maximum of 50MB of RAM,
      and we send a message with a body of size 256MB.</p>
      <p>ActiveMQ Artemis can support much large message sizes but we
@@ -95,17 +97,17 @@ under the License.
         file, however we could use any InputStream not just a FileInputStream.</li>
         <pre class="prettyprint"><code>
          FileInputStream fileInputStream = new FileInputStream(fileInput);
-         
+
          BufferedInputStream bufferedInput = new BufferedInputStream(fileInputStream);
-         
+
          message.setObjectProperty("JMS_AMQ_InputStream", bufferedInput);
         </code></pre>
-        
+
         <li>Send the Message.</li>
         <pre class="prettyprint"><code>
          producer.send(message);
          </code></pre>
-        
+
 
         <li>We send message to the queue. After the send completion the message file will be located at ./build/data/largeMessages</li>
         <pre class="prettyprint">
@@ -116,7 +118,7 @@ under the License.
         To demonstrate that that we're not simply streaming the message from sending to consumer, we stop
         the server and restart it before consuming the message. This demonstrates that the large message gets persisted, like a
         normal persistent message, on the server. If you look at ./build/data/largeMessages you will see the largeMessage
-        stored on disk the server.        
+        stored on disk the server.
         </li>
           <pre class="prettyprint">
            <code>
@@ -149,7 +151,7 @@ under the License.
         MessageConsumer messageConsumer = session.createConsumer(queue);
 
         connection.start();
-           
+
            </code>
         </pre>
 
@@ -157,7 +159,7 @@ under the License.
         an empty body.</li>
         <pre class="prettyprint"><code>BytesMessage messageReceived = (BytesMessage)messageConsumer.receive(120000);
         </code></pre>
-        
+
         <li>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.
          You don't have to use a FileOutputStream, you can use any OutputStream.
@@ -169,14 +171,14 @@ under the License.
          FileOutputStream fileOutputStream = new FileOutputStream(outputFile);
 
          BufferedOutputStream bufferedOutput = new BufferedOutputStream(fileOutputStream);
-         
+
         </code></pre>
-         
-         <li>This will save the stream and wait until the entire message is written before continuing.</li> 
+
+         <li>This will save the stream and wait until the entire message is written before continuing.</li>
         <pre class="prettyprint"><code>
          messageReceived.setObjectProperty("JMS_AMQ_SaveStream", bufferedOutput);
         </code></pre>
-        
+
         <li>Be sure to close our resources!</li>
 
         <pre class="prettyprint">

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 15e9d38..6f5e89a 100644
--- a/examples/jms/last-value-queue/pom.xml
+++ b/examples/jms/last-value-queue/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-last-value-queue-example</artifactId>
+   <artifactId>last-value-queue</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS Last Value Queue Example</name>
 
@@ -37,71 +38,81 @@ under the License.
 
    <dependencies>
       <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
       </dependency>
    </dependencies>
 
    <profiles>
       <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>create</id>
-                        <goals>
-                           <goal>create</goal>
-                        </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.LastValueQueueExample</clientClass>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>cli</goal>
-                        </goals>
-                        <configuration>
-                           <args>
-                              <param>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-last-value-queue-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-                </plugin>
-            </plugins>
-         </build>
+         <!-- specify -PnoServer if you don't want to start the server -->
+         <id>noServer</id>
+         <properties>
+            <noServer>true</noServer>
+         </properties>
       </profile>
    </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <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.LastValueQueueExample</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>last-value-queue</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/last-value-queue/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/last-value-queue/readme.html b/examples/jms/last-value-queue/readme.html
index 303c136..1ecb6e8 100644
--- a/examples/jms/last-value-queue/readme.html
+++ b/examples/jms/last-value-queue/readme.html
@@ -27,25 +27,26 @@ under the License.
   <body onload="prettyPrint()">
      <h1>Last-Value Queue Example</h1>
 
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
+
      <p>This example shows you how to configure and use last-value queues.</p>
      <p>Last-Value queues are special queues which discard any messages when a newer message with the same value for a well-defined <em>Last-Value</em> property is put in the queue.
          In other words, a Last-Value queue only retains the last value.</p>
      <p>A typical example for Last-Value queue is for stock prices, where you are only interested by the latest value for a particular stock.</p>
-         
+
      <p>The example will send 3 messages with the same <em>Last-Value</em> property to a to a Last-Value queue.<br />
         We will browse the queue and see that only the last message is in the queue, the first two messages have been discarded. <br />
         We will then consume from the queue the <em>last</em> message.</p>
-        
+
      <h2>Example setup</h2>
      <p>Last-Value queues are defined in the configuration file <a href="server0/broker.xml">broker.xml</a>:</p>
      <pre class="prettyprint">
          <code>&lt;address-setting match="jms.queue.lastValueQueue"&gt;
                 &lt;last-value-queue&gt;true&lt;/last-value-queue&gt;
          &lt;/address-setting&gt;</code>
-     </pre>          
-     
+     </pre>
+
      <h2>Example step-by-step</h2>
-     <p><i>To run the example, simply type <code>mvn verify -Pexample</code> from this directory</i></p>
      <ol>
         <li>First we need to get an initial context so we can look-up the JMS connection factory and destination objects from JNDI. This initial context will get it's properties from the <a href="server0/client-jndi.properties">client-jndi.properties</a></li>
         <pre class="prettyprint">
@@ -68,7 +69,7 @@ under the License.
             Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
             MessageProducer producer = session.createProducer(queue);</code>
        </pre>
-       
+
        <li>We will create and send a text message with the Last-Value property set to <code>STOCK_NAME</code></li>
        <pre class="prettyprint">
            <code>TextMessage message = session.createTextMessage("1st message with Last-Value property set");
@@ -76,7 +77,7 @@ under the License.
            producer.send(message);
            System.out.format("Sent message: %s\n", message.getText());</code>
        </pre>
-       
+
        <p><em>The <em>Last-Value</em> key is defined in ActiveMQ's MessageImpl class. Its value is <code>"_AMQ_LVQ_NAME"</code></em></p>
 
        <li>We will create and send a <em>second</em> text message with the Last-Value property set to <code>STOCK_NAME</code></li>
@@ -111,14 +112,14 @@ under the License.
             browser.close();
             </code>
         </pre>
-        
+
         <p><em>We will now consume the message on the queue</em></p>
 
         <li>We create a JMS message consumer on the queue</li>
         <pre class="prettyprint">
             <code>MessageConsumer messageConsumer = session.createConsumer(queue);</code>
         </pre>
-        
+
         <li>We start the connection. In order for delivery to occur on any consumers or subscribers on a connection, the connection must be started</li>
         <pre class="prettyprint">
            <code>connection.start();</code>
@@ -129,7 +130,7 @@ under the License.
            <code> TextMessage messageReceived = (TextMessage)messageConsumer.receive(5000);
             System.out.format("Received message: %s\n", messageReceived.getText());</code>
         </pre>
-        
+
         <li>We will try to receive another message but there is no other on the queue. The <code>receive</code> method will timeout after 5 seconds</li>
         <pre class="prettyprint">
            <code> messageReceived = (TextMessage)messageConsumer.receive(5000);
@@ -151,9 +152,9 @@ under the License.
            }</code>
         </pre>
      </ol>
-     
+
      <h2>More information</h2>
-     
+
      <ul>
         <li>User Manual's <a href="../../../docs/user-manual/en/html_single/index.html#last-value-queues">Last-Value Queues chapter</a></li>
      </ul>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 72b001b..2c37503 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
@@ -16,17 +16,17 @@
  */
 package org.apache.activemq.artemis.jms.example;
 
-import java.util.Enumeration;
-
 import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
 import javax.jms.MessageConsumer;
 import javax.jms.MessageProducer;
 import javax.jms.Queue;
 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.api.jms.ActiveMQJMSClient;
+import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
 
 /**
  * This example shows how to configure and use a <em>Last-Value</em> queues.
@@ -37,17 +37,13 @@ public class LastValueQueueExample
    public static void main(final String[] args) throws Exception
    {
       Connection connection = null;
-      InitialContext initialContext = null;
       try
       {
-         // Step 1. Create an initial context to perform the JNDI lookup.
-         initialContext = new InitialContext();
+         // Step 2. new Queue
+         Queue queue = ActiveMQJMSClient.createQueue("exampleQueue");
 
-         // Step 2. Perfom a lookup on the queue
-         Queue queue = (Queue)initialContext.lookup("queue/exampleQueue");
-
-         // Step 3. Perform a lookup on the Connection Factory
-         ConnectionFactory cf = (ConnectionFactory)initialContext.lookup("ConnectionFactory");
+         // Step 3. new Connection Factory
+         ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory();
 
          // Step 4.Create a JMS Connection, session and producer on the queue
          connection = cf.createConnection();
@@ -99,15 +95,11 @@ public class LastValueQueueExample
          messageReceived = (TextMessage)messageConsumer.receive(5000);
          System.out.format("Received message: %s%n", messageReceived);
 
-         initialContext.close();
+         cf.close();
       }
       finally
       {
          // Step 13. Be sure to close our JMS resources!
-         if (initialContext != null)
-         {
-            initialContext.close();
-         }
          if (connection != null)
          {
             connection.close();

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/management-notifications/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/management-notifications/pom.xml b/examples/jms/management-notifications/pom.xml
index 8caa70f..a9adba3 100644
--- a/examples/jms/management-notifications/pom.xml
+++ b/examples/jms/management-notifications/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-management-notifications-example</artifactId>
+   <artifactId>management-notifications</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS Management Notifications Example</name>
 
@@ -37,71 +38,81 @@ under the License.
 
    <dependencies>
       <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
       </dependency>
    </dependencies>
 
    <profiles>
       <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>create</id>
-                        <goals>
-                           <goal>create</goal>
-                        </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.ManagementNotificationExample</clientClass>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>cli</goal>
-                        </goals>
-                        <configuration>
-                           <args>
-                              <param>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-management-notifications-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-                </plugin>
-            </plugins>
-         </build>
+         <!-- specify -PnoServer if you don't want to start the server -->
+         <id>noServer</id>
+         <properties>
+            <noServer>true</noServer>
+         </properties>
       </profile>
    </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <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.ManagementNotificationExample</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>management-notifications</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/management-notifications/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/management-notifications/readme.html b/examples/jms/management-notifications/readme.html
index 20406cb..6a76f62 100644
--- a/examples/jms/management-notifications/readme.html
+++ b/examples/jms/management-notifications/readme.html
@@ -26,6 +26,9 @@ under the License.
   </head>
   <body onload="prettyPrint()">
      <h1>Management Notification Example</h1>
+
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
+
      <p>This example shows how to receive management notifications from ActiveMQ Artemis using JMS Messages.</p>
      <p>ActiveMQ Artemis servers emit management notifications when events of interest occur (consumers are created or closed,
          destinations are created or deleted, security authentication fails, etc.).<br />
@@ -33,7 +36,7 @@ under the License.
          from a well-known destination.</p>
      <p>This example will setup a JMS MessageListener to receive management notifications. We will also perform normal JMS operations to see the kind
          of notifications they trigger.</p>
-     
+
      <h2>Example configuration</h2>
 
      <p>ActiveMQ Artemis can configured to send JMS messages when management notifications are emitted on the server.</p>
@@ -42,7 +45,7 @@ under the License.
       <pre class="prettyprint">
          <code>&lt;management-notification-address&gt;jms.topic.notificationsTopic&lt;/management-notification-address&gt;</code>
      </pre>
-     
+
      <p>Since we want to lookup the notifications topic using JNDI, we also declare it in  <a href="server0/activemq-jms.xml">activemq-jms.xml</a>
      <pre class="prettyprint">
          <code>&lt;topic name="notificationsTopic"&gt;
@@ -59,10 +62,9 @@ under the License.
             &lt;permission type="deleteNonDurableQueue" roles="guest"/&gt;
          &lt;/security-setting&gt;</code>
      </pre>
-     
+
      <h2>Example step-by-step</h2>
-     <p><em>To run the example, simply type <code>mvn verify -Pexample</code> from this directory</em></p>
-     <ol>
+x     <ol>
         <li>First we need to get an initial context so we can look-up the JMS connection factory and destination objects from JNDI. This initial context will get its properties from <a href="server0/client-jndi.properties">client-jndi.properties</a></li>
         <pre class="prettyprint">
             <code>InitialContext initialContext = getContext(0);</code>
@@ -84,7 +86,7 @@ under the License.
             Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
             MessageProducer producer = session.createProducer(queue);</code>
         </pre>
-        
+
         <li>We look up the JMS Topic used to receive the notifications from JNDI</li>
         <pre class="prettyprint">
             <code>Topic notificationsTopic = (Topic) initialContext.lookup("/topic/notificationsTopic");</code>
@@ -112,23 +114,23 @@ under the License.
                  {
                  }
                  System.out.println("------------------------");
-              }            
+              }
            });</code>
         </pre>
-        
+
         <li>We start the connection to receive messages</li>
         <pre class="prettyprint">
             <code>connection.start();</code>
         </pre>
-        
-        <p><em>Now that a message listener is setup to receive management notifications, we will perform regular JMS operations to 
+
+        <p><em>Now that a message listener is setup to receive management notifications, we will perform regular JMS operations to
             see what kind of notifications are triggered</em></p>
-            
+
         <li>We create a JMS message consumer on the example queue</li>
         <pre class="prettyprint">
             <code>MessageConsumer consumer = session.createConsumer(queue);</code>
         </pre>
-        
+
         <p>This will generate a <code>CONSUMER_CREATED</code> notification:
         <pre class="prettyprint">
             <code>------------------------
@@ -143,7 +145,7 @@ under the License.
         </pre>
         <p>The notification tells us that a consumer was created for the JMS queue <code>exampleQueue</code>. When the notification
             was emitted, this consumer was the only one for the queue</p>
-            
+
         <li>We close this consumer</li>
         <pre class="prettyprint">
             <code>consumer.close();</code>
@@ -170,10 +172,10 @@ under the License.
             {
                cf.createConnection("not.a.valid.user", "not.a.valid.password");
             } catch (JMSException e)
-            {            
+            {
             }</code>
         </pre>
-        
+
         <p>This will generate a <code>SECURITY_AUTHENTICATION_VIOLATION</code> notification:
         <pre class="prettyprint">
             <code>------------------------
@@ -185,7 +187,7 @@ under the License.
             </code>
         </pre>
         <p>The notification tells us that a user named <code>not.a.valid.user</code> failed to authenticate when creating a connection to ActiveMQ Artemis.</p>
-        
+
         <li>And finally, <b>always</b> remember to close your JMS connections and resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
 
         <pre class="prettyprint">
@@ -202,12 +204,12 @@ under the License.
            }</code>
         </pre>
      </ol>
-     
+
      <h2>More information</h2>
-     
+
      <ul>
          <li>User Manual's <a href="../../../docs/user-manual/en/html_single/index.html#management.notifications">Management Notifications chapter</a></li>
-     </ul>         
+     </ul>
 
   </body>
 </html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/management/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/management/pom.xml b/examples/jms/management/pom.xml
index d287c28..b84b8f5 100644
--- a/examples/jms/management/pom.xml
+++ b/examples/jms/management/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-management-example</artifactId>
+   <artifactId>management</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS Management Example</name>
 
@@ -41,72 +42,77 @@ under the License.
          <artifactId>artemis-jms-client</artifactId>
          <version>${project.version}</version>
       </dependency>
-      <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
-      </dependency>
    </dependencies>
 
    <profiles>
       <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>create</id>
-                        <goals>
-                           <goal>create</goal>
-                        </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.ManagementExample</clientClass>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>cli</goal>
-                        </goals>
-                        <configuration>
-                           <args>
-                              <param>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-management-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
+         <!-- specify -PnoServer if you don't want to start the server -->
+         <id>noServer</id>
+         <properties>
+            <noServer>true</noServer>
+         </properties>
       </profile>
    </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <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.ManagementExample</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>management</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>


[06/18] activemq-artemis git commit: ARTEMIS-180 removing -Pexample and some other improvements around the examples

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 9173c64..9b89d80 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:./data}/bindings</bindings-directory>
+      <bindings-directory>./data/bindings</bindings-directory>
 
-      <journal-directory>${data.dir:./data}/journal</journal-directory>
+      <journal-directory>./data/journal</journal-directory>
 
-      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
+      <large-messages-directory>./data/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir:./data}/paging</paging-directory>
+      <paging-directory>./data/paging</paging-directory>
 
       <cluster-user>exampleUser</cluster-user>
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/replicated-failback/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/replicated-failback/pom.xml b/examples/jms/replicated-failback/pom.xml
index d9c5150..9cfdbc5 100644
--- a/examples/jms/replicated-failback/pom.xml
+++ b/examples/jms/replicated-failback/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-replicated-failback-example</artifactId>
+   <artifactId>replicated-failback</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS Replicated Failback Example</name>
 
@@ -47,61 +48,56 @@ under the License.
       </dependency>
    </dependencies>
 
-   <profiles>
-      <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <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>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <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>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>runClient</id>
-                        <goals>
-                           <goal>runClient</goal>
-                        </goals>
-                        <configuration>
-                           <clientClass>org.apache.activemq.artemis.jms.example.ReplicatedFailbackExample</clientClass>
-                           <args>
-                              <param>${basedir}/target/server0</param>
-                              <param>${basedir}/target/server1</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-replicated-failback-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
-      </profile>
-   </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <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>
+                  </configuration>
+               </execution>
+               <execution>
+                  <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>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>runClient</id>
+                  <goals>
+                     <goal>runClient</goal>
+                  </goals>
+                  <configuration>
+                     <clientClass>org.apache.activemq.artemis.jms.example.ReplicatedFailbackExample</clientClass>
+                     <args>
+                        <param>${basedir}/target/server0</param>
+                        <param>${basedir}/target/server1</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>replicated-failback</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/replicated-failback/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/replicated-failback/readme.html b/examples/jms/replicated-failback/readme.html
index c42eaa1..aaf90eb 100644
--- a/examples/jms/replicated-failback/readme.html
+++ b/examples/jms/replicated-failback/readme.html
@@ -27,146 +27,12 @@ under the License.
   <body onload="prettyPrint()">
      <h1>JMS Multiple Failover using Replication Example</h1>
 
-     <b>Note that failback example is not working in 2.3.0.Alpha but will be fully functional in the next release.</b>
-     
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory.</pre>
+
      <p>This example demonstrates three servers coupled as a live-backup-backup group for high availability (HA) using replication, and a client
      connection failing over from live to backup when the live server is crashed and then to the second backup once the new live fails.</p>
 
      <p>For more information on ActiveMQ Artemis failover and HA, and clustering in general, please see the clustering
      section of the user manual.</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>
-     <p>In this example, the live server is server 1, and the backup server is server 0</p>
-     <p>The connection will initially be created to server1, server 1 will crash, and the client will carry on
-     seamlessly on server 0, the backup server.</p>
-
-     <ol>
-        <li>Get an initial context for looking up JNDI from server #0.</li>
-        <pre class="prettyprint">
-           initialContext = getContext(0);
-        </pre>
-
-        <li>Look up the JMS resources from JNDI on server #0.</li>
-        <pre class="prettyprint">
-           Queue queue = (Queue)initialContext.lookup("/queue/exampleQueue");
-           ConnectionFactory connectionFactory = (ConnectionFactory)initialContext.lookup("/ConnectionFactory");
-        </pre>
-
-        <li>Create a JMS Connection</li>
-        <pre class="prettyprint">
-           connection = connectionFactory.createConnection();
-        </pre>
-        
-        <li>Create a client acknowledged Session</li>
-        <pre class="prettyprint">
-           Session session = connection.createSession(false, Session.CLIENT_ACKNOWLEDGE);
-        </pre>
-        
-        <li>Start the connection to ensure delivery occurs</li>
-        <pre class="prettyprint">
-           connection.start();
-        </pre>
-
-        <li>Create a JMS MessageProducer</li>
-        <pre class="prettyprint">
-           MessageProducer producer = session.createProducer(queue);
-        </pre>
-
-        <li>Create a JMS MessageConsumer</li>
-        <pre class="prettyprint">
-           MessageConsumer consumer = session.createConsumer(queue);
-        </pre>
-
-        <li>Send some messages to server #0, the live server</li>
-        <pre class="prettyprint">
-           for (int i = 0; i < numMessages; i++)
-            {
-                TextMessage message = session.createTextMessage("This is text message " + i);
-                producer.send(message);
-                System.out.println("Sent message: " + message.getText());
-            }
-        </pre>
-
-        <li>Receive and acknowledge a third of the sent messages</li>
-        <pre class="prettyprint">
-           TextMessage message0 = null;
-            for (int i = 0; i < numMessages / 3; i++)
-            {
-               message0 = (TextMessage)consumer.receive(5000);
-               System.out.println("Got message: " + message0.getText());
-            }
-            message0.acknowledge();
-        </pre>
-
-        <p>When server #0 crashes, the client automatically detects the failure and automatically
-            fails over from server #0 to server #1 (in your real program you wouldn't need to sleep).
-        </p>
-        
-        <li>Acknowledging the 2nd third of the sent messages will fail as failover to the backup server has occurred</li>
-        <pre class="prettyprint">
-           try
-             {
-               message0.acknowledge();
-            }
-             catch (JMSException e)
-            {
-               System.err.println("Got exception while acknowledging message: " + e.getMessage());
-            }
-        </pre>
-        
-        <li>Consume again the 2nd third of the messages again. Note that they are not considered as redelivered.</li>
-        <pre class="prettyprint">
-           for (int i = numMessages / 3; i < (numMessages / 3) * 2; i++)
-            {
-              message0 = (TextMessage)consumer.receive(5000);
-             System.out.printf("Got message: %s (redelivered?: %s)\n", message0.getText(), message0.getJMSRedelivered());
-             }
-         message0.acknowledge();
-        </pre>
-
-         <p>now we Kill server #1 and wait for the server #2 to take over the responsibilities.</p>
-
-        <li>Acknowledging the 3rd third of the sent messages will fail as failover to the backup server has occurred</li>
-        <pre class="prettyprint">
-           try
-            {
-               message0.acknowledge();
-           }
-           catch (JMSException e)
-          {
-                System.err.println("Got exception while acknowledging message: " + e.getMessage());
-             }
-        </pre>
-        
-
-        <li>Consume again the 3rd third of the messages again. Note that they are not considered as redelivered</li>
-        <pre class="prettyprint">
-            for (int i = (numMessages / 3) * 2; i < numMessages; i++)
-             {
-               message0 = (TextMessage)consumer.receive(5000);
-               System.out.printf("Got message: %s (redelivered?: %s)\n", message0.getText(), message0.getJMSRedelivered());
-            }
-             message0.acknowledge();
-        </pre>
-        
-        <li>And finally, <strong>always</strong> remember to close your resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
-
-        <pre class="prettyprint">
-           finally
-           {
-              if (connection != null)
-              {
-                 connection.close();
-              }
-
-              if (initialContext != null)
-              {
-                 initialContext.close();
-              }
-           }
-        </pre>
-
-     </ol>
   </body>
 </html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 ab85a38..c7f4783 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:./data}/bindings</bindings-directory>
+      <bindings-directory>./data/bindings</bindings-directory>
 
-      <journal-directory>${data.dir:./data}/journal</journal-directory>
+      <journal-directory>./data/journal</journal-directory>
 
-      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
+      <large-messages-directory>./data/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir:./data}/paging</paging-directory>
+      <paging-directory>./data/paging</paging-directory>
 
       <cluster-user>exampleUser</cluster-user>
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 cfb7e33..da5a656 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:./data}/bindings</bindings-directory>
+      <bindings-directory>./data/bindings</bindings-directory>
 
-      <journal-directory>${data.dir:./data}/journal</journal-directory>
+      <journal-directory>./data/journal</journal-directory>
 
-      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
+      <large-messages-directory>./data/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir:./data}/paging</paging-directory>
+      <paging-directory>./data/paging</paging-directory>
 
       <cluster-user>exampleUser</cluster-user>
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 d1af812..bd9a44c 100644
--- a/examples/jms/replicated-multiple-failover/pom.xml
+++ b/examples/jms/replicated-multiple-failover/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-replicated-multiple-failover-example</artifactId>
+   <artifactId>replicated-multiple-failover</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS Replicated Multiple Failover Example</name>
 
@@ -42,79 +43,76 @@ under the License.
          <version>${project.version}</version>
       </dependency>
       <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
       </dependency>
    </dependencies>
 
-   <profiles>
-      <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <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>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <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>
-                        </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>
-                        </goals>
-                        <configuration>
-                           <clientClass>org.apache.activemq.artemis.jms.example.ReplicatedMultipleFailoverExample</clientClass>
-                           <args>
-                              <param>${basedir}/target/server0</param>
-                              <param>${basedir}/target/server1</param>
-                              <param>${basedir}/target/server2</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-replicated-multiple-failover-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
-      </profile>
-   </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <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>
+                  </configuration>
+               </execution>
+               <execution>
+                  <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>
+                  </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>
+                  </goals>
+                  <configuration>
+                     <clientClass>org.apache.activemq.artemis.jms.example.ReplicatedMultipleFailoverExample
+                     </clientClass>
+                     <args>
+                        <param>${basedir}/target/server0</param>
+                        <param>${basedir}/target/server1</param>
+                        <param>${basedir}/target/server2</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>replicated-multiple-failover</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/replicated-multiple-failover/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/replicated-multiple-failover/readme.html b/examples/jms/replicated-multiple-failover/readme.html
index d852f8f..63ec95f 100644
--- a/examples/jms/replicated-multiple-failover/readme.html
+++ b/examples/jms/replicated-multiple-failover/readme.html
@@ -26,7 +26,10 @@ under the License.
   </head>
   <body onload="prettyPrint()">
      <h1>JMS Multiple Failover using Replication Example</h1>
-     
+
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory.</pre>
+
+
      <p>This example demonstrates three servers coupled as a live-backup-backup group for high availability (HA) using replication, and a client
      connection failing over from live to backup when the live server is crashed and then to the second backup once the new live fails.</p>
 
@@ -38,133 +41,5 @@ under the License.
      <p>In this example, the live server is server 1, and the backup server is server 0</p>
      <p>The connection will initially be created to server1, server 1 will crash, and the client will carry on
      seamlessly on server 0, the backup server.</p>
-
-     <ol>
-        <li>Get an initial context for looking up JNDI from server #0.</li>
-        <pre class="prettyprint">
-           initialContext = getContext(0);
-        </pre>
-
-        <li>Look up the JMS resources from JNDI on server #0.</li>
-        <pre class="prettyprint">
-           Queue queue = (Queue)initialContext.lookup("/queue/exampleQueue");
-           ConnectionFactory connectionFactory = (ConnectionFactory)initialContext.lookup("/ConnectionFactory");
-        </pre>
-
-        <li>Create a JMS Connection</li>
-        <pre class="prettyprint">
-           connection = connectionFactory.createConnection();
-        </pre>
-        
-        <li>Create a client acknowledged Session</li>
-        <pre class="prettyprint">
-           Session session = connection.createSession(false, Session.CLIENT_ACKNOWLEDGE);
-        </pre>
-        
-        <li>Start the connection to ensure delivery occurs</li>
-        <pre class="prettyprint">
-           connection.start();
-        </pre>
-
-        <li>Create a JMS MessageProducer</li>
-        <pre class="prettyprint">
-           MessageProducer producer = session.createProducer(queue);
-        </pre>
-
-        <li>Create a JMS MessageConsumer</li>
-        <pre class="prettyprint">
-           MessageConsumer consumer = session.createConsumer(queue);
-        </pre>
-
-        <li>Send some messages to server #0, the live server</li>
-        <pre class="prettyprint">
-           for (int i = 0; i < numMessages; i++)
-            {
-                TextMessage message = session.createTextMessage("This is text message " + i);
-                producer.send(message);
-                System.out.println("Sent message: " + message.getText());
-            }
-        </pre>
-
-        <li>Receive and acknowledge a third of the sent messages</li>
-        <pre class="prettyprint">
-           TextMessage message0 = null;
-            for (int i = 0; i < numMessages / 3; i++)
-            {
-               message0 = (TextMessage)consumer.receive(5000);
-               System.out.println("Got message: " + message0.getText());
-            }
-            message0.acknowledge();
-        </pre>
-
-        <p>When server #0 crashes, the client automatically detects the failure and automatically
-            fails over from server #0 to server #1 (in your real program you wouldn't need to sleep).
-        </p>
-        
-        <li>Acknowledging the 2nd third of the sent messages will fail as failover to the backup server has occurred</li>
-        <pre class="prettyprint">
-           try
-             {
-               message0.acknowledge();
-            }
-             catch (JMSException e)
-            {
-               System.err.println("Got exception while acknowledging message: " + e.getMessage());
-            }
-        </pre>
-        
-        <li>Consume again the 2nd third of the messages again. Note that they are not considered as redelivered.</li>
-        <pre class="prettyprint">
-           for (int i = numMessages / 3; i < (numMessages / 3) * 2; i++)
-            {
-              message0 = (TextMessage)consumer.receive(5000);
-             System.out.printf("Got message: %s (redelivered?: %s)\n", message0.getText(), message0.getJMSRedelivered());
-             }
-         message0.acknowledge();
-        </pre>
-
-         <p>now we Kill server #1 and wait for the server #2 to take over the responsibilities.</p>
-
-        <li>Acknowledging the 3rd third of the sent messages will fail as failover to the backup server has occurred</li>
-        <pre class="prettyprint">
-           try
-            {
-               message0.acknowledge();
-           }
-           catch (JMSException e)
-          {
-                System.err.println("Got exception while acknowledging message: " + e.getMessage());
-             }
-        </pre>
-        
-
-        <li>Consume again the 3rd third of the messages again. Note that they are not considered as redelivered</li>
-        <pre class="prettyprint">
-            for (int i = (numMessages / 3) * 2; i < numMessages; i++)
-             {
-               message0 = (TextMessage)consumer.receive(5000);
-               System.out.printf("Got message: %s (redelivered?: %s)\n", message0.getText(), message0.getJMSRedelivered());
-            }
-             message0.acknowledge();
-        </pre>
-        
-        <li>And finally, <strong>always</strong> remember to close your resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
-
-        <pre class="prettyprint">
-           finally
-           {
-              if (connection != null)
-              {
-                 connection.close();
-              }
-
-              if (initialContext != null)
-              {
-                 initialContext.close();
-              }
-           }
-        </pre>
-
-     </ol>
   </body>
 </html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 fb321c2..43f1693 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:./data}/bindings</bindings-directory>
+      <bindings-directory>./data/bindings</bindings-directory>
 
-      <journal-directory>${data.dir:./data}/journal</journal-directory>
+      <journal-directory>./data/journal</journal-directory>
 
-      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
+      <large-messages-directory>./data/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir:./data}/paging</paging-directory>
+      <paging-directory>./data/paging</paging-directory>
 
       <ha-policy>
          <replication>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 1cb959c..7f17fb8 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:./data}/bindings</bindings-directory>
+      <bindings-directory>./data/bindings</bindings-directory>
 
-      <journal-directory>${data.dir:./data}/journal</journal-directory>
+      <journal-directory>./data/journal</journal-directory>
 
-      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
+      <large-messages-directory>./data/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir:./data}/paging</paging-directory>
+      <paging-directory>./data/paging</paging-directory>
 
       <ha-policy>
          <replication>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 fbbd45f..c5f06cc 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:./data}/bindings</bindings-directory>
+      <bindings-directory>./data/bindings</bindings-directory>
 
-      <journal-directory>${data.dir:./data}/journal</journal-directory>
+      <journal-directory>./data/journal</journal-directory>
 
-      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
+      <large-messages-directory>./data/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir:./data}/paging</paging-directory>
+      <paging-directory>./data/paging</paging-directory>
 
       <ha-policy>
          <replication>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 2c10c66..437404c 100644
--- a/examples/jms/replicated-transaction-failover/pom.xml
+++ b/examples/jms/replicated-transaction-failover/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-replicated-transaction-failover-example</artifactId>
+   <artifactId>replicated-transaction-failover</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS Replicated Transaction Failover Example</name>
 
@@ -42,66 +43,62 @@ under the License.
          <version>${project.version}</version>
       </dependency>
       <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
       </dependency>
    </dependencies>
-
-   <profiles>
-      <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <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>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <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>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>runClient</id>
-                        <goals>
-                           <goal>runClient</goal>
-                        </goals>
-                        <configuration>
-                           <clientClass>org.apache.activemq.artemis.jms.example.ReplicatedTransactionFailoverExample</clientClass>
-                           <args>
-                              <param>${basedir}/target/server0</param>
-                              <param>${basedir}/target/server1</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-replicated-transaction-failover-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
-      </profile>
-   </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <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>
+                  </configuration>
+               </execution>
+               <execution>
+                  <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>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>runClient</id>
+                  <goals>
+                     <goal>runClient</goal>
+                  </goals>
+                  <configuration>
+                     <clientClass>org.apache.activemq.artemis.jms.example.ReplicatedTransactionFailoverExample
+                     </clientClass>
+                     <args>
+                        <param>${basedir}/target/server0</param>
+                        <param>${basedir}/target/server1</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>replicated-transaction-failover</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 9233f17..f8b076a 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:./data}/bindings</bindings-directory>
+      <bindings-directory>./data/bindings</bindings-directory>
 
-      <journal-directory>${data.dir:./data}/journal</journal-directory>
+      <journal-directory>./data/journal</journal-directory>
 
-      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
+      <large-messages-directory>./data/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir:./data}/paging</paging-directory>
+      <paging-directory>./data/paging</paging-directory>
 
       <ha-policy>
          <replication>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 848525e..f64af4e 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:./data}/bindings</bindings-directory>
+      <bindings-directory>./data/bindings</bindings-directory>
 
-      <journal-directory>${data.dir:./data}/journal</journal-directory>
+      <journal-directory>./data/journal</journal-directory>
 
-      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
+      <large-messages-directory>./data/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir:./data}/paging</paging-directory>
+      <paging-directory>./data/paging</paging-directory>
 
       <ha-policy>
          <replication>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/request-reply/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/request-reply/pom.xml b/examples/jms/request-reply/pom.xml
index e8849d8..74dd413 100644
--- a/examples/jms/request-reply/pom.xml
+++ b/examples/jms/request-reply/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-request-reply-example</artifactId>
+   <artifactId>request-reply</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS Request Reply Example</name>
 
@@ -37,70 +38,84 @@ under the License.
 
    <dependencies>
       <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
       </dependency>
    </dependencies>
 
    <profiles>
       <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>create</id>
-                        <goals>
-                           <goal>create</goal>
-                        </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.RequestReplyExample</clientClass>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>cli</goal>
-                        </goals>
-                        <configuration>
-                           <args>
-                              <param>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-request-reply-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
+         <!-- specify -PnoServer if you don't want to start the server -->
+         <id>noServer</id>
+         <properties>
+            <noServer>true</noServer>
+         </properties>
       </profile>
    </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <args>
+                        <arg>--queues</arg>
+                        <arg>exampleQueue</arg>
+                     </args>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <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.RequestReplyExample</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>request-reply</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/request-reply/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/request-reply/src/main/resources/activemq/server0/artemis-roles.properties b/examples/jms/request-reply/src/main/resources/activemq/server0/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/request-reply/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/dd820318/examples/jms/request-reply/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/request-reply/src/main/resources/activemq/server0/artemis-users.properties b/examples/jms/request-reply/src/main/resources/activemq/server0/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/request-reply/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/dd820318/examples/jms/request-reply/src/main/resources/activemq/server0/broker.xml
----------------------------------------------------------------------
diff --git a/examples/jms/request-reply/src/main/resources/activemq/server0/broker.xml b/examples/jms/request-reply/src/main/resources/activemq/server0/broker.xml
deleted file mode 100644
index 6c344c2..0000000
--- a/examples/jms/request-reply/src/main/resources/activemq/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: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 queues -->
-         <security-setting match="jms.queue.#">
-            <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 for JMS temporary queue -->
-         <security-setting match="jms.tempqueue.#">
-            <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/dd820318/examples/jms/rest/dup-send/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/rest/dup-send/pom.xml b/examples/jms/rest/dup-send/pom.xml
index 9d1a586..4d1b993 100644
--- a/examples/jms/rest/dup-send/pom.xml
+++ b/examples/jms/rest/dup-send/pom.xml
@@ -22,7 +22,7 @@ under the License.
    <modelVersion>4.0.0</modelVersion>
    <parent>
       <groupId>org.apache.activemq.examples.rest</groupId>
-      <artifactId>artemis-rest-examples-pom</artifactId>
+      <artifactId>artemis-rests-pom</artifactId>
       <version>1.0.1-SNAPSHOT</version>
    </parent>
    <artifactId>dup-send</artifactId>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/rest/javascript-chat/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/rest/javascript-chat/pom.xml b/examples/jms/rest/javascript-chat/pom.xml
index 63958cc..9c84188 100644
--- a/examples/jms/rest/javascript-chat/pom.xml
+++ b/examples/jms/rest/javascript-chat/pom.xml
@@ -22,7 +22,7 @@ under the License.
    <modelVersion>4.0.0</modelVersion>
    <parent>
       <groupId>org.apache.activemq.examples.rest</groupId>
-      <artifactId>artemis-rest-examples-pom</artifactId>
+      <artifactId>artemis-rests-pom</artifactId>
       <version>1.0.1-SNAPSHOT</version>
    </parent>
    <artifactId>javascript-chat</artifactId>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/rest/jms-to-rest/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/rest/jms-to-rest/pom.xml b/examples/jms/rest/jms-to-rest/pom.xml
index 08f7fae..0ccd4d8 100644
--- a/examples/jms/rest/jms-to-rest/pom.xml
+++ b/examples/jms/rest/jms-to-rest/pom.xml
@@ -22,7 +22,7 @@ under the License.
    <modelVersion>4.0.0</modelVersion>
    <parent>
       <groupId>org.apache.activemq.examples.rest</groupId>
-      <artifactId>artemis-rest-examples-pom</artifactId>
+      <artifactId>artemis-rests-pom</artifactId>
       <version>1.0.1-SNAPSHOT</version>
    </parent>
    <artifactId>mixed-jms-rest</artifactId>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/rest/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/rest/pom.xml b/examples/jms/rest/pom.xml
index e19e7aa..57252e7 100644
--- a/examples/jms/rest/pom.xml
+++ b/examples/jms/rest/pom.xml
@@ -28,7 +28,7 @@ under the License.
    </parent>
 
    <groupId>org.apache.activemq.examples.rest</groupId>
-   <artifactId>artemis-rest-examples-pom</artifactId>
+   <artifactId>artemis-rests-pom</artifactId>
    <packaging>pom</packaging>
    <name>ActiveMQ Artemis REST Examples</name>
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/rest/push/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/rest/push/pom.xml b/examples/jms/rest/push/pom.xml
index 251fcaf..4a5ba53 100644
--- a/examples/jms/rest/push/pom.xml
+++ b/examples/jms/rest/push/pom.xml
@@ -22,7 +22,7 @@ under the License.
    <modelVersion>4.0.0</modelVersion>
    <parent>
       <groupId>org.apache.activemq.examples.rest</groupId>
-      <artifactId>artemis-rest-examples-pom</artifactId>
+      <artifactId>artemis-rests-pom</artifactId>
       <version>1.0.1-SNAPSHOT</version>
    </parent>
    <artifactId>push</artifactId>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/scale-down/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/scale-down/pom.xml b/examples/jms/scale-down/pom.xml
index 596273b..bba30e2 100644
--- a/examples/jms/scale-down/pom.xml
+++ b/examples/jms/scale-down/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -42,67 +43,63 @@ under the License.
          <version>${project.version}</version>
       </dependency>
       <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
       </dependency>
    </dependencies>
 
-   <profiles>
-      <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <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>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <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>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>runClient</id>
-                        <goals>
-                           <goal>runClient</goal>
-                        </goals>
-                        <configuration>
-                           <clientClass>org.apache.activemq.artemis.jms.example.ScaleDownExample</clientClass>
-                           <args>
-                              <param>${basedir}/target/server0</param>
-                              <param>${basedir}/target/server1</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>scale-down</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
-      </profile>
-   </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <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>
+                  </configuration>
+               </execution>
+               <execution>
+                  <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>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>runClient</id>
+                  <goals>
+                     <goal>runClient</goal>
+                  </goals>
+                  <configuration>
+                     <clientClass>org.apache.activemq.artemis.jms.example.ScaleDownExample</clientClass>
+                     <args>
+                        <param>${basedir}/target/server0</param>
+                        <param>${basedir}/target/server1</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>scale-down</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/scale-down/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/scale-down/readme.html b/examples/jms/scale-down/readme.html
index a73a170..c129764 100644
--- a/examples/jms/scale-down/readme.html
+++ b/examples/jms/scale-down/readme.html
@@ -27,6 +27,9 @@ under the License.
   <body onload="prettyPrint()">
      <h1>JMS Colocated Failover Shared Store Example</h1>
 
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory.</pre>
+
+
      <p>This example demonstrates how you can configure a live server to scale down messages to another live server on shutdown.
      <p>This example starts 2 live servers each one with a connector configured for the other live server.</p>
      <p>The second live server is killed and its messages are scaled down to the first server on shutdown.</p>
@@ -44,128 +47,5 @@ under the License.
      &lt;/ha-policy>
      </code>
      </pre>
-     <h2>Example step-by-step</h2>
-     <p><i>To run the example, simply type <code>mvn verify -Pexample</code> from this directory</i></p>
-
-     <ol>
-        <li> Get an initial context for looking up JNDI for both servers</li>
-        <pre class="prettyprint">
-           <code>
-    initialContext1 = getContext(1);
-    initialContext = getContext(0);
-   </code>
-        </pre>
-
-        <li>Look up the JMS resources from JNDI</li>
-        <pre class="prettyprint">
-           <code>
-    Queue queue = (Queue)initialContext.lookup("/queue/exampleQueue");
-    ConnectionFactory connectionFactory = (ConnectionFactory)initialContext.lookup("/ConnectionFactory");
-    ConnectionFactory connectionFactory1 = (ConnectionFactory)initialContext1.lookup("/ConnectionFactory");
-           </code>
-        </pre>
-
-        <li>Create a JMS Connections</li>
-        <pre class="prettyprint">
-           <code>
-    connection = connectionFactory.createConnection();
-    connection1 = connectionFactory1.createConnection();
-           </code>
-        </pre>
-
-        <li>Create a *non-transacted* JMS Session with client acknowledgement</li>
-        <pre class="prettyprint">
-           <code>
-    Session session = connection.createSession(false, Session.CLIENT_ACKNOWLEDGE);
-    Session session1 = connection1.createSession(false, Session.CLIENT_ACKNOWLEDGE);
-           </code>
-        </pre>
-
-        <li>Create a JMS MessageProducer</li>
-        <pre class="prettyprint">
-           <code>
-    MessageProducer producer = session.createProducer(queue);
-    MessageProducer producer1 = session1.createProducer(queue);
-           </code>
-        </pre>
-
-        <li>Send some messages to both servers</li>
-        <pre class="prettyprint">
-          <code>
-    for (int i = 0; i < numMessages; i++)
-    {
-      TextMessage message = session.createTextMessage("This is text message " + i);
-      producer.send(message);
-      System.out.println("Sent message: " + message.getText());
-      message = session1.createTextMessage("This is another text message " + i);
-      producer1.send(message);
-      System.out.println("Sent message: " + message.getText());
-    }
-          </code>
-        </pre>
-        
-        <li>Crash server #0, the live server</li>
-        <pre class="prettyprint">
-          <code>
-    killServer(0);
-          </code>
-        </pre>
-
-        <li>start the connection ready to receive messages</li>
-        <pre class="prettyprint">
-           <code>
-    connection.start();
-           </code>
-        </pre>
-        
-        <li>create a consumer</li>
-        <pre class="prettyprint">
-           <code>
-    MessageConsumer consumer = session.createConsumer(queue);
-            </code>
-        </pre>
-
-        <li>Receive and acknowledge all of the sent messages, you will notice that messages from both servers are received</li>
-        <pre class="prettyprint">
-           <code>
-    TextMessage message0 = null;
-    for (int i = 0; i < numMessages; i++)
-    {
-       message0 = (TextMessage)consumer.receive(5000);
-       System.out.println("Got message: " + message0.getText());
-    }
-    message0.acknowledge();
-           </code>
-        </pre>
-
-        <li>And finally (no pun intended), <b>always</b> remember to close your JMS resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
-
-        <pre class="prettyprint">
-           <code>
-    finally
-    {
-       if (connection != null)
-       {
-       connection.close();
-       }
-
-       if (initialContext != null)
-       {
-       initialContext.close();
-       }
-       if (connection1 != null)
-       {
-       connection1.close();
-       }
-
-       if (initialContext1 != null)
-       {
-       initialContext1.close();
-       }
-    }
-           </code>
-        </pre>
-
-     </ol>
   </body>
 </html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 1a08c9d..559bb5a 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,13 +29,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>${data.dir:./data}/bindings</bindings-directory>
+      <bindings-directory>./data/bindings</bindings-directory>
 
-      <journal-directory>${data.dir:./data}/journal</journal-directory>
+      <journal-directory>./data/journal</journal-directory>
 
-      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
+      <large-messages-directory>./data/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir:./data}/paging</paging-directory>
+      <paging-directory>./data/paging</paging-directory>
       <!-- Connectors -->
 
       <connectors>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 87dd4aa..6211cd3 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,13 +29,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>${data.dir:./data}/bindings</bindings-directory>
+      <bindings-directory>./data/bindings</bindings-directory>
 
-      <journal-directory>${data.dir:./data}/journal</journal-directory>
+      <journal-directory>./data/journal</journal-directory>
 
-      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
+      <large-messages-directory>./data/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir:./data}/paging</paging-directory>
+      <paging-directory>./data/paging</paging-directory>
 
       <!-- Connectors -->
       <connectors>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/scheduled-message/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/scheduled-message/pom.xml b/examples/jms/scheduled-message/pom.xml
index cfda2ac..15653a9 100644
--- a/examples/jms/scheduled-message/pom.xml
+++ b/examples/jms/scheduled-message/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-scheduled-message-example</artifactId>
+   <artifactId>scheduled-message</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS Scheduled Message Example</name>
 
@@ -42,71 +43,81 @@ under the License.
          <version>${project.version}</version>
       </dependency>
       <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
       </dependency>
    </dependencies>
 
    <profiles>
       <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>create</id>
-                        <goals>
-                           <goal>create</goal>
-                        </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.ScheduledMessageExample</clientClass>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>cli</goal>
-                        </goals>
-                        <configuration>
-                           <args>
-                              <param>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-scheduled-message-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
+         <!-- specify -PnoServer if you don't want to start the server -->
+         <id>noServer</id>
+         <properties>
+            <noServer>true</noServer>
+         </properties>
       </profile>
    </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <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.ScheduledMessageExample</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>scheduled-message</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/scheduled-message/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/scheduled-message/readme.html b/examples/jms/scheduled-message/readme.html
index b2d1621..e87406d 100644
--- a/examples/jms/scheduled-message/readme.html
+++ b/examples/jms/scheduled-message/readme.html
@@ -27,11 +27,14 @@ under the License.
   <body onload="prettyPrint()">
      <h1>JMS Scheduled Message Example</h1>
 
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
+
+
      <p>This example shows you how to send a scheduled message to a JMS Queue using ActiveMQ Artemis.</p>
-     <p>A Scheduled Message is a message that will be delivered at a time specified by the sender. To do this, 
-     simply set a HDR_SCHEDULED_DELIVERY_TIME header property. The value of the property should be the time of 
+     <p>A Scheduled Message is a message that will be delivered at a time specified by the sender. To do this,
+     simply set a HDR_SCHEDULED_DELIVERY_TIME header property. The value of the property should be the time of
      delivery in milliseconds. </p>
-     
+
      <p>In this example, a message is created with the scheduled delivery time set to 5 seconds after the current time.</p>
 
 
@@ -120,12 +123,12 @@ under the License.
         </pre>
 
      </ol>
-     
+
      <h2>More information</h2>
-     
+
      <ul>
          <li>User Manual's <a href="../../../docs/user-manual/en/html_single/index.html#scheduled-messages">Scheduled Messages chapter</a></li>
      </ul>
-     
+
   </body>
 </html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/security/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/security/pom.xml b/examples/jms/security/pom.xml
index a58e177..9bc4d1a 100644
--- a/examples/jms/security/pom.xml
+++ b/examples/jms/security/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-security-example</artifactId>
+   <artifactId>security</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS Security Example</name>
 
@@ -37,73 +38,83 @@ under the License.
 
    <dependencies>
       <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
       </dependency>
    </dependencies>
 
    <profiles>
       <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>create</id>
-                        <goals>
-                           <goal>create</goal>
-                        </goals>
-                     </execution>
-                     <execution>
-                        <id>start</id>
-                        <goals>
-                           <goal>cli</goal>
-                        </goals>
-                        <configuration>
-                           <spawn>true</spawn>
-                           <testURI>tcp://localhost:61616</testURI>
-                           <testUser>bill</testUser>
-                           <testPassword>activemq</testPassword>
-                           <args>
-                              <param>run</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>runClient</id>
-                        <goals>
-                           <goal>runClient</goal>
-                        </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>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-security-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
+         <!-- specify -PnoServer if you don't want to start the server -->
+         <id>noServer</id>
+         <properties>
+            <noServer>true</noServer>
+         </properties>
       </profile>
    </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <spawn>true</spawn>
+                     <testURI>tcp://localhost:61616</testURI>
+                     <testUser>bill</testUser>
+                     <testPassword>activemq</testPassword>
+                     <args>
+                        <param>run</param>
+                     </args>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>runClient</id>
+                  <goals>
+                     <goal>runClient</goal>
+                  </goals>
+                  <configuration>
+                     <clientClass>org.apache.activemq.artemis.jms.example.SecurityExample</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>security</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>


[16/18] activemq-artemis git commit: ARTEMIS-180 removing -Pexample and some other improvements around the examples

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 65d217d..b670d18 100644
--- a/examples/jms/application-layer-failover/pom.xml
+++ b/examples/jms/application-layer-failover/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-application-layer-failover-example</artifactId>
+   <artifactId>application-layer-failover</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS Application Layer Failover Example</name>
 
@@ -42,64 +43,60 @@ under the License.
          <version>${project.version}</version>
       </dependency>
       <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
       </dependency>
    </dependencies>
 
-   <profiles>
-      <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>create0</id>
-                        <goals>
-                           <goal>create</goal>
-                        </goals>
-                        <configuration>
-                           <instance>${basedir}/target/server0</instance>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>create1</id>
-                        <goals>
-                           <goal>create</goal>
-                        </goals>
-                        <configuration>
-                           <instance>${basedir}/target/server1</instance>
-                           <portOffset>1</portOffset>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>runClient</id>
-                        <goals>
-                           <goal>runClient</goal>
-                        </goals>
-                        <configuration>
-                           <clientClass>org.apache.activemq.artemis.jms.example.ApplicationLayerFailoverExample</clientClass>
-                           <args>
-                              <param>${basedir}/target/server0</param>
-                              <param>${basedir}/target/server1</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-application-layer-failover-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
-      </profile>
-   </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create0</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <instance>${basedir}/target/server0</instance>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create1</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <instance>${basedir}/target/server1</instance>
+                     <portOffset>1</portOffset>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>runClient</id>
+                  <goals>
+                     <goal>runClient</goal>
+                  </goals>
+                  <configuration>
+                     <clientClass>org.apache.activemq.artemis.jms.example.ApplicationLayerFailoverExample</clientClass>
+                     <args>
+                        <param>${basedir}/target/server0</param>
+                        <param>${basedir}/target/server1</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>application-layer-failover</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/application-layer-failover/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/application-layer-failover/readme.html b/examples/jms/application-layer-failover/readme.html
index b9699bc..3a23b62 100644
--- a/examples/jms/application-layer-failover/readme.html
+++ b/examples/jms/application-layer-failover/readme.html
@@ -27,6 +27,8 @@ under the License.
   <body onload="prettyPrint()">
      <h1>Application-Layer Failover Example</h1>
 
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory. This example will always spawn and stop multiple servers.</pre>
+
      <p>ActiveMQ Artemis implements fully transparent <b>automatic</b> failover of connections from a live node to a backup node which requires
      no special coding. This is described in a different example and requires server replication.</p>
      <p>However, ActiveMQ Artemis also supports <b>Application-Layer</b> failover which is useful in the case where replication is not enabled.</p>
@@ -37,12 +39,11 @@ under the License.
      <p>Application-Layer failover is an alternative approach to High Availabilty (HA).</p>
      <p>Application-Layer failover differs from automatic failover in that some client side coding is required in order
      to implement this. Also, with Application-Layer failover, since the old Session object dies and a new is created, any uncommitted
-     work in the old Session will be lost, and any unacknowledged messages might be redelivered.</p>    
+     work in the old Session will be lost, and any unacknowledged messages might be redelivered.</p>
      <p>For more information on ActiveMQ Artemis failover and HA, and clustering in general, please see the clustering
-     section of the user manual.</p>      
+     section of the user manual.</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>
      <p>In this example, the live server is server 1, which will failover onto server 0.</p>
      <p>The connection will initially be created to server1, server 1 will crash, and the client will carry on
      on server 0, the new  server. With Application-Layer failover the node that is failed over onto, does not need to
@@ -87,13 +88,13 @@ under the License.
          }
           </code>
         </pre>
-        
+
         <li>We now cause server 1, the live server to crash. After a little while the connection's
             ExceptionListener will register the failure and reconnection will occur.</li>
         <pre class="prettyprint">
            <code>killServer(1);</code>
         </pre>
-        
+
         <li>The connection's ExceptionListener gets called, and we lookup the JMS objects and
         recreate the connection, session, etc on the other node 0.</li>
         <pre class="prettyprint">
@@ -121,7 +122,7 @@ under the License.
             e.printStackTrace();
          }
       }
-   }   
+   }
            </code>
         </pre>
 
@@ -138,7 +139,7 @@ under the License.
          }
            </code>
         </pre>
-        
+
         <li>And consume them.</li>
         <pre class="prettyprint">
            <code>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 fcd3cca..86a2339 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,14 +16,6 @@
  */
 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;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-
 import javax.jms.Connection;
 import javax.jms.ConnectionFactory;
 import javax.jms.ExceptionListener;
@@ -35,6 +27,11 @@ import javax.jms.Session;
 import javax.jms.TextMessage;
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+
+import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
+import org.apache.activemq.artemis.util.ServerUtil;
 
 /**
  * A simple example that demonstrates application-layer failover of the JMS connection from one node to another
@@ -144,32 +141,25 @@ public class ApplicationLayerFailoverExample
 
    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>();
-      properties.put("java.naming.factory.initial", "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory");
-      properties.put("connectionFactory.ConnectionFactory", "tcp://127.0.0.1:" + (61616 + server));
-      properties.put("queue.queue/exampleQueue", "exampleQueue");
-      initialContext = new InitialContext(properties);
+      // Step 1. Instantiate a JMS Connection Factory object from JNDI on server 1
+      ConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp://127.0.0.1:" + (61616 + server));
 
-      // Step 2. Look-up the JMS Queue object from JNDI
-      Queue queue = (Queue)initialContext.lookup("queue/exampleQueue");
-
-      // Step 3. Look-up a JMS Connection Factory object from JNDI on server 1
-      ConnectionFactory connectionFactory = (ConnectionFactory)initialContext.lookup("ConnectionFactory");
-
-      // Step 4. We create a JMS Connection connection
+      // Step 2. We create a JMS Connection connection
       connection = connectionFactory.createConnection();
 
-      // Step 6. We start the connection to ensure delivery occurs
+      // Step 3. We start the connection to ensure delivery occurs
       connection.start();
 
-      // Step 5. We create a JMS Session
+      // Step 4. We create a JMS Session
       session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
 
-      // Step 7. We create a JMS MessageConsumer object
+      // Step 5. Look-up the JMS Queue object from JNDI
+      Queue queue = session.createQueue("exampleQueue");
+
+      // Step 6. We create a JMS MessageConsumer object
       consumer = session.createConsumer(queue);
 
-      // Step 8. We create a JMS MessageProducer object
+      // Step 7. We create a JMS MessageProducer object
       producer = session.createProducer(queue);
    }
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/bridge/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/bridge/pom.xml b/examples/jms/bridge/pom.xml
index 73cbdc5..8c835de 100644
--- a/examples/jms/bridge/pom.xml
+++ b/examples/jms/bridge/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-core-bridge-example</artifactId>
+   <artifactId>core-bridge</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis Core Bridge Example</name>
 
@@ -49,109 +50,127 @@ under the License.
 
    <profiles>
       <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <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>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>
-                        <id>runClient</id>
-                        <goals>
-                           <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>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-core-bridge-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
+         <!-- specify -PnoServer if you don't want to start the server -->
+         <id>noServer</id>
+         <properties>
+            <noServer>true</noServer>
+         </properties>
       </profile>
    </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create0</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <libList>
+                        <!-- For the transformer -->
+                        <arg>org.apache.activemq.examples.jms:core-bridge:${project.version}</arg>
+                     </libList>
+                     <ignore>${noServer}</ignore>
+                     <instance>${basedir}/target/server0</instance>
+                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create1</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <libList>
+                        <!-- For the transformer -->
+                        <arg>org.apache.activemq.examples.jms:core-bridge:${project.version}</arg>
+                     </libList>
+                     <ignore>${noServer}</ignore>
+                     <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>
+                     <ignore>${noServer}</ignore>
+                     <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>
+                     <ignore>${noServer}</ignore>
+                     <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.BridgeExample</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop0</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <location>${basedir}/target/server0</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop1</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <location>${basedir}/target/server1</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>core-bridge</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/bridge/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/bridge/readme.html b/examples/jms/bridge/readme.html
index 6b5bb01..a9440c7 100644
--- a/examples/jms/bridge/readme.html
+++ b/examples/jms/bridge/readme.html
@@ -26,6 +26,7 @@ under the License.
   </head>
   <body onload="prettyPrint()">
      <h1>Core Bridge Example</h1>
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
 
      <p>This example demonstrates a core bridge deployed on one server, which consumes messages from a
      local queue and forwards them to an address on a second server.</p>
@@ -69,166 +70,5 @@ under the License.
      &lt;/bridge&gt;
      </code>
      </pre>
-     <h2>Example step-by-step</h2>
-     <p><i>To run the example, simply type <code>mvn verify -Pexample</code> from this directory</i></p>
-
-     <ol>
-        <li>We create an initial context for looking up JNDI on node 0</li>
-        <pre class="prettyprint">
-           <code>
-   ic0 = getContext(0);
-   </code>
-        </pre>
-
-        <li>We look up the sausage-factory queue from node 0</li>
-        <pre class="prettyprint">
-           <code>Queue sausageFactory = (Queue)ic0.lookup("/queue/sausage-factory");</code>
-        </pre>
-
-        <li>We look up a JMS ConnectionFactory object from node 0</li>
-        <pre class="prettyprint">
-           <code>ConnectionFactory cf0 = (ConnectionFactory)ic0.lookup("/ConnectionFactory");</code>
-        </pre>
-
-        <li>We create an initial context for looking up JNDI on node 1</li>
-        <pre class="prettyprint">
-           <code>ic1 = getContext(1);</code>
-        </pre>
-
-        <li>We look up the mincing-machine queue on node 1</li>
-        <pre class="prettyprint">
-           <code>Queue mincingMachine = (Queue)ic1.lookup("/queue/mincing-machine");
-           </code>
-        </pre>
-
-        <li>We look up a JMS ConnectionFactory object from node 1</li>
-        <pre class="prettyprint">
-          <code>
-   ConnectionFactory cf1 = (ConnectionFactory)ic1.lookup("/ConnectionFactory");
-          </code>
-        </pre>
-
-        <li>We create a JMS Connection connection0 which is a connection to server 0</li>
-        <pre class="prettyprint">
-          <code>
-   connection0 = cf0.createConnection();
-          </code>
-        </pre>
-
-        <li>We create a JMS Connection connection1 which is a connection to server 1</li>
-        <pre class="prettyprint">
-          <code>
-   connection1 = cf1.createConnection();
-          </code>
-        </pre>
-
-        <li>We create a JMS Session on server 0</li>
-        <pre class="prettyprint">
-           <code>
-   Session session0 = connection0.createSession(false, Session.AUTO_ACKNOWLEDGE);
-           </code>
-        </pre>
-
-        <li>We create a JMS Session on server 1</li>
-        <pre class="prettyprint">
-           <code>
-   Session session1 = connection1.createSession(false, Session.AUTO_ACKNOWLEDGE);
-            </code>
-        </pre>
-
-        <li>We start the connection to ensure delivery occurs on them</li>
-        <pre class="prettyprint">
-           <code>
-   connection1.start();
-           </code>
-        </pre>
-
-        <li>We create a JMS MessageConsumer object on server 1</li>
-        <pre class="prettyprint">
-           <code>
-   MessageConsumer consumer = session1.createConsumer(mincingMachine);
-           </code>
-        </pre>
-
-        <li>We create a JMS MessageProducer object on server 0.</li>
-        <pre class="prettyprint">
-           <code>
-   MessageProducer producer = session0.createProducer(sausageFactory);</code>
-        </pre>
-
-        <li>We create and send a message representing an aardvark with a green hat to the sausage-factory
-         on node 0</li>
-        <pre class="prettyprint">
-           <code>
-         Message message = session0.createMessage();
-
-         message.setStringProperty("name", "aardvark");
-
-         message.setStringProperty("hat", "green");
-
-         producer.send(message);
-           </code>
-        </pre>
-
-        <li>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!</li>
-        <pre class="prettyprint">
-           <code>
-        Message receivedMessage = consumer.receive(5000);
-           </code>
-        </pre>
-
-        <li>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 sasquatches.</li>
-        <pre class="prettyprint">
-           <code>
-         message = session0.createMessage();
-
-         message.setStringProperty("name", "sasquatch");
-
-         message.setStringProperty("hat", "mauve");
-
-         producer.send(message);
-           </code>
-        </pre>
-
-        <li>We don't receive the sasquatch message since it's not an aardvark!</li>
-        <pre class="prettyprint">
-           <code>
-         receivedMessage = (TextMessage)consumer.receive(1000);
-           </code>
-        </pre>
-
-
-        <li>And finally (no pun intended), <b>always</b> remember to close your JMS resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
-
-        <pre class="prettyprint">
-           <code>
-	finally
-	{
-	      if (connection0 != null)
-         {
-            connection0.close();
-         }
-
-         if (connection1 != null)
-         {
-            connection1.close();
-         }
-
-         if (ic0 != null)
-         {
-            ic0.close();
-         }
-
-         if (ic1 != null)
-         {
-            ic1.close();
-         }
-	}
-           </code>
-        </pre>
-
-     </ol>
   </body>
 </html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/browser/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/browser/pom.xml b/examples/jms/browser/pom.xml
index adaf222..8cbd2d7 100644
--- a/examples/jms/browser/pom.xml
+++ b/examples/jms/browser/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-browser-example</artifactId>
+   <artifactId>browser</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS Browser Example</name>
 
@@ -37,72 +38,82 @@ under the License.
 
    <dependencies>
       <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
       </dependency>
    </dependencies>
 
    <profiles>
       <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>create</id>
-                        <phase>verify</phase>
-                        <goals>
-                           <goal>create</goal>
-                        </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>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-browser-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
+         <!-- specify -PnoServer if you don't want to start the server -->
+         <id>noServer</id>
+         <properties>
+            <noServer>true</noServer>
+         </properties>
       </profile>
    </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create</id>
+                  <phase>verify</phase>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                  </configuration>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+               </execution>
+               <execution>
+                  <id>start</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <spawn>true</spawn>
+                     <ignore>${noServer}</ignore>
+                     <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>
+                     <ignore>${noServer}</ignore>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>browser</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/browser/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/browser/readme.html b/examples/jms/browser/readme.html
index b960ff4..76f349f 100644
--- a/examples/jms/browser/readme.html
+++ b/examples/jms/browser/readme.html
@@ -26,122 +26,15 @@ under the License.
   </head>
   <body onload="prettyPrint()">
      <h1>JMS QueueBrowser Example</h1>
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
 
      <p>This example shows you how to use a JMS <a href="http://java.sun.com/javaee/5/docs/api/javax/jms/QueueBrowser.html">QueueBrowser</a> with ActiveMQ Artemis.<br />
      Queues are a standard part of JMS, please consult the JMS 1.1 specification for full details.<br />
-     A QueueBrowser is used to look at messages on the queue without removing them. 
+     A QueueBrowser is used to look at messages on the queue without removing them.
      It can scan the entire content of a queue or only messages matching a message selector.</p>
      <p>
-         The example will send 2 messages on a queue, use a QueueBrowser to browse 
+         The example will send 2 messages on a queue, use a QueueBrowser to browse
          the queue (looking at the message without removing them) and finally consume the 2 messages
      </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>
-
-     <ol>
-        <li>First we need to get an initial context so we can look-up the JMS connection factory and destination objects from JNDI. This initial context will get it's properties from the <code>client-jndi.properties</code> file in the directory <code>../common/config</code></li>
-        <pre class="prettyprint">
-           <code>InitialContext initialContext = getContext();</code>
-        </pre>
-
-        <li>We look up the JMS queue object from JNDI</li>
-        <pre class="prettyprint">
-           <code>Queue queue = (Queue) initialContext.lookup("/queue/exampleQueue");</code>
-        </pre>
-
-        <li>We look up the JMS connection factory object from JNDI</li>
-        <pre class="prettyprint">
-           <code>ConnectionFactory cf = (ConnectionFactory) initialContext.lookup("/ConnectionFactory");</code>
-        </pre>
-
-        <li>We create a JMS connection</li>
-        <pre class="prettyprint">
-           <code>connection = cf.createConnection();</code>
-        </pre>
-
-        <li>We create a JMS session. The session is created as non transacted and will auto acknowledge messages.</li>
-        <pre class="prettyprint">
-           <code>Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);</code>
-        </pre>
-
-        <li>We create a JMS message producer on the session. This will be used to send the messages.</li>
-        <pre class="prettyprint">
-          <code>MessageProducer messageProducer = session.createProducer(topic);</code>
-       </pre>
-
-        <li>We create 2 JMS text messages that we are going to send.</li>
-        <pre class="prettyprint">
-           <code> TextMessage message_1 = session.createTextMessage("this is the 1st message");
-            TextMessage message_2 = session.createTextMessage("this is the 2nd message");</code>
-        </pre>
-
-        <li>We send messages to the queue</li>
-        <pre class="prettyprint">
-           <code>messageProducer.send(message_1);
-           messageProducer.send(message_2);</code>
-        </pre>
-        
-        <li>We create a JMS QueueBrowser.<br />
-            We have not specified a message selector so the browser will enumerate the entire content of the queue.
-            </li>
-        <pre class="prettyprint">
-           <code>QueueBrowser browser = session.createBrowser(queue);</code>
-        </pre>
-            
-        <li>We browse the queue and display all the messages' text
-        </li>
-        <pre class="prettyprint">
-            <code>Enumeration messageEnum = browser.getEnumeration();
-            while (messageEnum.hasMoreElements())
-            {
-               TextMessage message = (TextMessage)messageEnum.nextElement();
-               System.out.println("Browsing: " + message.getText());
-            }</code>
-        </pre>
-        
-        <li>We close the browser once we have finished to use it</li>
-        <pre class="prettyprint">
-            <code>browser.close();</code>
-        </pre>
-
-        <p>The messages were browsed but they were not removed from the queue. We will now consume them.</p>
-        
-        <li>We create a JMS Message Consumer to receive the messages.</li>
-          <pre class="prettyprint">
-           <code>MessageConsumer messageConsumer = session.createConsumer(queue);</code>
-        </pre>
-
-        <li>We start the connection. In order for delivery to occur on any consumers or subscribers on a connection, the connection must be started</li>
-        <pre class="prettyprint">
-           <code>connection.start();</code>
-        </pre>
-
-        <li>The 2 messages arrive at the consumer</li>
-        <pre class="prettyprint">
-           <code>TextMessage messageReceived = (TextMessage)messageConsumer.receive(5000);
-           System.out.println("Received message: " + messageReceived.getText());
-           messageReceived = (TextMessage)messageConsumer.receive(5000);
-           System.out.println("Received message: " + messageReceived.getText());</code>
-        </pre>
-        
-        <li>And finally, <b>always</b> remember to close your JMS connections and resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
-
-        <pre class="prettyprint">
-           <code>finally
-           {
-              if (initialContext != null)
-              {
-                initialContext.close();
-              }
-              if (connection != null)
-              {
-                 connection.close();
-              }
-           }</code>
-        </pre>
-
-
-
-     </ol>
   </body>
 </html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 6c93cc6..d7f060c 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
@@ -45,8 +45,11 @@ public class QueueBrowserExample
          Queue queue = (Queue)initialContext.lookup("queue/exampleQueue");
 
          // Step 3. Perform a lookup on the Connection Factory
+         //          you could alternatively instantiate the connection directly
+         //          ConnectionFactory cf = new ActiveMQConnectionFactory(); // this would accept the broker URI as well
          ConnectionFactory cf = (ConnectionFactory)initialContext.lookup("ConnectionFactory");
 
+
          // Step 4. Create a JMS Connection
          connection = cf.createConnection();
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/client-kickoff/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/client-kickoff/pom.xml b/examples/jms/client-kickoff/pom.xml
index 1c86b5a..a07eb35 100644
--- a/examples/jms/client-kickoff/pom.xml
+++ b/examples/jms/client-kickoff/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-client-kickoff-example</artifactId>
+   <artifactId>client-kickoff</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS Kick Off Example</name>
 
@@ -38,79 +39,84 @@ under the License.
    <dependencies>
       <dependency>
          <groupId>org.apache.activemq</groupId>
-         <artifactId>artemis-core-client</artifactId>
+         <artifactId>artemis-jms-client</artifactId>
          <version>${project.version}</version>
       </dependency>
-      <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
-      </dependency>
    </dependencies>
 
    <profiles>
       <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>create</id>
-                        <goals>
-                           <goal>create</goal>
-                        </goals>
-                        <configuration>
-                           <!-- 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>
-                        <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>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-client-kickoff-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
+         <!-- specify -PnoServer if you don't want to start the server -->
+         <id>noServer</id>
+         <properties>
+            <noServer>true</noServer>
+         </properties>
       </profile>
    </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <!-- 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>
+                  <id>start</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <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>
+                     <ignore>${noServer}</ignore>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>client-kickoff</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/client-kickoff/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/client-kickoff/readme.html b/examples/jms/client-kickoff/readme.html
index f30598a..064f7fb 100644
--- a/examples/jms/client-kickoff/readme.html
+++ b/examples/jms/client-kickoff/readme.html
@@ -27,6 +27,8 @@ under the License.
   <body onload="prettyPrint()">
      <h1>Client Kickoff Example</h1>
 
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
+
      <p>This example shows how to kick off a client connected to ActiveMQ
          using <a href="http://java.sun.com/javase/technologies/core/mntr-mgmt/javamanagement/">JMX</a></p>
 
@@ -48,109 +50,5 @@ under the License.
             (please note that for this example, we will disable user authentication for simplicity).</p>
         <p>With these properties, ActiveMQ Artemis server will be manageable remotely using standard JMX URL on port <code>3000</code>.</p>
      </p>
-
-     <h2>Example step-by-step</h2>
-     <p><em>To run the example, simply type <code>mvn verify -Pexample</code> from this directory</em></p>
-     <ol>
-        <li>First we need to get an initial context so we can look-up the JMS connection factory and destination objects from JNDI. This initial context will get its properties from <a href="src/main/resources/activemq/server0/client-jndi.properties">client-jndi.properties</a></li>
-        <pre class="prettyprint">
-            <code>InitialContext initialContext = getContext(0);</code>
-        </pre>
-
-        <li>We look up the JMS connection factory object from JNDI</li>
-        <pre class="prettyprint">
-            <code>ConnectionFactory cf = (ConnectionFactory) initialContext.lookup("/ConnectionFactory");</code>
-        </pre>
-
-        <li>We create a JMS connection</li>
-        <pre class="prettyprint">
-            <code>connection = cf.createConnection();</code>
-        </pre>
-
-        <li>We set a <code>ExceptionListener</code> on the connection to be notified after a problem occurred</li>
-        <pre class="prettyprint">
-            <code>final AtomicReference&lt;JMSException&gt; exception = new AtomicReference&lt;JMSException&gt;();
-            connection.setExceptionListener(new ExceptionListener()
-            {
-               public void onException(JMSException e)
-               {
-                  exception.set(e);
-               }
-            });</code>
-        </pre>
-
-        <li>We start the connection</li>
-        <pre class="prettyprint">
-            <code>connection.start();</code>
-       </pre>
-
-        <li>We create a MBean proxy to the ActiveMQServerControlMBean used to manage ActiveMQ Artemis server
-            (see <a href="../jmx/readme.html">JMX example</a> for a complete explanation of the different steps)</li>
-        <pre class="prettyprint">
-            <code>ObjectName on = ObjectNameBuilder.DEFAULT.getActiveMQServerObjectName();
-            JMXConnector connector = JMXConnectorFactory.connect(new JMXServiceURL(JMX_URL), new HashMap<String, String>());
-            MBeanServerConnection mbsc = connector.getMBeanServerConnection();
-            ActiveMQServerControlMBean serverControl = (ActiveMQServerControlMBean)MBeanServerInvocationHandler.newProxyInstance(mbsc,
-                                                                                                on,
-                                                                                                ActiveMQServerControlMBean.class,
-                                                                                                false);
-            </code>
-        </pre>
-
-        <li>Using the server MBean, we list the remote address connected to the server</li>
-        <pre class="prettyprint">
-            <code>String[] remoteAddresses = serverControl.listRemoteAddresses();
-            for (String remoteAddress : remoteAddresses)
-            {
-               System.out.println(remoteAddress);
-            }
-            </code>
-        </pre>
-
-        <p>It will display a single address corresponding to the connection opened at step 3.</p>
-
-        <li>We close the connections corresponding to this remote address</li>
-        <pre class="prettyprint">
-              <code>serverControl.closeConnectionsForAddress(remoteAddresses[0]);</code>
-        </pre>
-
-        <p>Warnings be displayed on the server output:</p>
-        <pre class="prettyprint">
-            <code>org.apache.activemq.artemis.jms.example.SpawnedJMSServer out:11:22:33,034 WARN  @RMI TCP Connection(3)-192.168.0.10 [RemotingConnectionImpl] Connection failure has been detected connections for /192.168.0.10:52707 closed by management:0
-            org.apache.activemq.artemis.jms.example.SpawnedJMSServer out:11:22:33,035 WARN  @RMI TCP Connection(3)-192.168.0.10 [ServerSessionImpl] Client connection failed, clearing up resources for session 4646da35-2fe8-11de-9ce9-752ccc2b26e4
-            org.apache.activemq.artemis.jms.example.SpawnedJMSServer out:11:22:33,035 WARN  @RMI TCP Connection(3)-192.168.0.10 [ServerSessionImpl] Cleared up resources for session 4646da35-2fe8-11de-9ce9-752ccc2b26e4
-            </code>
-        </pre>
-
-        <li>We display the exception received by the connection's ExceptionListener</li>
-        <pre class="prettyprint">
-            <code>exception.get().printStackTrace();</code>
-        </pre>
-
-        <p>When the connection was closed on the server-side by the call to <code>serverControl.closeConnectionsForAddress()</code>,
-        the client's connection was disconnected and its exception listener was notified.</p>
-
-        <li>And finally, <b>always</b> remember to close your JMS connections and resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
-
-        <pre class="prettyprint">
-           <code>finally
-           {
-              if (initialContext != null)
-              {
-                initialContext.close();
-              }
-              if (connection != null)
-              {
-                 connection.close();
-              }
-           }</code>
-        </pre>
-     </ol>
-
-     <h2>More information</h2>
-
-     <ul>
-        <li><a href="http://java.sun.com/j2se/1.5.0/docs/guide/management/agent.html">Java 5 Management guide</a></li>
-     </ul>
   </body>
 </html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 cfdcdd6..4f5eaa5 100644
--- a/examples/jms/client-side-failoverlistener/pom.xml
+++ b/examples/jms/client-side-failoverlistener/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-client-side-fileoverlistener-example</artifactId>
+   <artifactId>client-side-fileoverlistener</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS Client Side Failover listener Example</name>
 
@@ -46,72 +47,63 @@ under the License.
          <artifactId>artemis-jms-client</artifactId>
          <version>${project.version}</version>
       </dependency>
-      <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
-      </dependency>
    </dependencies>
 
-   <profiles>
-      <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>create0</id>
-                        <goals>
-                           <goal>create</goal>
-                        </goals>
-                        <configuration>
-                           <instance>${basedir}/target/server0</instance>
-                           <dataFolder>../shared</dataFolder>
-                           <sharedStore>true</sharedStore>
-                           <slave>false</slave>
-                           <failoverOnShutdown>true</failoverOnShutdown>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>create1</id>
-                        <goals>
-                           <goal>create</goal>
-                        </goals>
-                        <configuration>
-                           <instance>${basedir}/target/server1</instance>
-                           <dataFolder>../shared</dataFolder>
-                           <sharedStore>true</sharedStore>
-                           <slave>true</slave>
-                           <portOffset>1</portOffset>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>runClient</id>
-                        <goals>
-                           <goal>runClient</goal>
-                        </goals>
-                        <configuration>
-                           <clientClass>org.apache.activemq.artemis.jms.example.ClientSideFailoverListerExample</clientClass>
-                           <args>
-                              <param>${basedir}/target/server0</param>
-                              <param>${basedir}/target/server1</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-client-side-fileoverlistener-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
-      </profile>
-   </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create0</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <instance>${basedir}/target/server0</instance>
+                     <dataFolder>../shared</dataFolder>
+                     <sharedStore>true</sharedStore>
+                     <slave>false</slave>
+                     <failoverOnShutdown>true</failoverOnShutdown>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create1</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <instance>${basedir}/target/server1</instance>
+                     <dataFolder>../shared</dataFolder>
+                     <sharedStore>true</sharedStore>
+                     <slave>true</slave>
+                     <portOffset>1</portOffset>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>runClient</id>
+                  <goals>
+                     <goal>runClient</goal>
+                  </goals>
+                  <configuration>
+                     <clientClass>org.apache.activemq.artemis.jms.example.ClientSideFailoverListerExample</clientClass>
+                     <args>
+                        <param>${basedir}/target/server0</param>
+                        <param>${basedir}/target/server1</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>client-side-fileoverlistener</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/client-side-failoverlistener/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/client-side-failoverlistener/readme.html b/examples/jms/client-side-failoverlistener/readme.html
index c58abc6..9f71893 100644
--- a/examples/jms/client-side-failoverlistener/readme.html
+++ b/examples/jms/client-side-failoverlistener/readme.html
@@ -26,88 +26,12 @@ under the License.
   </head>
   <body onload="prettyPrint()">
      <h1>Client Side Kickoff Example</h1>
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory. This example will always spawn and stop multiple servers.</pre>
 
      <p>This example demonstrates how you can listen on failover event on the client side.</p>
 
      <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.</p>
-         
-     <h2>Example step-by-step</h2>
-     <p><em>To run the example, simply type <code>mvn verify -Pexample</code> from this directory</em></p>
-     <ol>
-        <li>First we need to get an initial context so we can look-up the JMS connection factory and destination objects from JNDI. This initial context will get its properties from <a href="src/main/resources/activemq/server0/client-jndi.properties">client-jndi.properties</a></li>
-        <pre class="prettyprint">
-            <code>InitialContext initialContext = getContext(0);</code>
-        </pre>
 
-        <li>We look up the JMS Queue object from JNDI</li>
-        <pre class="prettyprint">
-            <code>Queue queue = (Queue)initialContext.lookup("/queue/exampleQueue");</code>
-        </pre>
-
-        <li>We look up a JMS Connection Factory object from JNDI on server 0</li>
-        <pre class="prettyprint">
-            <code>ConnectionFactory connectionFactory = (ConnectionFactory)initialContext.lookup("/ConnectionFactory");</code>
-        </pre>
-        
-        <li>We create a JMS connection from the same connection factory, wait a little while to make sure broadcasts from all nodes have reached the client</li>
-        <pre class="prettyprint">
-            <code>
-            Thread.sleep(5000);
-            connectionA = connectionFactory.createConnection();
-            ((ActiveMQConnection)connectionA).setFailoverListener(new FailoverListenerImpl());
-			</code>
-        </pre>
-
-        <li>We create JMS Sessions</li>
-        <pre class="prettyprint">
-            <code>Session sessionA = connectionA.createSession(false, Session.AUTO_ACKNOWLEDGE);</code>
-       </pre>
-
-        <li>We create JMS MessageProducer objects on the sessions</li>
-        <pre class="prettyprint">
-            <code>MessageProducer producerA = sessionA.createProducer(queue);</code>
-        </pre>
-
-        <li>We send some messages on each producer</li>
-        <pre class="prettyprint">
-            <code>
-            final int numMessages = 10;
-
-            for (int i = 0; i < numMessages; i++)
-            {
-               TextMessage messageA = sessionA.createTextMessage("A:This is text message " + i);
-               producerA.send(messageA);
-               System.out.println("Sent message: " + messageA.getText());
-            }
-		 </code>
-        </pre>
-            
-        <li>We start the connection to consume messages</li>
-        <pre class="prettyprint">
-              <code>connectionA.start();</code>
-        </pre>
-
-        <li>We consume messages from the session A, one at a time. We reached message no 5 the first server will crash</li>
-        <pre class="prettyprint">
-            <code>consume(sessionA, queue, numMessages, "A");</code>
-        </pre>
-        
-        <li>And finally, <b>always</b> remember to close your JMS connections and resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
-
-        <pre class="prettyprint">
-           <code>
-           if (connectionA != null)
-           {
-              connectionA.close();
-           }
-
-           if (initialContext != null)
-           {
-              initialContext.close();
-           }
-		 </code>
-        </pre>
-     </ol>
   </body>
 </html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 77c8186..40fed73 100644
--- a/examples/jms/client-side-load-balancing/pom.xml
+++ b/examples/jms/client-side-load-balancing/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-client-side-load-balancing-example</artifactId>
+   <artifactId>client-side-load-balancing</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS Client Side Load Balancing Example</name>
 
@@ -41,155 +42,164 @@ under the License.
          <artifactId>artemis-jms-client</artifactId>
          <version>${project.version}</version>
       </dependency>
-      <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
-      </dependency>
    </dependencies>
 
    <profiles>
       <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>create0</id>
-                        <goals>
-                           <goal>create</goal>
-                        </goals>
-                        <configuration>
-                           <instance>${basedir}/target/server0</instance>
-                           <clustered>true</clustered>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>create1</id>
-                        <goals>
-                           <goal>create</goal>
-                        </goals>
-                        <configuration>
-                           <instance>${basedir}/target/server1</instance>
-                           <clustered>true</clustered>
-                           <portOffset>1</portOffset>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>create2</id>
-                        <goals>
-                           <goal>create</goal>
-                        </goals>
-                        <configuration>
-                           <instance>${basedir}/target/server2</instance>
-                           <clustered>true</clustered>
-                           <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>
-                           <goal>runClient</goal>
-                        </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>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-client-side-load-balancing-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
+         <!-- specify -PnoServer if you don't want to start the server -->
+         <id>noServer</id>
+         <properties>
+            <noServer>true</noServer>
+         </properties>
       </profile>
    </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create0</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <instance>${basedir}/target/server0</instance>
+                     <clustered>true</clustered>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create1</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <instance>${basedir}/target/server1</instance>
+                     <clustered>true</clustered>
+                     <portOffset>1</portOffset>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create2</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <instance>${basedir}/target/server2</instance>
+                     <clustered>true</clustered>
+                     <portOffset>2</portOffset>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start0</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <spawn>true</spawn>
+                     <ignore>${noServer}</ignore>
+                     <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>
+                     <ignore>${noServer}</ignore>
+                     <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>
+                     <ignore>${noServer}</ignore>
+                     <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.ClientSideLoadBalancingExample</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop0</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <location>${basedir}/target/server0</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop1</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <location>${basedir}/target/server1</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop2</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <location>${basedir}/target/server2</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>client-side-load-balancing</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/client-side-load-balancing/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/client-side-load-balancing/readme.html b/examples/jms/client-side-load-balancing/readme.html
index 7cfc684..dc06623 100644
--- a/examples/jms/client-side-load-balancing/readme.html
+++ b/examples/jms/client-side-load-balancing/readme.html
@@ -26,6 +26,7 @@ under the License.
   </head>
   <body onload="prettyPrint()">
      <h1>JMS Client-Side Load-Balancing Example</h1>
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
 
      <p>This example demonstrates how connnections created from a single JMS Connection factory can be created
      to different nodes of the cluster. In other words it demonstrates how ActiveMQ Artemis does <b>client side load balancing</b> of
@@ -40,129 +41,9 @@ under the License.
      <p>This example starts three servers which all broadcast their location using UDP discovery. The UDP broadcast configuration
      can be seen in the <code>broker.xml</code> file.</p>
      <p>A JMS ConnectionFactory is deployed on each server specifying the discovery group that will be used by that
-     connection factory.</p>      
+     connection factory.</p>
      <p>For more information on ActiveMQ Artemis load balancing, and clustering in general, please see the clustering
-     section of the user manual.</p>      
+     section of the user manual.</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>
-
-     <ol>
-        <li> Get an initial context for looking up JNDI from server 0.</li>
-        <pre class="prettyprint">
-           <code>initialContext = getContext(0);</code>
-        </pre>
-
-        <li>Look-up the JMS Queue object from JNDI</li>
-        <pre class="prettyprint">
-           <code>Queue queue = (Queue)initialContext.lookup("/queue/exampleQueue");</code>
-        </pre>
-
-        <li>Look-up a JMS Connection Factory object from JNDI on server 0</li>
-        <pre class="prettyprint">
-           <code>ConnectionFactory connectionFactory = (ConnectionFactory)initialContext.lookup("/ConnectionFactory");</code>
-        </pre>
-
-        <li> We create 3 JMS connections from the same connection factory. Since we are using round-robin
-         load-balancing this should result in each sessions being connected to a different node of the cluster</li>
-        <pre class="prettyprint">
-           <code>
-        Connection conn = connectionFactory.createConnection();
-        connectionA = connectionFactory.createConnection();
-        connectionB = connectionFactory.createConnection();
-        connectionC = connectionFactory.createConnection();
-        conn.close();
-           </code>
-        </pre>
-
-        <li>We create JMS Sessions</li>
-        <pre class="prettyprint">
-           <code>
-         Session sessionA = connectionA.createSession(false, Session.AUTO_ACKNOWLEDGE);
-         Session sessionB = connectionB.createSession(false, Session.AUTO_ACKNOWLEDGE);
-         Session sessionC = connectionC.createSession(false, Session.AUTO_ACKNOWLEDGE);
-           </code>
-        </pre>
-
-        <li>We create JMS MessageProducer objects on the sessions</li>
-        <pre class="prettyprint">
-           <code>
-        MessageProducer producerA = sessionA.createProducer(queue);
-        MessageProducer producerB = sessionB.createProducer(queue);
-        MessageProducer producerC = sessionC.createProducer(queue);
-           </code>
-        </pre>
-        
-        <li>We send some messages on each producer</li>
-        <pre class="prettyprint">
-           <code>
-         final int numMessages = 10;
-
-         for (int i = 0; i < numMessages; i++)
-         {
-            TextMessage messageA = sessionA.createTextMessage("A:This is text message " + i);
-            producerA.send(messageA);
-            System.out.println("Sent message: " + messageA.getText());
-            
-            TextMessage messageB = sessionB.createTextMessage("B:This is text message " + i);
-            producerB.send(messageB);
-            System.out.println("Sent message: " + messageB.getText());
-            
-            TextMessage messageC = sessionC.createTextMessage("C:This is text message " + i);
-            producerC.send(messageC);
-            System.out.println("Sent message: " + messageC.getText());            
-         }
-            </code>
-        </pre>
-        
-        <li>We start the connection to consume messages</li>
-        <pre class="prettyprint">
-           <code>
-       connectionA.start();
-       connectionB.start();
-       connectionC.start();
-           </code>
-        </pre>
-
-         <li>We consume messages from the 3 session, one at a time.<br>
-            We try to consume one more message than expected from each session. If
-            the session were not properly load-balanced, we would be missing a 
-            message from one of the sessions at the end.</li>
-         <pre class="prettyprint">
-            <code>
-         consume(sessionA, queue, numMessages, "A");
-         consume(sessionB, queue, numMessages, "B");
-         consume(sessionC, queue, numMessages, "C");
-            </code>
-         </pre>
-
-        <li>And finally (no pun intended), <b>always</b> remember to close your JMS resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
-
-        <pre class="prettyprint">
-           <code>
-	finally
-	{
-	     if (connectionA != null)
-         {
-            connectionA.close();
-         }
-         if (connectionB != null)
-         {
-            connectionB.close();
-         }
-         if (connectionC != null)
-         {
-            connectionC.close();
-         }
-
-         if (initialContext != null)
-         {
-            initialContext.close();
-         }
-	}
-           </code>
-        </pre>
-
-     </ol>
-  </body>
+   </body>
 </html>


[09/18] activemq-artemis git commit: ARTEMIS-180 removing -Pexample and some other improvements around the examples

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/message-counters/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/message-counters/pom.xml b/examples/jms/message-counters/pom.xml
index 7cd17e3..a046a37 100644
--- a/examples/jms/message-counters/pom.xml
+++ b/examples/jms/message-counters/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-message-counters-example</artifactId>
+   <artifactId>message-counters</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS Message Counter Example</name>
 
@@ -38,83 +39,88 @@ under the License.
    <dependencies>
       <dependency>
          <groupId>org.apache.activemq</groupId>
-         <artifactId>artemis-jms-client</artifactId>
+         <artifactId>artemis-server</artifactId>
          <version>${project.version}</version>
       </dependency>
       <dependency>
          <groupId>org.apache.activemq</groupId>
-         <artifactId>artemis-server</artifactId>
+         <artifactId>artemis-jms-client</artifactId>
          <version>${project.version}</version>
       </dependency>
-      <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
-      </dependency>
    </dependencies>
 
    <profiles>
       <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>create</id>
-                        <goals>
-                           <goal>create</goal>
-                        </goals>
-                        <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.MessageCounterExample</clientClass>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>cli</goal>
-                        </goals>
-                        <configuration>
-                           <args>
-                              <param>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-message-counters-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                   </dependencies>
-               </plugin>
-            </plugins>
-         </build>
+         <!-- specify -PnoServer if you don't want to start the server -->
+         <id>noServer</id>
+         <properties>
+            <noServer>true</noServer>
+         </properties>
       </profile>
    </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <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>
+                     <ignore>${noServer}</ignore>
+                     <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>
+                     <ignore>${noServer}</ignore>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>message-counters</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/message-counters/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/message-counters/readme.html b/examples/jms/message-counters/readme.html
index 63b5d97..69cbef3 100644
--- a/examples/jms/message-counters/readme.html
+++ b/examples/jms/message-counters/readme.html
@@ -27,6 +27,8 @@ under the License.
   <body onload="prettyPrint()">
      <h1>JMS Message Counter Example</h1>
 
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
+
      <p>This example shows you how to use message counters to obtain message information for a JMS queue.</p>
      <p>The example will show how to configure sampling of message counters.<br />
          We will produce and consume 1 message from a queue. Interleaved with the JMS operation, we will retrieve the queue's message counters
@@ -45,9 +47,8 @@ under the License.
          the <code>message-counter-max-day-history</code> parameter.</p>
      <p>The sample period and the max day history parameters have a small impact on the performance of ActiveMQ Artemis (the resources taken to sample a queue are not available to the system's
          normal use). You should set these parameters accordingly to the use and throughput of your messages.</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>
      <ol>
         <li>First we need to get an initial context so we can look-up the JMS connection factory and destination objects from JNDI. This initial context will get it's properties from the <code>client-jndi.properties</code> file in the directory <code>../common/config</code></li>
         <pre class="prettyprint">
@@ -70,7 +71,7 @@ under the License.
             QueueSession session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
             MessageProducer producer = session.createProducer(queue);</code>
        </pre>
-       
+
         <li>We create and send a JMS text message</li>
         <pre class="prettyprint">
             <code>TextMessage message = session.createTextMessage("This is a text message");
@@ -84,7 +85,7 @@ under the License.
             <code>System.out.println("Sleep a little bit to have the queue sampled...");
             Thread.sleep(3000);</code>
         </pre>
-        
+
         <p>We now need to retrieve the message counters. They're available from the JMS Queue management resource. In this example, we
             will retrieve them using JMX (see the <a href="../jmx/readme.html">JMX example</a> for a more complete description). You can also use JMS message to retrieve them (see the <a href="../management/readme.html">Management example</a> to
             learn about managing ActiveMQ Artemis using JMS messages).</p>
@@ -106,12 +107,12 @@ under the License.
             <code>String counters = queueControl.listMessageCounter();
             MessageCounterInfo messageCounter = MessageCounterInfo.fromJSON(counters);</code>>
         </pre>
-        
+
         <li>We display the message counters</li>
         <pre class="prettyprint">
             <code>displayMessageCounter(messageCounter);</code>
         </pre>
-        
+
         <p>The message counter contains a variety of metrics on the queue which is sampled (total messages added to the queue, current depth of the queue, deltas since the last sample, timestamp
             of the last message added, timestamp of the last sample, etc.)</p>
         <pre class="prettyprint">
@@ -119,34 +120,34 @@ under the License.
             private void displayMessageCounter(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", counter.getCount(), 
+               System.out.format("   %s message(s) added to the queue (since last sample: %s)\n", counter.getCount(),
                                                                                                   counter.getCountDelta());
                System.out.format("   %s message(s) in the queue (since last sample: %s)\n", counter.getDepth(),
                                                                                             counter.getDepthDelta());
                System.out.format("   last message added at %s\n\n", counter.getLastAddTimestamp());
             }</code>
         </pre>
-                
+
         <li>We sleep again to have the queue sampled</li>
         <pre class="prettyprint">
             <code>System.out.println("Sleep a little bit again...");
             Thread.sleep(3000);</code>
         </pre>
-        
+
         <li>We list the message counters again</li>
         <pre class="prettyprint">
             <code>counters = queueControl.listMessageCounter();
             messageCounter = MessageCounterInfo.fromJSON(counters);
             displayMessageCounter(messageCounter);</code>
         </pre>
-        
+
         <p>We will now consume a message from the queue before listing a last time the message counters</p>
-        
+
         <li>We create a consumer for the queue</li>
         <pre class="prettyprint">
             <code>MessageConsumer consumer = session.createConsumer(queue);</code>
         </pre>
-        
+
         <li>We start the connection to receive messages on the consumer</li>
         <pre class="prettyprint">
            <code>connection.start();</code>
@@ -157,13 +158,13 @@ under the License.
            <code>TextMessage messageReceived = (TextMessage)consumer.receive(5000);
            System.out.format("Received message: %s\n\n", messageReceived.getText());</code>
         </pre>
-        
+
         <li>We sleep one last time to have the queue sampled</li>
         <pre class="prettyprint">
             <code>System.out.println("Sleep a little bit one last time...");
             Thread.sleep(3000);</code>
         </pre>
-        
+
         <li>We list the message counters a final time (this time with no message in the queue)</li>
         <pre class="prettyprint">
             <code>counters = queueControl.listMessageCounter();
@@ -171,7 +172,7 @@ under the License.
             displayMessageCounter(messageCounter);</code>
         </pre>
 
-        </p>    
+        </p>
         <li>And finally, <b>always</b> remember to close your JMS connections and resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
 
         <pre class="prettyprint">
@@ -188,9 +189,9 @@ under the License.
            }</code>
         </pre>
      </ol>
-     
+
      <li>User Manual's <a href="../../../docs/user-manual/en/html_single/index.html#management.message-counters">Message Counters chapter</a></li>
-     <li><a href="../../../docs/api/org/jboss/messaging/core/management/MessageCounterInfo.html">MessageCounterInfo</a> is a helper class used 
+     <li><a href="../../../docs/api/org/jboss/messaging/core/management/MessageCounterInfo.html">MessageCounterInfo</a> is a helper class used
         to create a MessageCounterInfo object from the JSON String which represents message counters</li>
   </body>
 </html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/message-group/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/message-group/pom.xml b/examples/jms/message-group/pom.xml
index cfd67fb..cfd354c 100644
--- a/examples/jms/message-group/pom.xml
+++ b/examples/jms/message-group/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-message-group-example</artifactId>
+   <artifactId>message-group</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS Message Group Example</name>
 
@@ -37,71 +38,81 @@ under the License.
 
    <dependencies>
       <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
       </dependency>
    </dependencies>
 
    <profiles>
       <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>create</id>
-                        <goals>
-                           <goal>create</goal>
-                        </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.MessageGroupExample</clientClass>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>cli</goal>
-                        </goals>
-                        <configuration>
-                           <args>
-                              <param>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-message-group-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-                </plugin>
-            </plugins>
-         </build>
+         <!-- specify -PnoServer if you don't want to start the server -->
+         <id>noServer</id>
+         <properties>
+            <noServer>true</noServer>
+         </properties>
       </profile>
    </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <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.MessageGroupExample</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>message-group</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/message-group/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/message-group/readme.html b/examples/jms/message-group/readme.html
index e44aa51..3513e8e 100644
--- a/examples/jms/message-group/readme.html
+++ b/examples/jms/message-group/readme.html
@@ -27,13 +27,15 @@ under the License.
   <body onload="prettyPrint()">
      <h1>Message Group Example</h1>
 
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
+
      <p>This example shows you how to configure and use message groups with ActiveMQ Artemis.</p>
-     
+
      <p>Message groups are sets of messages that has the following characteristics: </p>
      <li>Messages in a message group share the same group id, i.e. they have same JMSXGroupID string property values.</li>
      <li>Messages in a message group will be all delivered to no more than one of the queue's consumers. The consumer that receives the
      first message of a group will receive all the messages that belong to the group.</li>
-     
+
      <p>You can make any message belong to a message group by setting its 'JMXGroupID' string property to the group id.
      In this example we create a message group 'Group-0'. And make such a message group of 10 messages. It also create two consumers on the queue
      where the 10 'Group-0' group messages are to be sent. You can see that with message grouping enabled, all the 10 messages will be received by
@@ -45,7 +47,6 @@ under the License.
         be part of this message group.</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>
 
      <ol>
         <li>First we need to get an initial context so we can look-up the JMS connection factory and destination objects from JNDI. This initial context will get it's properties from the <code>client-jndi.properties</code> file in the directory <code>../common/config</code></li>
@@ -140,12 +141,12 @@ under the License.
            }</code>
         </pre>
      </ol>
-     
+
      <h2>More information</h2>
-     
+
      <ul>
          <li>User Manual's <a href="../../../docs/user-manual/en/html_single/index.html#message-grouping">Message Grouping chapter</a></li>
      </ul>
-     
+
   </body>
 </html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 ea7e447..7acf3c4 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
@@ -16,11 +16,7 @@
  */
 package org.apache.activemq.artemis.jms.example;
 
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
 import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
 import javax.jms.JMSException;
 import javax.jms.Message;
 import javax.jms.MessageConsumer;
@@ -29,7 +25,11 @@ import javax.jms.MessageProducer;
 import javax.jms.Queue;
 import javax.jms.Session;
 import javax.jms.TextMessage;
-import javax.naming.InitialContext;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
+import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
 
 /**
  * A simple JMS Queue example that sends and receives message groups.
@@ -40,17 +40,14 @@ public class MessageGroupExample
    {
       final Map<String, String> messageReceiverMap = new ConcurrentHashMap<String, String>();
       Connection connection = null;
-      InitialContext initialContext = null;
       try
       {
-         // Step 1. Create an initial context to perform the JNDI lookup.
-         initialContext = new InitialContext();
 
          // Step 2. Perform a lookup on the queue
-         Queue queue = (Queue)initialContext.lookup("queue/exampleQueue");
+         Queue queue = ActiveMQJMSClient.createQueue("queue/exampleQueue");
 
          // Step 3. Perform a lookup on the Connection Factory
-         ConnectionFactory cf = (ConnectionFactory)initialContext.lookup("ConnectionFactory");
+         ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory();
 
          // Step 4. Create a JMS Connection
          connection = cf.createConnection();
@@ -95,14 +92,12 @@ public class MessageGroupExample
                throw new IllegalStateException("Group message [" + grpMsg.getText() + "[ went to wrong receiver: " + receiver);
             }
          }
+
+         cf.close();
       }
       finally
       {
          // Step 11. Be sure to close our JMS resources!
-         if (initialContext != null)
-         {
-            initialContext.close();
-         }
          if (connection != null)
          {
             connection.close();

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/message-group2/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/message-group2/pom.xml b/examples/jms/message-group2/pom.xml
index 6f23575..46eed3a 100644
--- a/examples/jms/message-group2/pom.xml
+++ b/examples/jms/message-group2/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-message-group2-example</artifactId>
+   <artifactId>message-group2</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS Message Group Example 2</name>
 
@@ -37,71 +38,81 @@ under the License.
 
    <dependencies>
       <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
       </dependency>
    </dependencies>
 
    <profiles>
       <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>create</id>
-                        <goals>
-                           <goal>create</goal>
-                        </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.MessageGroup2Example</clientClass>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>cli</goal>
-                        </goals>
-                        <configuration>
-                           <args>
-                              <param>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-message-group2-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
+         <!-- specify -PnoServer if you don't want to start the server -->
+         <id>noServer</id>
+         <properties>
+            <noServer>true</noServer>
+         </properties>
       </profile>
    </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <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.MessageGroup2Example</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>message-group2</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/message-group2/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/message-group2/readme.html b/examples/jms/message-group2/readme.html
index a5d85ac..911852c 100644
--- a/examples/jms/message-group2/readme.html
+++ b/examples/jms/message-group2/readme.html
@@ -27,13 +27,16 @@ under the License.
   <body onload="prettyPrint()">
      <h1>Message Group Example</h1>
 
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
+
+
      <p>This example shows you how to configure and use message groups via a connection factory with ActiveMQ Artemis.</p>
-     
+
      <p>Message groups are sets of messages that has the following characteristics: </p>
      <li>Messages in a message group share the same group id, i.e. they have same JMSXGroupID string property values.</li>
      <li>Messages in a message group will be all delivered to no more than one of the queue's consumers. The consumer that receives the
      first message of a group will receive all the messages that belongs to the group.</li>
-     
+
      <p>You can make any message belong to a message group by setting a 'group-id' on the connection factory. All producers created via this connection factory will set that group id on its messages.
      In this example we set the group id 'Group-0'on a connection factory and send messages via 2 different producers and check that only 1 consumer receives them. </p>
 
@@ -43,7 +46,6 @@ under the License.
         be part of this message group.</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>
      <ol>
         <li>First we need to get an initial context so we can look-up the JMS connection factory and destination objects from JNDI. This initial context will get it's properties from the <code>client-jndi.properties</code> file in the directory <code>../common/config</code></li>
         <pre class="prettyprint">
@@ -148,12 +150,12 @@ under the License.
            }</code>
         </pre>
      </ol>
-     
+
      <h2>More information</h2>
-     
+
      <ul>
          <li>User Manual's <a href="../../../docs/user-manual/en/html_single/index.html#message-grouping2">Message Grouping chapter</a></li>
      </ul>
-     
+
   </body>
 </html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 d53a125..c70c932 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
@@ -16,11 +16,7 @@
  */
 package org.apache.activemq.artemis.jms.example;
 
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
 import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
 import javax.jms.JMSException;
 import javax.jms.Message;
 import javax.jms.MessageConsumer;
@@ -29,7 +25,11 @@ import javax.jms.MessageProducer;
 import javax.jms.Queue;
 import javax.jms.Session;
 import javax.jms.TextMessage;
-import javax.naming.InitialContext;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
+import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
 
 /**
  * A simple JMS Queue example that sends and receives message groups.
@@ -42,17 +42,13 @@ public class MessageGroup2Example
    {
       final Map<String, String> messageReceiverMap = new ConcurrentHashMap<String, String>();
       Connection connection = null;
-      InitialContext initialContext = null;
       try
       {
-         //Step 1. Create an initial context to perform the JNDI lookup.
-         initialContext = new InitialContext();
-
          //Step 2. Perform a lookup on the queue
-         Queue queue = (Queue) initialContext.lookup("queue/exampleQueue");
+         Queue queue = ActiveMQJMSClient.createQueue("exampleQueue");
 
          //Step 3. Perform a lookup on the Connection Factory
-         ConnectionFactory cf = (ConnectionFactory) initialContext.lookup("ConnectionFactory");
+         ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory("tcp://localhost:61616?groupID=Group-0");
 
          //Step 4. Create a JMS Connection
          connection = cf.createConnection();
@@ -110,10 +106,6 @@ public class MessageGroup2Example
       finally
       {
          //Step 11. Be sure to close our JMS resources!
-         if (initialContext != null)
-         {
-            initialContext.close();
-         }
          if(connection != null)
          {
             connection.close();

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/message-group2/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/jms/message-group2/src/main/resources/jndi.properties b/examples/jms/message-group2/src/main/resources/jndi.properties
deleted file mode 100644
index 5adc898..0000000
--- a/examples/jms/message-group2/src/main/resources/jndi.properties
+++ /dev/null
@@ -1,20 +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.
-
-java.naming.factory.initial=org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory
-connectionFactory.ConnectionFactory=tcp://localhost:61616?groupID=Group-0
-queue.queue/exampleQueue=exampleQueue

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/message-priority/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/message-priority/pom.xml b/examples/jms/message-priority/pom.xml
index 6956310..b7a4d05 100644
--- a/examples/jms/message-priority/pom.xml
+++ b/examples/jms/message-priority/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-message-priority-example</artifactId>
+   <artifactId>message-priority</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS MessagePriorityExample Example</name>
 
@@ -37,71 +38,81 @@ under the License.
 
    <dependencies>
       <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
       </dependency>
    </dependencies>
 
    <profiles>
       <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>create</id>
-                        <goals>
-                           <goal>create</goal>
-                        </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.MessagePriorityExample</clientClass>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>cli</goal>
-                        </goals>
-                        <configuration>
-                           <args>
-                              <param>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-message-priority-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                   </dependencies>
-               </plugin>
-            </plugins>
-         </build>
+         <!-- specify -PnoServer if you don't want to start the server -->
+         <id>noServer</id>
+         <properties>
+            <noServer>true</noServer>
+         </properties>
       </profile>
    </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <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.MessagePriorityExample</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>message-priority</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/message-priority/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/message-priority/readme.html b/examples/jms/message-priority/readme.html
index 96af7e2..9dd995c 100644
--- a/examples/jms/message-priority/readme.html
+++ b/examples/jms/message-priority/readme.html
@@ -27,22 +27,25 @@ under the License.
   <body onload="prettyPrint()">
      <h1>JMS Message Priority Example</h1>
 
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
+
+
      <p>This example shows how messages with different priorities are delivered in different orders.</p>
-     
+
      <p>The Message Priority property carries the delivery preference of sent messages. It can be set by the message's
      standard header field 'JMSPriority' as defined in JMS specification version 1.1. The value is of type
      integer, ranging from 0 (the lowest) to 9 (the highest). When messages are being delivered, their priorities
-     will effect their order of delivery. Messages of higher priorities will likely be delivered before those 
-     of lower priorities. Messages of equal priorities are delivered in the natural order of their arrival at 
+     will effect their order of delivery. Messages of higher priorities will likely be delivered before those
+     of lower priorities. Messages of equal priorities are delivered in the natural order of their arrival at
      their destinations. Please consult the JMS 1.1 specification for full details.</p>
-     
+
      <p>In this example, three messages are sent to a queue with different priorities. The first message is sent
      with default priority (4), the second is sent with a higher priority (5), and the third has the highest
-     priority (9). At the receiving end, we will show the order of receiving of the three messages. You will 
-     see that the third message, though last sent, will 'jump' forward to be the first one received. The second 
+     priority (9). At the receiving end, we will show the order of receiving of the three messages. You will
+     see that the third message, though last sent, will 'jump' forward to be the first one received. The second
      is also received ahead of the message first sent, but behind the third message. The first message, regardless
      of its being sent first, arrives last.</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>
 
@@ -135,7 +138,7 @@ under the License.
            }
            </code>
         </pre>
-        
+
         <li>And finally, <b>always</b> remember to close your JMS connections and resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
 
         <pre class="prettyprint">

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 6435efe..5f137fe 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
@@ -32,6 +32,9 @@ 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.jms.client.ActiveMQConnectionFactory;
+
 /**
  * A simple JMS example that shows the delivery order of messages with priorities.
  */
@@ -42,17 +45,14 @@ public class MessagePriorityExample
       AtomicBoolean result = new AtomicBoolean(true);
       final ArrayList<TextMessage> msgReceived = new ArrayList<TextMessage>();
       Connection connection = null;
-      InitialContext initialContext = null;
       try
       {
-         // Step 1. Create an initial context to perform the JNDI lookup.
-         initialContext = new InitialContext();
 
          // Step 2. look-up the JMS queue object from JNDI
-         Queue queue = (Queue)initialContext.lookup("queue/exampleQueue");
+         Queue queue = ActiveMQJMSClient.createQueue("exampleQueue");
 
          // Step 3. look-up the JMS connection factory object from JNDI
-         ConnectionFactory cf = (ConnectionFactory)initialContext.lookup("ConnectionFactory");
+         ConnectionFactory cf = new ActiveMQConnectionFactory();
 
          // Step 4. Create a JMS Connection
          connection = cf.createConnection();
@@ -109,10 +109,6 @@ public class MessagePriorityExample
       finally
       {
          // Step 13. Be sure to close our JMS resources!
-         if (initialContext != null)
-         {
-            initialContext.close();
-         }
          if (connection != null)
          {
             connection.close();

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

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 4ae6e9e..c44a63f 100644
--- a/examples/jms/multiple-failover-failback/pom.xml
+++ b/examples/jms/multiple-failover-failback/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-multiple-failover-failback-example</artifactId>
+   <artifactId>multiple-failover-failback</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS Multiple Failover Failback Example</name>
 
@@ -47,79 +48,74 @@ under the License.
       </dependency>
    </dependencies>
 
-   <profiles>
-      <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>create0</id>
-                        <goals>
-                           <goal>create</goal>
-                        </goals>
-                        <configuration>
-                           <instance>${basedir}/target/server0</instance>
-                           <sharedStore>true</sharedStore>
-                           <slave>false</slave>
-                           <dataFolder>../data</dataFolder>
-                           <failoverOnShutdown>true</failoverOnShutdown>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>create1</id>
-                        <goals>
-                           <goal>create</goal>
-                        </goals>
-                        <configuration>
-                           <instance>${basedir}/target/server1</instance>
-                           <sharedStore>true</sharedStore>
-                           <slave>true</slave>
-                           <dataFolder>../data</dataFolder>
-                           <failoverOnShutdown>true</failoverOnShutdown>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>create2</id>
-                        <goals>
-                           <goal>create</goal>
-                        </goals>
-                        <configuration>
-                           <instance>${basedir}/target/server2</instance>
-                           <sharedStore>true</sharedStore>
-                           <slave>true</slave>
-                           <dataFolder>../data</dataFolder>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>runClient</id>
-                        <goals>
-                           <goal>runClient</goal>
-                        </goals>
-                        <configuration>
-                           <clientClass>org.apache.activemq.artemis.jms.example.MultipleFailoverFailbackExample</clientClass>
-                           <args>
-                              <param>${basedir}/target/server0</param>
-                              <param>${basedir}/target/server1</param>
-                              <param>${basedir}/target/server2</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-multiple-failover-failback-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-                </plugin>
-            </plugins>
-         </build>
-      </profile>
-   </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create0</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <instance>${basedir}/target/server0</instance>
+                     <sharedStore>true</sharedStore>
+                     <slave>false</slave>
+                     <dataFolder>../data</dataFolder>
+                     <failoverOnShutdown>true</failoverOnShutdown>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create1</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <instance>${basedir}/target/server1</instance>
+                     <sharedStore>true</sharedStore>
+                     <slave>true</slave>
+                     <dataFolder>../data</dataFolder>
+                     <failoverOnShutdown>true</failoverOnShutdown>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create2</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <instance>${basedir}/target/server2</instance>
+                     <sharedStore>true</sharedStore>
+                     <slave>true</slave>
+                     <dataFolder>../data</dataFolder>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>runClient</id>
+                  <goals>
+                     <goal>runClient</goal>
+                  </goals>
+                  <configuration>
+                     <clientClass>org.apache.activemq.artemis.jms.example.MultipleFailoverFailbackExample</clientClass>
+                     <args>
+                        <param>${basedir}/target/server0</param>
+                        <param>${basedir}/target/server1</param>
+                        <param>${basedir}/target/server2</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>multiple-failover-failback</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/multiple-failover/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/multiple-failover/pom.xml b/examples/jms/multiple-failover/pom.xml
index cb00084..3323ad5 100644
--- a/examples/jms/multiple-failover/pom.xml
+++ b/examples/jms/multiple-failover/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-multiple-failover-example</artifactId>
+   <artifactId>multiple-failover</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS Multiple Failover Example</name>
 
@@ -47,79 +48,74 @@ under the License.
       </dependency>
    </dependencies>
 
-   <profiles>
-      <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>create0</id>
-                        <goals>
-                           <goal>create</goal>
-                        </goals>
-                        <configuration>
-                           <instance>${basedir}/target/server0</instance>
-                           <sharedStore>true</sharedStore>
-                           <slave>false</slave>
-                           <dataFolder>../data</dataFolder>
-                           <failoverOnShutdown>true</failoverOnShutdown>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>create1</id>
-                        <goals>
-                           <goal>create</goal>
-                        </goals>
-                        <configuration>
-                           <instance>${basedir}/target/server1</instance>
-                           <sharedStore>true</sharedStore>
-                           <slave>true</slave>
-                           <dataFolder>../data</dataFolder>
-                           <failoverOnShutdown>true</failoverOnShutdown>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>create2</id>
-                        <goals>
-                           <goal>create</goal>
-                        </goals>
-                        <configuration>
-                           <instance>${basedir}/target/server2</instance>
-                           <sharedStore>true</sharedStore>
-                           <slave>true</slave>
-                           <dataFolder>../data</dataFolder>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>runClient</id>
-                        <goals>
-                           <goal>runClient</goal>
-                        </goals>
-                        <configuration>
-                           <clientClass>org.apache.activemq.artemis.jms.example.MultipleFailoverExample</clientClass>
-                           <args>
-                              <param>${basedir}/target/server0</param>
-                              <param>${basedir}/target/server1</param>
-                              <param>${basedir}/target/server2</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-multiple-failover-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
-      </profile>
-   </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create0</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <instance>${basedir}/target/server0</instance>
+                     <sharedStore>true</sharedStore>
+                     <slave>false</slave>
+                     <dataFolder>../data</dataFolder>
+                     <failoverOnShutdown>true</failoverOnShutdown>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create1</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <instance>${basedir}/target/server1</instance>
+                     <sharedStore>true</sharedStore>
+                     <slave>true</slave>
+                     <dataFolder>../data</dataFolder>
+                     <failoverOnShutdown>true</failoverOnShutdown>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create2</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <instance>${basedir}/target/server2</instance>
+                     <sharedStore>true</sharedStore>
+                     <slave>true</slave>
+                     <dataFolder>../data</dataFolder>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>runClient</id>
+                  <goals>
+                     <goal>runClient</goal>
+                  </goals>
+                  <configuration>
+                     <clientClass>org.apache.activemq.artemis.jms.example.MultipleFailoverExample</clientClass>
+                     <args>
+                        <param>${basedir}/target/server0</param>
+                        <param>${basedir}/target/server1</param>
+                        <param>${basedir}/target/server2</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>multiple-failover</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 19d9178..dcd0236 100644
--- a/examples/jms/no-consumer-buffering/pom.xml
+++ b/examples/jms/no-consumer-buffering/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-no-consumer-buffering-example</artifactId>
+   <artifactId>no-consumer-buffering</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS No Consumer Buffering Example</name>
 
@@ -37,70 +38,80 @@ under the License.
 
    <dependencies>
       <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
       </dependency>
    </dependencies>
 
    <profiles>
       <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>create</id>
-                        <goals>
-                           <goal>create</goal>
-                        </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.NoConsumerBufferingExample</clientClass>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>cli</goal>
-                        </goals>
-                        <configuration>
-                           <args>
-                              <param>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-no-consumer-buffering-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
+         <!-- specify -PnoServer if you don't want to start the server -->
+         <id>noServer</id>
+         <properties>
+            <noServer>true</noServer>
+         </properties>
       </profile>
    </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <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.NoConsumerBufferingExample</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>no-consumer-buffering</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/no-consumer-buffering/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/no-consumer-buffering/readme.html b/examples/jms/no-consumer-buffering/readme.html
index f05480b..7f5e427 100644
--- a/examples/jms/no-consumer-buffering/readme.html
+++ b/examples/jms/no-consumer-buffering/readme.html
@@ -27,6 +27,9 @@ under the License.
   <body onload="prettyPrint()">
      <h1>No Consumer Buffering Example</h1>
 
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
+
+
      <p>By default, ActiveMQ Artemis consumers buffer messages from the server in a client side buffer
      before actual delivery actually occurs.</p>
      <p>This improves performance since otherwise every time you called receive() or had processed the last
@@ -41,7 +44,7 @@ under the License.
      <p>If orders were buffered in each consumer, and a new consumer was added that consumer would not be able
      to process orders which were already in the client side buffer of another consumer.</p>
      <p>To turn off client side buffering of messages, set <code>consumer-window-size</code> to zero.</p>
-     
+
      <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>
      <h2>Example step-by-step</h2>
@@ -52,13 +55,13 @@ under the License.
    &lt;connection-factory name="ConnectionFactory"&gt;
       &lt;connector-ref connector-name="netty-connector"/&gt;
       &lt;entries&gt;
-         &lt;entry name="ConnectionFactory"/&gt;       
+         &lt;entry name="ConnectionFactory"/&gt;
       &lt;/entries&gt;
-      
+
       &lt;!-- We set the consumer window size to 0, which means messages are not buffered at all
       on the client side --&gt;
       &lt;consumer-window-size&gt;0&lt;/consumer-window-size&gt;
-      
+
    &lt;/connection-factory&gt;
      </code>
      </pre>
@@ -67,9 +70,7 @@ under the License.
      <p>We then consume messages from each consumer in a semi-random order. We note that the messages
      are consumed in the order they were sent.</p>
      <p>If the messages had been buffered in each consumer they would not be available to be consumed
-     in an order determined afer delivery.</p>    
-
-     <p><i>To run the example, simply type <code>mvn verify -Pexample</code> from this directory</i></p>
+     in an order determined afer delivery.</p>
 
      <ol>
         <li>Create an initial context to perform the JNDI lookup.</li>
@@ -106,74 +107,74 @@ under the License.
         <pre class="prettyprint">
            <code>MessageConsumer consumer1 = session.createConsumer(queue);</code>
         </pre>
-        
+
         <li>Start the connection</li>
-        
+
         <pre class="prettyprint">
            <code>
      connection.start();
            </code>
         </pre>
-           
+
 
         <li>Send 10 messages to the queue</li>
         <pre class="prettyprint">
            <code>
      final int numMessages = 10;
-         
+
      for (int i = 0; i < numMessages; i++)
      {
         TextMessage message = session.createTextMessage("This is text message: " + i);
 
         producer.send(message);
-     }           
+     }
            </code>
         </pre>
-        
+
         <li>Create another JMS MessageConsumer on the same queue.</li>
         <pre class="prettyprint">
            <code>MessageConsumer consumer2 = session.createConsumer(queue);</code>
         </pre>
-        
+
         <li>Consume three messages from consumer2</li>
-        
+
         <pre class="prettyprint">
            <code>
    for (int i = 0; i < 3; i++)
-   {         
+   {
       TextMessage message = (TextMessage)consumer2.receive(2000);
-            
+
       System.out.println("Consumed message from consumer2: " + message.getText());
-   }    
+   }
            </code>
         </pre>
-        
+
         <li>Consume five messages from consumer1</li>
-        
+
         <pre class="prettyprint">
            <code>
    for (int i = 0; i < 5; i++)
-   {         
+   {
       TextMessage message = (TextMessage)consumer1.receive(2000);
-            
+
       System.out.println("Consumed message from consumer1: " + message.getText());
-   }    
+   }
            </code>
-        </pre> 
-               
+        </pre>
+
         <li>Consume two more messages from consumer2</li>
-        
+
         <pre class="prettyprint">
            <code>
    for (int i = 0; i < 2; i++)
-   {         
+   {
       TextMessage message = (TextMessage)consumer1.receive(2000);
-            
+
       System.out.println("Consumed message from consumer2: " + message.getText());
-   }    
+   }
            </code>
-        </pre>                
-        
+        </pre>
+
 
         <li>Be sure to close our resources!</li>
 
@@ -185,7 +186,7 @@ under the License.
               {
                 initialContext.close();
               }
-              
+
               if (connection != null)
               {
                  connection.close();
@@ -195,7 +196,7 @@ under the License.
      </ol>
 
      <h2>More information</h2>
-     
+
      <ul>
          <li>User Manual's <a href="../../../docs/user-manual/en/html_single/index.html#flow-control.consumer.window">Consumer Window-Based Flow Control chapter</a></li>
      </ul>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 525a9c4..c7fdf56 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
@@ -23,7 +23,9 @@ 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.api.jms.ActiveMQJMSClient;
+import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
 
 /**
  * This example demonstrates how ActiveMQ Artemis consumers can be configured to not buffer any messages from
@@ -34,17 +36,13 @@ public class NoConsumerBufferingExample
    public static void main(final String[] args) throws Exception
    {
       Connection connection = null;
-      InitialContext initialContext = null;
       try
       {
-         // Step 1. Create an initial context to perform the JNDI lookup.
-         initialContext = new InitialContext();
-
          // Step 2. Perfom a lookup on the queue
-         Queue queue = (Queue)initialContext.lookup("queue/exampleQueue");
+         Queue queue = ActiveMQJMSClient.createQueue("exampleQueue");
 
-         // Step 3. Perform a lookup on the Connection Factory
-         ConnectionFactory cf = (ConnectionFactory)initialContext.lookup("ConnectionFactory");
+         // Step 3. new Connection factory with consumerWindowsize=0
+         ConnectionFactory cf = new ActiveMQConnectionFactory("tcp://localhost:61616?consumerWindowSize=0");
 
          // Step 4. Create a JMS Connection
          connection = cf.createConnection();
@@ -110,10 +108,6 @@ public class NoConsumerBufferingExample
       finally
       {
          // Step 9. Be sure to close our resources!
-         if (initialContext != null)
-         {
-            initialContext.close();
-         }
 
          if (connection != null)
          {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 72d4636..6dec19e 100644
--- a/examples/jms/non-transaction-failover/pom.xml
+++ b/examples/jms/non-transaction-failover/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-non-transaction-failover-example</artifactId>
+   <artifactId>non-transaction-failover</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS Non Transaction Failover Example</name>
 
@@ -42,71 +43,67 @@ under the License.
          <version>${project.version}</version>
       </dependency>
       <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
       </dependency>
    </dependencies>
 
-   <profiles>
-      <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>create0</id>
-                        <goals>
-                           <goal>create</goal>
-                        </goals>
-                        <configuration>
-                           <instance>${basedir}/target/server0</instance>
-                           <sharedStore>true</sharedStore>
-                           <slave>false</slave>
-                           <dataFolder>../data</dataFolder>
-                           <failoverOnShutdown>true</failoverOnShutdown>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>create1</id>
-                        <goals>
-                           <goal>create</goal>
-                        </goals>
-                        <configuration>
-                           <instance>${basedir}/target/server1</instance>
-                           <sharedStore>true</sharedStore>
-                           <slave>true</slave>
-                           <dataFolder>../data</dataFolder>
-                           <failoverOnShutdown>true</failoverOnShutdown>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>runClient</id>
-                        <goals>
-                           <goal>runClient</goal>
-                        </goals>
-                        <configuration>
-                           <clientClass>org.apache.activemq.artemis.jms.example.NonTransactionFailoverExample</clientClass>
-                           <args>
-                              <param>${basedir}/target/server0</param>
-                              <param>${basedir}/target/server1</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-non-transaction-failover-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                   </dependencies>
-               </plugin>
-            </plugins>
-         </build>
-      </profile>
-   </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create0</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <instance>${basedir}/target/server0</instance>
+                     <sharedStore>true</sharedStore>
+                     <slave>false</slave>
+                     <dataFolder>../data</dataFolder>
+                     <failoverOnShutdown>true</failoverOnShutdown>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create1</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <instance>${basedir}/target/server1</instance>
+                     <sharedStore>true</sharedStore>
+                     <slave>true</slave>
+                     <dataFolder>../data</dataFolder>
+                     <failoverOnShutdown>true</failoverOnShutdown>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>runClient</id>
+                  <goals>
+                     <goal>runClient</goal>
+                  </goals>
+                  <configuration>
+                     <clientClass>org.apache.activemq.artemis.jms.example.NonTransactionFailoverExample</clientClass>
+                     <args>
+                        <param>${basedir}/target/server0</param>
+                        <param>${basedir}/target/server1</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>non-transaction-failover</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>


[05/18] activemq-artemis git commit: ARTEMIS-180 removing -Pexample and some other improvements around the examples

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/security/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/security/readme.html b/examples/jms/security/readme.html
index 4cca6a0..e694c3a 100644
--- a/examples/jms/security/readme.html
+++ b/examples/jms/security/readme.html
@@ -27,55 +27,58 @@ under the License.
   <body onload="prettyPrint()">
      <h1>JMS Security Example</h1>
 
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
+
+
      <p>This example shows how to configure and use security using ActiveMQ Artemis.</p>
-     
-     <p>With security properly configured, ActiveMQ Artemis can restrict client access to its resources, including 
-     connection creation, message sending/receiving, etc. This is done by configuring users and roles as well as permissions in 
+
+     <p>With security properly configured, ActiveMQ Artemis can restrict client access to its resources, including
+     connection creation, message sending/receiving, etc. This is done by configuring users and roles as well as permissions in
      the configuration files. </p>
 
      <p>ActiveMQ Artemis supports wild-card security configuration. This feature makes security configuration very
      flexible and enables fine-grained control over permissions in an efficient way.</p>
-     
+
      <p>For a full description of how to configure security with ActiveMQ Artemis, please consult the user
      manual.</p>
-     
+
      <p>This example demonstrates how to configure users/roles, how to configure topics with proper permissions using wild-card
      expressions, and how they take effects in a simple program. </p>
-     
+
      <p>First we need to configure users with roles. Users and Roles are configured in <code>activemq-users.xml</code>. This example has four users
      configured as below </p>
-     
+
      <pre class="prettyprint">
      <code>
 		   &lt;user name=&quot;bill&quot; password=&quot;activemq&quot;&gt;
 		      &lt;role name=&quot;user&quot;/&gt;
 		   &lt;/user&gt;
-		  
+
 		   &lt;user name=&quot;andrew&quot; password=&quot;activemq1&quot;&gt;
 		      &lt;role name=&quot;europe-user&quot;/&gt;
 		      &lt;role name=&quot;user&quot;/&gt;
 		   &lt;/user&gt;
-		   
+
 		   &lt;user name=&quot;frank&quot; password=&quot;activemq2&quot;&gt;
 		      &lt;role name=&quot;us-user&quot;/&gt;
 		      &lt;role name=&quot;news-user&quot;/&gt;
 		      &lt;role name=&quot;user&quot;/&gt;
 		   &lt;/user&gt;
-		   
+
 		   &lt;user name=&quot;sam&quot; password=&quot;activemq3&quot;&gt;
 		      &lt;role name=&quot;news-user&quot;/&gt;
 		      &lt;role name=&quot;user&quot;/&gt;
 		   &lt;/user&gt;
      </code>
      </pre>
-     
+
      <p>
      Each user has three properties available: user name, password, and roles it belongs to. It should be noted that
      a user can belong to more than one role. In the above configuration, all users belong to role 'user'. User 'andrew' also
      belongs to role 'europe-user', user 'frank' also belongs to 'us-user' and 'news-user' and user 'sam' also belongs to 'news-user'.
      </p>
      <p>
-     User name and password consists of a valid account that can be used to establish connections to a ActiveMQ Artemis server, while 
+     User name and password consists of a valid account that can be used to establish connections to a ActiveMQ Artemis server, while
      roles are used in controlling the access privileges against ActiveMQ Artemis topics and queues. You can achieve this control by
      configuring proper permissions in <code>broker.xml</code>, like the following
      </p>
@@ -90,7 +93,7 @@ under the License.
 		      &lt;permission type=&quot;send&quot; roles=&quot;user&quot;/&gt;
 		      &lt;permission type=&quot;consume&quot; roles=&quot;user&quot;/&gt;
 		   &lt;/security-setting&gt;
-		
+
 		   &lt;security-setting match=&quot;jms.topic.news.europe.#&quot;&gt;
 		      &lt;permission type=&quot;createDurableQueue&quot; roles=&quot;user&quot;/&gt;
 		      &lt;permission type=&quot;deleteDurableQueue&quot; roles=&quot;user&quot;/&gt;
@@ -99,7 +102,7 @@ under the License.
 		      &lt;permission type=&quot;send&quot; roles=&quot;europe-user&quot;/&gt;
 		      &lt;permission type=&quot;consume&quot; roles=&quot;news-user&quot;/&gt;
 		   &lt;/security-setting&gt;
-		
+
 		   &lt;security-setting match=&quot;jms.topic.news.us.#&quot;&gt;
 		      &lt;permission type=&quot;createDurableQueue&quot; roles=&quot;user&quot;/&gt;
 		      &lt;permission type=&quot;deleteDurableQueue&quot; roles=&quot;user&quot;/&gt;
@@ -110,22 +113,22 @@ under the License.
 		   &lt;/security-setting&gt;
      &lt;/security-settings&gt;
      </code></pre>
-     
-     <p>Permissions can be defined on any group of queues, by using a wildcard. You can easily specify 
+
+     <p>Permissions can be defined on any group of queues, by using a wildcard. You can easily specify
      wildcards to apply certain permissions to a set of matching queues and topics. In the above configuration
      we have created four sets of permissions, each set matches against a special group of targets, indicated by wild-card match attributes.</p>
-     
+
      <p>You can provide a very broad permission control as a default and then add more strict control
      over specific addresses. By the above we define the following access rules:</p>
-     
+
          <li>Only role 'us-user' can create/delete and pulish messages to topics whose names match wild-card pattern 'news.us.#'.</li>
          <li>Only role 'europe-user' can create/delete and publish messages to topics whose names match wild-card pattern 'news.europe.#'.</li>
          <li>Only role 'news-user' can subscribe messages to topics whose names match wild-card pattern 'news.us.#' and 'news.europe.#'.</li>
          <li>For any other topics that don't match any of the above wild-card patterns, permissions are granted to users of role 'user'.</li>
-         
-     <p>To illustrate the effect of permissions, three topics are deployed. Topic 'genericTopic' matches 'jms.topic.#' wild-card, topic 'news.europe.europeTopic' matches 
+
+     <p>To illustrate the effect of permissions, three topics are deployed. Topic 'genericTopic' matches 'jms.topic.#' wild-card, topic 'news.europe.europeTopic' matches
      jms.topic.news.europe.#' wild-cards, and topic 'news.us.usTopic' matches 'jms.topic.news.us.#'.</p>
-     
+
      <p>With ActiveMQ Artemis, the security manager is also configurable. You can use JAASSecurityManager or JBossASSecurityManager based on you need. Please
      check out the activemq-beans.xml for how to do. In this example we just use the basic ActiveMQSecurityManagerImpl which reads users/roles/passwords from the xml
      file <code>activemq-users.xml</code>.
@@ -286,7 +289,7 @@ under the License.
            checkUserReceiveNoSend(usTopic, samConnection, "sam", frankConnection);
            </code>
         </pre>
-        
+
         <li>And finally, <b>always</b> remember to close your JMS connections and resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
 
         <pre class="prettyprint">
@@ -309,7 +312,7 @@ under the License.
               {
                  samConnection.close();
               }
-		         
+
               // Also the initialContext
               if (initialContext != null)
               {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/send-acknowledgements/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/send-acknowledgements/pom.xml b/examples/jms/send-acknowledgements/pom.xml
index 6d22b09..b53c1f2 100644
--- a/examples/jms/send-acknowledgements/pom.xml
+++ b/examples/jms/send-acknowledgements/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-send-acknowledgements-example</artifactId>
+   <artifactId>send-acknowledgements</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS Send Acknowledgements Example</name>
 
@@ -41,72 +42,72 @@ under the License.
          <artifactId>artemis-jms-client</artifactId>
          <version>${project.version}</version>
       </dependency>
-      <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
-      </dependency>
    </dependencies>
 
    <profiles>
       <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>create</id>
-                        <goals>
-                           <goal>create</goal>
-                        </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.SendAcknowledgementsExample</clientClass>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>cli</goal>
-                        </goals>
-                        <configuration>
-                           <args>
-                              <param>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-send-acknowledgements-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
+         <!-- specify -PnoServer if you don't want to start the server -->
+         <id>noServer</id>
+         <properties>
+            <noServer>true</noServer>
+         </properties>
       </profile>
    </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create</id>
+                  <goals>
+                     <goal>create</goal>
+                  </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.SendAcknowledgementsExample</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>send-acknowledgements</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/send-acknowledgements/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/send-acknowledgements/readme.html b/examples/jms/send-acknowledgements/readme.html
index 1077f32..6e7e8be 100644
--- a/examples/jms/send-acknowledgements/readme.html
+++ b/examples/jms/send-acknowledgements/readme.html
@@ -27,9 +27,12 @@ under the License.
   <body onload="prettyPrint()">
      <h1>Asynchronous Send Acknowledgements Example</h1>
 
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
+
+
      <p>Asynchronous Send Acknowledgements are an advanced feature of ActiveMQ Artemis which allow you to
      receive acknowledgements that messages were successfully received at the server in a separate thread to the sending thread<p/>
-     <p>In this example we create a normal JMS session, then set a SendAcknowledgementHandler on the JMS 
+     <p>In this example we create a normal JMS session, then set a SendAcknowledgementHandler on the JMS
      session's underlying core session. We send many messages to the server without blocking and asynchronously
      receive send acknowledgements via the SendAcknowledgementHandler.
 
@@ -64,12 +67,12 @@ under the License.
          class MySendAcknowledgementsHandler implements SendAcknowledgementHandler
          {
             int count = 0;
-            
+
             public void sendAcknowledged(final Message message)
             {
                System.out.println("Received send acknowledgement for message " + count++);
-            }            
-         }           
+            }
+         }
            </code>
         </pre>
 
@@ -82,9 +85,9 @@ under the License.
         <pre class="prettyprint">
            <code>
          ClientSession coreSession = ((ActiveMQSession)session).getCoreSession();
-         
+
          coreSession.setSendAcknowledgementHandler(new MySendAcknowledgementsHandler());
-           
+
            </code>
         </pre>
 
@@ -92,8 +95,8 @@ under the License.
         <pre class="prettyprint">
            <code>
          MessageProducer producer = session.createProducer(queue);
-         
-         producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);           
+
+         producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
            </code>
         </pre>
 
@@ -101,19 +104,19 @@ under the License.
           <pre class="prettyprint">
            <code>
          final int numMessages = 5000;
-         
+
          for (int i = 0; i < numMessages; i++)
          {
             javax.jms.Message jmsMessage = session.createMessage();
-            
+
             producer.send(jmsMessage);
-            
+
             System.out.println("Sent message " + i);
-         }           
+         }
            </code>
         </pre>
 
-       
+
         <li>And finally, <b>always</b> remember to close your JMS connections and resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
 
         <pre class="prettyprint">

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/spring-integration/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/spring-integration/pom.xml b/examples/jms/spring-integration/pom.xml
index fcc6d9f..5c30fd6 100644
--- a/examples/jms/spring-integration/pom.xml
+++ b/examples/jms/spring-integration/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-spring-integration-example</artifactId>
+   <artifactId>spring-integration</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS Spring Integration Example</name>
 
@@ -51,36 +52,31 @@ under the License.
       </dependency>
    </dependencies>
 
-   <profiles>
-      <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>runClient</id>
-                        <goals>
-                           <goal>runClient</goal>
-                        </goals>
-                        <configuration>
-                           <clientClass>org.apache.activemq.artemis.jms.example.SpringExample</clientClass>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-spring-integration-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
-      </profile>
-   </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>runClient</id>
+                  <goals>
+                     <goal>runClient</goal>
+                  </goals>
+                  <configuration>
+                     <clientClass>org.apache.activemq.artemis.jms.example.SpringExample</clientClass>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>spring-integration</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/spring-integration/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/spring-integration/readme.html b/examples/jms/spring-integration/readme.html
index 0861528..ddb15a7 100644
--- a/examples/jms/spring-integration/readme.html
+++ b/examples/jms/spring-integration/readme.html
@@ -26,10 +26,10 @@ under the License.
    </head>
    <body onload="prettyPrint()">
       <h1>ActiveMQ Artemis Spring Example</h1>
-      
+
       <p>This examples shows how to setup and run an embedded JMS server within a Spring ApplicationContext using ActiveMQ Artemis along with ActiveMQ Artemis configuration files.</p>
-     
-      <h2>Example step-by-step</h2>     
+
+      <h2>Example step-by-step</h2>
       <p><i><b>YOU MUST DOWNLOAD THE SPRING LIBRARIES TO RUN THIS EXAMPLE!!!</b>  You must also modify the build.xml file to include the spring jars.  You'll see the placeholder that is already there.</i></p>
       <p><i>To run the example, simply type <code>mvn verify -Pexample</code> from this directory</i></p>
    </body>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/ssl-enabled/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/ssl-enabled/pom.xml b/examples/jms/ssl-enabled/pom.xml
index 7c6e4f8..c0a21a1 100644
--- a/examples/jms/ssl-enabled/pom.xml
+++ b/examples/jms/ssl-enabled/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-ssl-enabled-example</artifactId>
+   <artifactId>ssl-enabled</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS SSL Enabled Example</name>
 
@@ -37,71 +38,81 @@ under the License.
 
    <dependencies>
       <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
       </dependency>
    </dependencies>
 
    <profiles>
       <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>create</id>
-                        <goals>
-                           <goal>create</goal>
-                        </goals>
-                     </execution>
-                     <execution>
-                        <id>start</id>
-                        <goals>
-                           <goal>cli</goal>
-                        </goals>
-                        <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>
-                        <id>runClient</id>
-                        <goals>
-                           <goal>runClient</goal>
-                        </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>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-ssl-enabled-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
+         <!-- specify -PnoServer if you don't want to start the server -->
+         <id>noServer</id>
+         <properties>
+            <noServer>true</noServer>
+         </properties>
       </profile>
    </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <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>
+                  <id>runClient</id>
+                  <goals>
+                     <goal>runClient</goal>
+                  </goals>
+                  <configuration>
+                     <clientClass>org.apache.activemq.artemis.jms.example.SSLExample</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>ssl-enabled</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/ssl-enabled/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/ssl-enabled/readme.html b/examples/jms/ssl-enabled/readme.html
index 42db4de..f1d94b5 100644
--- a/examples/jms/ssl-enabled/readme.html
+++ b/examples/jms/ssl-enabled/readme.html
@@ -27,11 +27,14 @@ under the License.
   <body onload="prettyPrint()">
      <h1>JMS SSL Example</h1>
 
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
+
+
      <p>This example shows you how to configure SSL with ActiveMQ Artemis to send and receive message. </p>
-     
+
      <p>Using SSL can make your messaging applications interact with ActiveMQ Artemis securely. An application can
      be secured transparently without extra coding effort. To secure your messaging application with SSL, you need to configure connector and acceptor as follows:</p>
-     
+
      <p>
         <pre class="prettyprint">
            <code>
@@ -46,98 +49,8 @@ under the License.
            </code>
         </pre>
      </p>
-     
+
      <p>In the configuration, the activemq.example.keystore is the key store file holding the server's certificate. The activemq.example.truststore
      is the file holding the certificates which the client trusts (i.e. the server's certificate exported from activemq.example.keystore). They are pre-generated for illustration purpose<a id="fnr1" href="readme.html#fn1"><sup>1</sup></a>.</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>
-
-     <ol>
-        <li>First we need to get an initial context so we can look-up the JMS connection factory and destination objects from JNDI. This initial context will get it's properties from the <code>client-jndi.properties</code> file in the directory <code>../common/config</code></li>
-        <pre class="prettyprint">
-           <code>InitialContext initialContext = getContext();</code>
-        </pre>
-
-        <li>We look-up the JMS queue object from JNDI</li>
-        <pre class="prettyprint">
-           <code>Queue queue = (Queue) initialContext.lookup("/queue/exampleQueue");</code>
-        </pre>
-
-        <li>We look-up the JMS connection factory object from JNDI</li>
-        <pre class="prettyprint">
-           <code>ConnectionFactory cf = (ConnectionFactory) initialContext.lookup("/ConnectionFactory");</code>
-        </pre>
-
-        <li>We create a JMS connection</li>
-        <pre class="prettyprint">
-           <code>connection = cf.createConnection();</code>
-        </pre>
-
-        <li>We create a JMS session. The session is created as non transacted and will auto acknowledge messages.</li>
-        <pre class="prettyprint">
-           <code>Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);</code>
-        </pre>
-
-        <li>We create a JMS message producer on the session. This will be used to send the messages.</li>
-        <pre class="prettyprint">
-          <code>MessageProducer messageProducer = session.createProducer(topic);</code>
-       </pre>
-
-        <li>We create a JMS text message that we are going to send.</li>
-        <pre class="prettyprint">
-           <code>TextMessage message = session.createTextMessage("This is a text message");</code>
-        </pre>
-
-        <li>We send message to the queue</li>
-        <pre class="prettyprint">
-           <code>messageProducer.send(message);</code>
-        </pre>
-
-        <li>We create a JMS Message Consumer to receive the message.</li>
-          <pre class="prettyprint">
-           <code>MessageConsumer messageConsumer = session.createConsumer(queue);</code>
-        </pre>
-
-        <li>We start the connection. In order for delivery to occur on any consumers or subscribers on a connection, the connection must be started</li>
-        <pre class="prettyprint">
-           <code>connection.start();</code>
-        </pre>
-
-        <li>The message arrives at the consumer. In this case we use a timeout of 5000 milliseconds but we could use a blocking 'receive()'</li>
-        <pre class="prettyprint">
-           <code>TextMessage messageReceived = (TextMessage) messageConsumer.receive(5000);</code>
-        </pre>
-
-        <li>And finally, <b>always</b> remember to close your JMS connections and resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
-
-        <pre class="prettyprint">
-           <code>finally
-           {
-              if (initialContext != null)
-              {
-                initialContext.close();
-              }
-              if (connection != null)
-              {
-                 connection.close();
-              }
-           }</code>
-        </pre>
-     </ol>
-     
-     <hr>
-     
-     <ol>
-         <li><a id="fn1"/>The stores were generating using the following commands&nbsp;<a href="readme.html#fnr1">&#8617;</a>:
-             <ul>
-                 <li>create the keystore: <code>keytool -genkey -keystore activemq.example.keystore -storepass activemqexample</code></li>
-                 <li>export the certificate: <code>keytool -export -keystore activemq.example.keystore -file activemq.cer</code></li>
-                 <li>create the truststore: <code>keytool -import -file activemq.cer -keystore activemq.example.truststore -storepass activemqexample</code></li>
-            </ul>
-         </li>
-    </ol>
-         
   </body>
 </html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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
deleted file mode 100644
index 02b8fb7..0000000
--- a/examples/jms/static-selector-jms/pom.xml
+++ /dev/null
@@ -1,106 +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>artemis-jms-static-selector-jms-example</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS Static Selector Example</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>
-   </dependencies>
-
-   <profiles>
-      <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>create</id>
-                        <goals>
-                           <goal>create</goal>
-                        </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.StaticSelectorJMSExample</clientClass>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>cli</goal>
-                        </goals>
-                        <configuration>
-                           <args>
-                              <param>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-static-selector-jms-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
-      </profile>
-   </profiles>
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/static-selector-jms/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/static-selector-jms/readme.html b/examples/jms/static-selector-jms/readme.html
deleted file mode 100644
index 7cda407..0000000
--- a/examples/jms/static-selector-jms/readme.html
+++ /dev/null
@@ -1,158 +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.
--->
-
-<html>
-  <head>
-    <title>ActiveMQ Artemis Static Message Selector JMS Example</title>
-    <link rel="stylesheet" type="text/css" href="../common/common.css" />
-    <link rel="stylesheet" type="text/css" href="../common/prettify.css" />
-    <script type="text/javascript" src="../common/prettify.js"></script>
-  </head>
-  <body onload="prettyPrint()">
-     <h1>Static Message Selector Example</h1>
-
-     <p>This example shows you how to configure a JMS queue with static message selectors (filters).</p>
-     
-     <p>Static message selectors are ActiveMQ's extension to message selectors as defined in JMS spec 1.1.
-     Rather than specifying the selector in the application code, static message selectors are defined in one of 
-     ActiveMQ's configuration files, activemq-jms.xml, as an element called 'selector' inside each JMS queue
-     definition:</p>
-     
-     <pre class="prettyprint"><code>
-      	&lt;queue name=&quot;selectorQueue&quot;&gt;
-            &lt;entry name=&quot;/queue/selectorQueue&quot;&gt;
-      	    &lt;selector string=&quot;color='red'&quot;/&gt;
-      	&lt;/queue&gt;
-     </code></pre>
-     
-     <p>Once configured the queue <code>selectorQueue</code> only delivers messages that are 
-        that match the selector; i.e. only the messages whose <code>color</code> property is equal to <code>'red'</code> can be received by its consumers.
-        Those that don't match the selector will be dropped by the queue and therefore will never be delivered to any of its consumers.</p>
-      
-     <p>In the example code, five messages with different <code>color</code> property values are sent to queue <code>selectorQueue</code>.
-        One consumer is created to receive messages from the queue. Of the five sent messages, two have a <code>color</code> property
-        set to <code>'red'</code>, one has it set to <code>'blue'</code>, another to <code>'green'</code>,
-        and one has not the <code>color</code> property at all. The result is that the consumer only gets the two messages
-        with the <code>'red'</code> color.</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>
-
-     <ol>
-        <li>First we need to get an initial context so we can look-up the JMS connection factory and destination objects from JNDI. This initial context will get it's properties from the <code>client-jndi.properties</code> file in the directory <code>../common/config</code></li>
-        <pre class="prettyprint">
-           <code>InitialContext initialContext = getContext();</code>
-        </pre>
-
-        <li>We look-up the JMS queue object from JNDI, this is the queue that has the selector configured with it.</li>
-        <pre class="prettyprint">
-           <code>Queue queue = (Queue) initialContext.lookup("/queue/selectorQueue");</code>
-        </pre>
-
-        <li>We look-up the JMS connection factory object from JNDI</li>
-        <pre class="prettyprint">
-           <code>ConnectionFactory cf = (ConnectionFactory) initialContext.lookup("/ConnectionFactory");</code>
-        </pre>
-
-        <li>We create a JMS connection</li>
-        <pre class="prettyprint">
-           <code>connection = cf.createConnection();</code>
-        </pre>
-
-        <li>We start the connection</li>
-        <pre class="prettyprint">
-           <code>connection.start();</code>
-        </pre>
-
-        <li>We create a JMS session. The session is created as non transacted and will auto acknowledge messages.</li>
-        <pre class="prettyprint">
-           <code>Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);</code>
-        </pre>
-
-        <li>We create a JMS message producer on the session. This will be used to send the messages.</li>
-        <pre class="prettyprint">
-          <code>MessageProducer producer = session.createProducer(queue);</code>
-       </pre>
-
-        <li>We create a JMS message consumer that receives 'red' messages. The message listener will
-            check the 'color' property on each received message.</li>
-         <pre class="prettyprint">
-           <code>
-         MessageConsumer redConsumer = session.createConsumer(queue);
-         redConsumer.setMessageListener(new SimpleMessageListener("red"));
-           </code>
-         </pre>
-
-        <li>We create five messages with different 'color' properties.</li>
-        <pre class="prettyprint">
-          <code>
-         TextMessage redMessage1 = session.createTextMessage("Red-1");
-         redMessage1.setStringProperty("color", "red");
-         TextMessage redMessage2 = session.createTextMessage("Red-2");
-         redMessage2.setStringProperty("color", "red");
-         TextMessage greenMessage = session.createTextMessage("Green");
-         greenMessage.setStringProperty("color", "green");
-         TextMessage blueMessage = session.createTextMessage("Blue");
-         blueMessage.setStringProperty("color", "blue");
-         TextMessage normalMessage = session.createTextMessage("No color");
-         </code>
-        </pre>
-
-        <li>We send those messages.</li>
-        <pre class="prettyprint">
-          <code>
-         producer.send(redMessage1);
-         System.out.println("Message sent: " + redMessage1.getText());
-         producer.send(greenMessage);
-         System.out.println("Message sent: " + greenMessage.getText());
-         producer.send(blueMessage);
-         System.out.println("Message sent: " + blueMessage.getText());
-         producer.send(redMessage2);
-         System.out.println("Message sent: " + redMessage2.getText());
-         producer.send(normalMessage);
-         System.out.println("Message sent: " + normalMessage.getText());
-          </code>
-        </pre>
-
-        <li>Waiting for the message listener to check the received messages.</li>
-        <pre class="prettyprint">
-          <code>
-          Thread.sleep(5000);
-         </code>
-        </pre>
-        
-        <li>And finally, <b>always</b> remember to close your JMS connections and resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
-
-        <pre class="prettyprint">
-           <code>finally
-           {
-              if (initialContext != null)
-              {
-                initialContext.close();
-              }
-              if (connection != null)
-              {
-                 connection.close();
-              }
-           }</code>
-        </pre>
-     </ol>
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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
deleted file mode 100644
index 0f06417..0000000
--- a/examples/jms/static-selector-jms/src/main/java/org/apache/activemq/artemis/jms/example/StaticSelectorJMSExample.java
+++ /dev/null
@@ -1,147 +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.jms.example;
-
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageListener;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import javax.naming.InitialContext;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-/**
- * A simple JMS example that shows how static message selectors work when using JMS config.
- */
-public class StaticSelectorJMSExample
-{
-   public static void main(final String[] args) throws Exception
-   {
-      AtomicBoolean result = new AtomicBoolean(true);
-      Connection connection = null;
-      InitialContext initialContext = null;
-      try
-      {
-         // Step 1. Create an initial context to perform the JNDI lookup.
-         initialContext = new InitialContext();
-
-         // Step 2. look-up the JMS queue object from JNDI, this is the queue that has filter configured with it.
-         Queue queue = (Queue)initialContext.lookup("queue/exampleQueue");
-
-         // Step 3. look-up the JMS connection factory object from JNDI
-         ConnectionFactory cf = (ConnectionFactory)initialContext.lookup("ConnectionFactory");
-
-         // Step 4. Create a JMS Connection
-         connection = cf.createConnection();
-
-         // Step 5. Start the connection
-         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 JMS Message Producer
-         MessageProducer producer = producerSession.createProducer(queue);
-
-         // Step 8. Create a JMS Message Consumer that receives 'red' messages
-         MessageConsumer redConsumer = session.createConsumer(queue);
-         redConsumer.setMessageListener(new SimpleMessageListener("red", result));
-
-         // Step 9. Create five messages with different 'color' properties
-         TextMessage redMessage1 = session.createTextMessage("Red-1");
-         redMessage1.setStringProperty("color", "red");
-         TextMessage redMessage2 = session.createTextMessage("Red-2");
-         redMessage2.setStringProperty("color", "red");
-         TextMessage greenMessage = session.createTextMessage("Green");
-         greenMessage.setStringProperty("color", "green");
-         TextMessage blueMessage = session.createTextMessage("Blue");
-         blueMessage.setStringProperty("color", "blue");
-         TextMessage normalMessage = session.createTextMessage("No color");
-
-         // Step 10. Send the Messages
-         producer.send(redMessage1);
-         System.out.println("Message sent: " + redMessage1.getText());
-         producer.send(greenMessage);
-         System.out.println("Message sent: " + greenMessage.getText());
-         producer.send(blueMessage);
-         System.out.println("Message sent: " + blueMessage.getText());
-         producer.send(redMessage2);
-         System.out.println("Message sent: " + redMessage2.getText());
-         producer.send(normalMessage);
-         System.out.println("Message sent: " + normalMessage.getText());
-
-         // Step 11. Waiting for the message listener to check the received messages.
-         Thread.sleep(5000);
-
-         if (!result.get())
-            throw new IllegalStateException();
-      }
-      finally
-      {
-         // Step 12. Be sure to close our JMS resources!
-         if (initialContext != null)
-         {
-            initialContext.close();
-         }
-         if (connection != null)
-         {
-            connection.close();
-         }
-      }
-   }
-}
-
-class SimpleMessageListener implements MessageListener
-{
-   private final String name;
-   private AtomicBoolean result;
-
-   public SimpleMessageListener(final String listener, AtomicBoolean result)
-   {
-      name = listener;
-      this.result = result;
-   }
-
-   public void onMessage(final Message msg)
-   {
-      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))
-         {
-            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/dd820318/examples/jms/static-selector-jms/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/static-selector-jms/src/main/resources/activemq/server0/artemis-roles.properties b/examples/jms/static-selector-jms/src/main/resources/activemq/server0/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/static-selector-jms/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/dd820318/examples/jms/static-selector-jms/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/static-selector-jms/src/main/resources/activemq/server0/artemis-users.properties b/examples/jms/static-selector-jms/src/main/resources/activemq/server0/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/static-selector-jms/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/dd820318/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
deleted file mode 100644
index cdeb534..0000000
--- a/examples/jms/static-selector-jms/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,62 +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">
-         <selector string="color='red'"/>
-      </queue>
-   </jms>
-
-   <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</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/dd820318/examples/jms/static-selector-jms/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/jms/static-selector-jms/src/main/resources/jndi.properties b/examples/jms/static-selector-jms/src/main/resources/jndi.properties
deleted file mode 100644
index 93537c4..0000000
--- a/examples/jms/static-selector-jms/src/main/resources/jndi.properties
+++ /dev/null
@@ -1,20 +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.
-
-java.naming.factory.initial=org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory
-connectionFactory.ConnectionFactory=tcp://localhost:61616
-queue.queue/exampleQueue=exampleQueue

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/static-selector/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/static-selector/pom.xml b/examples/jms/static-selector/pom.xml
index 54881c9..0880cba 100644
--- a/examples/jms/static-selector/pom.xml
+++ b/examples/jms/static-selector/pom.xml
@@ -27,7 +27,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-static-selector-example</artifactId>
+   <artifactId>static-selector</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis Static Selector Example</name>
 
@@ -37,15 +37,22 @@ under the License.
 
    <dependencies>
       <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
       </dependency>
    </dependencies>
 
    <profiles>
       <profile>
-         <id>example</id>
-         <build>
+         <!-- specify -PnoServer if you don't want to start the server -->
+         <id>noServer</id>
+         <properties>
+            <noServer>true</noServer>
+         </properties>
+      </profile>
+   </profiles>
+   <build>
             <plugins>
                <plugin>
                   <groupId>org.apache.activemq</groupId>
@@ -56,6 +63,9 @@ under the License.
                         <goals>
                            <goal>create</goal>
                         </goals>
+                        <configuration>
+                           <ignore>${noServer}</ignore>
+                        </configuration>
                      </execution>
                      <execution>
                         <id>start</id>
@@ -63,6 +73,7 @@ under the License.
                            <goal>cli</goal>
                         </goals>
                         <configuration>
+                           <ignore>${noServer}</ignore>
                            <spawn>true</spawn>
                            <testURI>tcp://localhost:61616</testURI>
                            <args>
@@ -85,6 +96,7 @@ under the License.
                            <goal>cli</goal>
                         </goals>
                         <configuration>
+                           <ignore>${noServer}</ignore>
                            <args>
                               <param>stop</param>
                            </args>
@@ -94,14 +106,12 @@ under the License.
                   <dependencies>
                      <dependency>
                         <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-static-selector-example</artifactId>
+                        <artifactId>static-selector</artifactId>
                         <version>${project.version}</version>
                      </dependency>
                   </dependencies>
                </plugin>
             </plugins>
          </build>
-      </profile>
-   </profiles>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/static-selector/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/static-selector/readme.html b/examples/jms/static-selector/readme.html
index e0a3fc3..171f15a 100644
--- a/examples/jms/static-selector/readme.html
+++ b/examples/jms/static-selector/readme.html
@@ -27,134 +27,34 @@ under the License.
   <body onload="prettyPrint()">
      <h1>Static Message Selector Example</h1>
 
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
+
+
      <p>This example shows you how to configure a ActiveMQ Artemis queue with static message selectors (filters)
         (to configure a static selector directly on a <em>JMS</em> queue, please see the
         <a href="../static-selector-jms/readme.html">static-selector-jms example</a>).</p>
-     
+
      <p>Static message selectors are ActiveMQ's extension to message selectors as defined in JMS spec 1.1.
-     Rather than specifying the selector in the application code, static message selectors are defined in one of 
+     Rather than specifying the selector in the application code, static message selectors are defined in one of
      ActiveMQ's configuration files, broker.xml, as an element called 'filter' inside each queue
      definition, like</p>
-     
+
      <pre class="prettyprint"><code>
-      &lt;queues&gt;     
+      &lt;queues&gt;
       	&lt;queue name=&quot;jms.queue.selectorQueue&quot;&gt;
       	    &lt;address&gt;jms.queue.selectorQueue&lt;/address&gt;
       	    &lt;filter string=&quot;color='red'&quot;/&gt;
       	&lt;/queue&gt;
       &lt;/queues&gt;
      </code></pre>
-     
+
      <p>Once configured the queue 'selectorQueue' only delivers messages that are selected against the filter, i.e.,
      only the messages whose 'color' properties are of 'red' values can be received by its consumers. Those that don't match
      the filter will be dropped by the queue and therefore will never be delivered to any of its consumers.</p>
-      
+
      <p>In the example code, five messages with different 'color' property values are sent to queue 'selectorQueue'. One consumer
-     is created to receive messages from the queue. Of the five sent messages, two are of 'red' color properties, one is 'blue', 
+     is created to receive messages from the queue. Of the five sent messages, two are of 'red' color properties, one is 'blue',
      one is 'green' and one has not the 'color' property at all. The result is that the consumer only gets the two 'red' messages.</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>
-
-     <ol>
-        <li>First we need to get an initial context so we can look-up the JMS connection factory and destination objects from JNDI. This initial context will get it's properties from the <code>client-jndi.properties</code> file in the directory <code>../common/config</code></li>
-        <pre class="prettyprint">
-           <code>InitialContext initialContext = getContext();</code>
-        </pre>
-
-        <li>We look-up the JMS queue object from JNDI, this is the queue that has filter configured with it.</li>
-        <pre class="prettyprint">
-           <code>Queue queue = (Queue) initialContext.lookup("/queue/selectorQueue");</code>
-        </pre>
-
-        <li>We look-up the JMS connection factory object from JNDI</li>
-        <pre class="prettyprint">
-           <code>ConnectionFactory cf = (ConnectionFactory) initialContext.lookup("/ConnectionFactory");</code>
-        </pre>
-
-        <li>We create a JMS connection</li>
-        <pre class="prettyprint">
-           <code>connection = cf.createConnection();</code>
-        </pre>
-
-        <li>We start the connection</li>
-        <pre class="prettyprint">
-           <code>connection.start();</code>
-        </pre>
-
-        <li>We create a JMS session. The session is created as non transacted and will auto acknowledge messages.</li>
-        <pre class="prettyprint">
-           <code>Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);</code>
-        </pre>
-
-        <li>We create a JMS message producer on the session. This will be used to send the messages.</li>
-        <pre class="prettyprint">
-          <code>MessageProducer producer = session.createProducer(queue);</code>
-       </pre>
-
-        <li>We create a JMS message consumer that receives 'red' messages. The message listener will
-            check the 'color' property on each received message.</li>
-         <pre class="prettyprint">
-           <code>
-         MessageConsumer redConsumer = session.createConsumer(queue);
-         redConsumer.setMessageListener(new SimpleMessageListener("red"));
-           </code>
-         </pre>
-
-        <li>We reate five messages with different 'color' properties.</li>
-        <pre class="prettyprint">
-          <code>
-         TextMessage redMessage1 = session.createTextMessage("Red-1");
-         redMessage1.setStringProperty("color", "red");
-         TextMessage redMessage2 = session.createTextMessage("Red-2");
-         redMessage2.setStringProperty("color", "red");
-         TextMessage greenMessage = session.createTextMessage("Green");
-         greenMessage.setStringProperty("color", "green");
-         TextMessage blueMessage = session.createTextMessage("Blue");
-         blueMessage.setStringProperty("color", "blue");
-         TextMessage normalMessage = session.createTextMessage("No color");
-         </code>
-        </pre>
-
-        <li>We send those messages.</li>
-        <pre class="prettyprint">
-          <code>
-         producer.send(redMessage1);
-         System.out.println("Message sent: " + redMessage1.getText());
-         producer.send(greenMessage);
-         System.out.println("Message sent: " + greenMessage.getText());
-         producer.send(blueMessage);
-         System.out.println("Message sent: " + blueMessage.getText());
-         producer.send(redMessage2);
-         System.out.println("Message sent: " + redMessage2.getText());
-         producer.send(normalMessage);
-         System.out.println("Message sent: " + normalMessage.getText());
-          </code>
-        </pre>
-
-        <li>Waiting for the message listener to check the received messages.</li>
-        <pre class="prettyprint">
-          <code>
-          Thread.sleep(5000);
-         </code>
-        </pre>
-        
-        <li>And finally, <b>always</b> remember to close your JMS connections and resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
 
-        <pre class="prettyprint">
-           <code>finally
-           {
-              if (initialContext != null)
-              {
-                initialContext.close();
-              }
-              if (connection != null)
-              {
-                 connection.close();
-              }
-           }</code>
-        </pre>
-     </ol>
   </body>
 </html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/stomp-websockets/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/stomp-websockets/pom.xml b/examples/jms/stomp-websockets/pom.xml
index 64c3ced..06fc747 100644
--- a/examples/jms/stomp-websockets/pom.xml
+++ b/examples/jms/stomp-websockets/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-stomp-websockets-example</artifactId>
+   <artifactId>stomp-websockets</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS StompWebSocketExample Example</name>
 
@@ -37,71 +38,81 @@ under the License.
 
    <dependencies>
       <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
       </dependency>
    </dependencies>
 
    <profiles>
       <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>create</id>
-                        <goals>
-                           <goal>create</goal>
-                        </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.StompWebSocketExample</clientClass>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>cli</goal>
-                        </goals>
-                        <configuration>
-                           <args>
-                              <param>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-stomp-websockets-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
+         <!-- specify -PnoServer if you don't want to start the server -->
+         <id>noServer</id>
+         <properties>
+            <noServer>true</noServer>
+         </properties>
       </profile>
    </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <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.StompWebSocketExample</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>stomp-websockets</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/stomp-websockets/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/stomp-websockets/readme.html b/examples/jms/stomp-websockets/readme.html
index 6bdef7f..56b2673 100644
--- a/examples/jms/stomp-websockets/readme.html
+++ b/examples/jms/stomp-websockets/readme.html
@@ -27,13 +27,16 @@ under the License.
   <body onload="prettyPrint()">
      <h1>Stomp WebSockets Example</h1>
 
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
+
+
      <p>This example shows you how to configure ActiveMQ Artemis to send and receive Stomp messages from modern web browser using Web Sockets.</p>
 
      <p>The example will start a ActiveMQ Artemis server configured with Stomp over Web Sockets and JMS. Web browsers clients and
        Java application will exchange message using a JMS Topic.</p></para>
      <pre class="prettyprint">
 &lt;acceptor name="stomp-websocket">tcp://localhost:61614&lt;/acceptor></pre>
-     
+
      <h2>Example step-by-step</h2>
 
      <p><i>To run the example, simply type <code>mvn verify -Pexample</code> from this directory</i></p>
@@ -44,7 +47,7 @@ under the License.
     </p>
     <p>You can open as many Web clients as you want and they will all exchange messages through the topic</p>
     <p>If you run again the Java application (with <code>./build.sh</code>), the web clients will also receive its message</p>
-    
+
     <h2>Documentation</h2>
     <p>A JavaScript library is used on the browser side to be able to use Stomp Over Web Sockets (please see its <a href="http://jmesnil.net/stomp-websocket/doc/">documentation</a>
       for a complete description).</p>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 efceecf..6a68013 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:./data}/bindings</bindings-directory>
+      <bindings-directory>./data/bindings</bindings-directory>
 
-      <journal-directory>${data.dir:./data}/journal</journal-directory>
+      <journal-directory>./data/journal</journal-directory>
 
-      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
+      <large-messages-directory>./data/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir:./data}/paging</paging-directory>
+      <paging-directory>./data/paging</paging-directory>
 
       <!-- Acceptors -->
       <acceptors>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/stomp/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/stomp/pom.xml b/examples/jms/stomp/pom.xml
index 867827d..eca6bee 100644
--- a/examples/jms/stomp/pom.xml
+++ b/examples/jms/stomp/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-stomp-example</artifactId>
+   <artifactId>stomp</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS Stomp Example</name>
 
@@ -37,71 +38,81 @@ under the License.
 
    <dependencies>
       <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
       </dependency>
    </dependencies>
 
    <profiles>
       <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>create</id>
-                        <goals>
-                           <goal>create</goal>
-                        </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.StompExample</clientClass>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>cli</goal>
-                        </goals>
-                        <configuration>
-                           <args>
-                              <param>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-stomp-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
+         <!-- specify -PnoServer if you don't want to start the server -->
+         <id>noServer</id>
+         <properties>
+            <noServer>true</noServer>
+         </properties>
       </profile>
    </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <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.StompExample</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>stomp</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>


[07/18] activemq-artemis git commit: ARTEMIS-180 removing -Pexample and some other improvements around the examples

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 8100fcc..bee7116 100644
--- a/examples/jms/queue-message-redistribution/pom.xml
+++ b/examples/jms/queue-message-redistribution/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-queue-message-redistribution-example</artifactId>
+   <artifactId>queue-message-redistribution</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS Queue Message Redistribution Example</name>
 
@@ -37,115 +38,127 @@ under the License.
 
    <dependencies>
       <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
       </dependency>
    </dependencies>
 
    <profiles>
       <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <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>create1</id>
-                        <goals>
-                           <goal>create</goal>
-                        </goals>
-                        <configuration>
-                           <instance>${basedir}/target/server1</instance>
-                           <configuration>${basedir}/target/classes/activemq/server1</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>
-                           <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>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-queue-message-redistribution-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
+         <!-- specify -PnoServer if you don't want to start the server -->
+         <id>noServer</id>
+         <properties>
+            <noServer>true</noServer>
+         </properties>
       </profile>
    </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create0</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <instance>${basedir}/target/server0</instance>
+                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create1</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <instance>${basedir}/target/server1</instance>
+                     <configuration>${basedir}/target/classes/activemq/server1</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start0</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <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>
+                     <ignore>${noServer}</ignore>
+                     <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>
+                     <ignore>${noServer}</ignore>
+                     <location>${basedir}/target/server0</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop1</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <location>${basedir}/target/server1</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>queue-message-redistribution</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/queue-message-redistribution/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/queue-message-redistribution/readme.html b/examples/jms/queue-message-redistribution/readme.html
index 386e046..b5c6cf6 100644
--- a/examples/jms/queue-message-redistribution/readme.html
+++ b/examples/jms/queue-message-redistribution/readme.html
@@ -27,6 +27,9 @@ under the License.
   <body onload="prettyPrint()">
      <h1>Message Redistribution Example</h1>
 
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
+
+
      <p>This example demonstrates message redistribution between queues with the same name deployed in different
      nodes of a cluster.</p>
      <p>As demontrated in the clustered queue example, if queues with the same name are deployed on different nodes of
@@ -41,7 +44,7 @@ under the License.
      <p>Setting <code>redistribution-delay</code> to <code>0</code> will cause redistribution to occur immediately
      once there are no more matching consumers on a particular queue instance. Setting it to a positive value > 0 specifies
      a delay in milliseconds before attempting to redistribute. The delay is useful in the case that another consumer is
-     likely to be created on the queue, to avoid unnecessary redistribution.</p>     
+     likely to be created on the queue, to avoid unnecessary redistribution.</p>
      <p>Here's the relevant snippet from the <code>activemq-queues.xml</code> configuration, which tells the server
      to use a redistribution delay of <code>0</code> on any jms queues, i.e. any queues whose name starts with
      <code>jms.</code></p>
@@ -51,194 +54,8 @@ under the License.
       &lt;redistribution-delay&gt;0&lt;/redistribution-delay&gt;
    &lt;/address-setting&gt;
    </code>
-     </pre>    
+     </pre>
      <p>For more information on ActiveMQ Artemis load balancing, and clustering in general, please see the clustering
-     section of the user manual.</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>
-     <ol>
-        <li>Get an initial context for looking up JNDI from server 0</li>
-        <pre class="prettyprint">
-           <code>
-   ic0 = getContext(0);
-   </code>
-        </pre>
-
-        <li>Look-up the JMS Queue object from JNDI</li>
-        <pre class="prettyprint">
-           <code>Queue queue = (Queue)ic0.lookup("/queue/exampleQueue");</code>
-        </pre>
-
-        <li>Look-up a JMS Connection Factory object from JNDI on server 0</li>
-        <pre class="prettyprint">
-           <code>ConnectionFactory cf0 = (ConnectionFactory)ic0.lookup("/ConnectionFactory");</code>
-        </pre>
-
-        <li>Get an initial context for looking up JNDI from server 1.</li>
-        <pre class="prettyprint">
-           <code>ic1 = getContext(1);</code>
-        </pre>
-
-        <li>Look-up a JMS Connection Factory object from JNDI on server 1</li>
-        <pre class="prettyprint">
-           <code>ConnectionFactory cf1 = (ConnectionFactory)ic1.lookup("/ConnectionFactory");
-           </code>
-        </pre>
-
-        <li>We create a JMS Connection connection0 which is a connection to server 0</li>
-        <pre class="prettyprint">
-          <code>
-   connection0 = cf0.createConnection();
-          </code>
-        </pre>
-        
-        <li>We create a JMS Connection connection1 which is a connection to server 1</li>
-        <pre class="prettyprint">
-          <code>
-   connection1 = cf1.createConnection();
-          </code>
-        </pre>
-
-        <li>We create a JMS Session on server 0, note the session is CLIENT_ACKNOWLEDGE</li>
-        <pre class="prettyprint">
-           <code>
-   Session session0 = connection0.createSession(false, Session.AUTO_ACKNOWLEDGE);
-           </code>
-        </pre>
-        
-        <li>We create a JMS Session on server 1, note the session is CLIENT_ACKNOWLEDGE</li>
-        <pre class="prettyprint">
-           <code>
-   Session session1 = connection1.createSession(false, Session.AUTO_ACKNOWLEDGE);
-            </code>
-        </pre>
-
-        <li>We start the connections to ensure delivery occurs on them</li>
-        <pre class="prettyprint">
-           <code>
-   connection0.start();
-
-   connection1.start();
-           </code>
-        </pre>
-
-        <li>We create JMS MessageConsumer objects on server 0 and server 1</li>
-        <pre class="prettyprint">
-           <code>
-   MessageConsumer consumer0 = session0.createConsumer(queue);
-
-   MessageConsumer consumer1 = session1.createConsumer(queue);
-           </code>
-        </pre>
-
-        <li>We create a JMS MessageProducer object on server 0.</li>
-        <pre class="prettyprint">
-           <code>
-   MessageProducer producer = session0.createProducer(queue);</code>
-        </pre>
-
-        <li>We send some messages to server 0.</li>
-        <pre class="prettyprint">
-           <code>
-	final int numMessages = 10;
-
-	for (int i = 0; i < numMessages; i++)
-	{
-	   TextMessage message = session0.createTextMessage("This is text message " + i);
-	      
-	   producer.send(message);
-	
-	   System.out.println("Sent message: " + message.getText());
-	}
-           </code>
-        </pre>
-        
-        <li>We now consume those messages on *both* server 0 and server 1.
-         We note the messages have been distributed between servers in a round robin fashion.
-         ActiveMQ Artemis has <b>load balanced</b> the messages between the available consumers on the different nodes.
-         ActiveMQ Artemis can be configured to always load balance messages to all nodes, or to only balance messages
-         to nodes which have consumers with no or matching selectors. See the user manual for more details.</li>
-         JMS Queues implement point-to-point message where each message is only ever consumed by a
-         maximum of one consumer.
-        <pre class="prettyprint">
-           <code>
-	for (int i = 0; i < numMessages; i += 2)
-	{
-	   TextMessage message0 = (TextMessage)consumer0.receive(5000);
-	
-	   System.out.println("Got message: " + message0.getText() + " from node 0");
-	
-	   TextMessage message1 = (TextMessage)consumer1.receive(5000);
-	
-	   System.out.println("Got message: " + message1.getText() + " from node 1");
-	}
-           </code>
-        </pre> 
-        
-        <li>We acknowledge the messages consumed on node 0. The sessions are CLIENT_ACKNOWLEDGE so
-         messages will not get acknowledged until they are explicitly acknowledged.
-         Note that we <b>do not</b> acknowledge the message consumed on node 1 yet.</li>
-        <pre class="prettyprint">
-           <code>
-           message0.acknowledge();
-           </code>
-        </pre>
-        
-        <li>We now close the session and consumer on node 1. (Closing the session automatically closes the consumer)
-        </li>
-        <pre class="prettyprint">
-           <code>session1.close();</code>
-        </pre>
-        
-        <li>Since there is no more consumer on node 1, the messages on node 1 are now stranded (no local consumers)
-        so ActiveMQ Artemis will redistribute them to node 0 so they can be consumed. We consume them from
-        node 0.</li>
-        <pre class="prettyprint">
-           <code>
-           for (int i = 0; i < numMessages; i += 2)
-         {
-            message0 = (TextMessage)consumer0.receive(5000);
-
-            System.out.println("Got message: " + message0.getText() + " from node 0");           
-         }
-           </code>
-        </pre> 
-        
-        <li>We ack the redistributed messages.</li>
-        <pre class="prettyprint">
-           <code>message0.acknowledge();</code>
-        </pre>
-           
-        
-        <li>And finally (no pun intended), <b>always</b> remember to close your resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
-
-        <pre class="prettyprint">
-           <code>
-	finally
-	{
-	      if (connection0 != null)
-         {
-            connection0.close();
-         }
-
-         if (connection1 != null)
-         {
-            connection1.close();
-         }
-
-         if (ic0 != null)
-         {
-            ic0.close();
-         }
-
-         if (ic1 != null)
-         {
-            ic1.close();
-         }
-	}
-           </code>
-        </pre>
-
-     </ol>
+     section of the user manual.</p>
   </body>
 </html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 aec56b1..f6cdb5e 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,6 +26,9 @@ import javax.jms.TextMessage;
 import javax.naming.InitialContext;
 import java.util.Hashtable;
 
+import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
+import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
+
 /**
  * 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.
@@ -40,33 +43,16 @@ public class QueueMessageRedistributionExample
 
       Connection connection1 = null;
 
-      InitialContext ic0 = null;
-
-      InitialContext ic1 = null;
-
       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", "tcp://localhost:61616");
-         properties.put("queue.queue/exampleQueue", "exampleQueue");
-         ic0 = new InitialContext(properties);
-
          // Step 2. Look-up the JMS Queue object from JNDI
-         Queue queue = (Queue)ic0.lookup("queue/exampleQueue");
+         Queue queue = ActiveMQJMSClient.createQueue("exampleQueue");
 
          // Step 3. Look-up a JMS Connection Factory object from JNDI on server 0
-         ConnectionFactory cf0 = (ConnectionFactory)ic0.lookup("ConnectionFactory");
-
-         // 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", "tcp://localhost:61617");
-         ic1 = new InitialContext(properties);
+         ConnectionFactory cf0 = new ActiveMQConnectionFactory("tcp://localhost:61616");
 
          // Step 5. Look-up a JMS Connection Factory object from JNDI on server 1
-         ConnectionFactory cf1 = (ConnectionFactory)ic1.lookup("ConnectionFactory");
+         ConnectionFactory cf1 = new ActiveMQConnectionFactory("tcp://localhost:61617");
 
          // Step 6. We create a JMS Connection connection0 which is a connection to server 0
          connection0 = cf0.createConnection();
@@ -164,16 +150,6 @@ public class QueueMessageRedistributionExample
          {
             connection1.close();
          }
-
-         if (ic0 != null)
-         {
-            ic0.close();
-         }
-
-         if (ic1 != null)
-         {
-            ic1.close();
-         }
       }
    }
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/queue-requestor/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/queue-requestor/pom.xml b/examples/jms/queue-requestor/pom.xml
index 2b8e16f..35c380e 100644
--- a/examples/jms/queue-requestor/pom.xml
+++ b/examples/jms/queue-requestor/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-queue-requestor-example</artifactId>
+   <artifactId>queue-requestor</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS Queue Requestor Example</name>
 
@@ -37,71 +38,76 @@ under the License.
 
    <dependencies>
       <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
       </dependency>
    </dependencies>
 
    <profiles>
       <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>create</id>
-                        <goals>
-                           <goal>create</goal>
-                        </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.QueueRequestorExample</clientClass>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>cli</goal>
-                        </goals>
-                        <configuration>
-                           <args>
-                              <param>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-queue-requestor-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
+         <!-- specify -PnoServer if you don't want to start the server -->
+         <id>noServer</id>
+         <properties>
+            <noServer>true</noServer>
+         </properties>
       </profile>
    </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create</id>
+                  <goals>
+                     <goal>create</goal>
+                  </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.QueueRequestorExample</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>queue-requestor</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/queue-requestor/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/queue-requestor/readme.html b/examples/jms/queue-requestor/readme.html
index 416406a..af11c9c 100644
--- a/examples/jms/queue-requestor/readme.html
+++ b/examples/jms/queue-requestor/readme.html
@@ -27,6 +27,9 @@ under the License.
   <body onload="prettyPrint()">
      <h1>JMS QueueRequestor Example</h1>
 
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
+
+
      <p>This example shows you how to use a <a href="http://java.sun.com/javaee/5/docs/api/javax/jms/QueueRequestor.html">QueueRequestor</a> with ActiveMQ Artemis.</p>
      <p>JMS is mainly used to send messages asynchronously so that the producer of a message is not waiting for the result of the message consumption.
         However, there are cases where it is necessary to have a synchronous behavior: the code sending a message requires a reply for this message
@@ -39,101 +42,5 @@ under the License.
          <dt><code>QueueRequestorExample</code></dt>
          <dd>A JMS Client which uses a QueueRequestor to send text requests to a queue and receive replies with the reversed text in a synchronous fashion</dd>
     </dl>
-
-         
-     <h2>Example step-by-step</h2>
-     <p><i>To run the example, simply type <code>mvn verify -Pexample</code> from this directory</i></p>
-
-     <ol>
-        <li>First we need to get an initial context so we can look-up the JMS connection factory from JNDI. This initial context will get it's properties from the <code>client-jndi.properties</code> file in the directory <code>../common/config</code></li>
-        <pre class="prettyprint">
-           <code>InitialContext initialContext = getContext();</code>
-        </pre>
-
-        <li>We look up the JMS queue from JNDI</li>
-        <pre class="prettyprint">
-           <code>Queue queue = (Queue)initialContext.lookup("/queue/exampleQueue");</code>
-        </pre>
-
-        <li>We look up JMS queue connection factory from JNDI</li>
-        <pre class="prettyprint">
-           <code>QueueConnectionFactory cf = (QueueConnectionFactory)initialContext.lookup("/ConnectionFactory");</code>
-        </pre>
-
-        <li>We create the TextReverserService which will consume messages from the queue</li>
-        <pre class="prettyprint">
-           <code> TextReverserService reverserService = new TextReverserService(cf, queue);</code>
-        </pre>
-        
-        <li>We Create a JMS queue connection</li>
-        <pre class="prettyprint">
-           <code>connection = cf.createQueueConnection();</code>
-        </pre>
-         
-        <li>We start the connection. In order for delivery to occur on any consumers or subscribers on a connection, the connection must be started</li>
-        <pre class="prettyprint">
-           <code>connection.start();</code>
-        </pre>
-         
-        <li>We create a JMS queue session. The session is created as non transacted and will auto acknowledge messages (this is mandatory to use it to create a QueueRequestor)</li>
-        <pre class="prettyprint">
-           <code>QueueSession session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);</code>
-        </pre>
-        
-        <li>We create a JMS QueueRequestor using the session and the queue</li>
-        <pre class="prettyprint">
-           <code>QueueRequestor queueRequestor = new QueueRequestor(session, queue);</code>
-        </pre>
-
-        <li>We create a JMS text message to send as a request</li>
-        <pre class="prettyprint">
-           <code>TextMessage request = session.createTextMessage("Hello, World!");</code>
-        </pre>
-   
-        <li><p>We use the queue requestor to send the request and block until a reply is received.<br />
-            Using the queue requestor simplify request/reply use case by abstracting boilerplate JMS code
-            (creating a temporary queue, a consumer and a producer, setting the JMS ReplyTo header on the request, 
-            sending the request with the producer, consuming the message from the consumer).
-            All this code is replaced by a single call to <code>QueueRequestor.request()</code> method.</p>
-            </li>
-        <pre class="prettyprint">
-           <code>TextMessage reply = (TextMessage)queueRequestor.request(request);</code>
-        </pre>
-
-        <li>The reply's text contains the reverse of the request's text</li>
-        <pre class="prettyprint">
-           <code>System.out.println("Send request: " + request.getText());
-           System.out.println("Received reply:" + reply.getText());</code>
-        </pre>
-
-        <li>We close the queue requestor to release all the JMS resources it created to provide request/reply mechanism</li>
-        <pre class="prettyprint">
-           <code>queueRequestor.close()</code>
-        </pre>
-
-        <li>We do the same for the text reverser service</li>
-        <pre class="prettyprint">
-           <code>reverserService.close()</code>
-        </pre>
-
-        <li>And finally, <b>always</b> remember to close your JMS connections and resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
-
-        <pre class="prettyprint">
-           <code>finally
-           {
-              if (initialContext != null)
-              {
-                initialContext.close();
-              }
-              if (connection != null)
-              {
-                 connection.close();
-              }
-           }</code>
-        </pre>
-
-
-         
-     </ol>
   </body>
 </html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/queue-selector/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/queue-selector/pom.xml b/examples/jms/queue-selector/pom.xml
index 7f179f6..dca3246 100644
--- a/examples/jms/queue-selector/pom.xml
+++ b/examples/jms/queue-selector/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-queue-selector-example</artifactId>
+   <artifactId>queue-selector</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS Queue Selector Example</name>
 
@@ -37,71 +38,81 @@ under the License.
 
    <dependencies>
       <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
       </dependency>
    </dependencies>
 
    <profiles>
       <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>create</id>
-                        <goals>
-                           <goal>create</goal>
-                        </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.QueueSelectorExample</clientClass>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>cli</goal>
-                        </goals>
-                        <configuration>
-                           <args>
-                              <param>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-queue-selector-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
+         <!-- specify -PnoServer if you don't want to start the server -->
+         <id>noServer</id>
+         <properties>
+            <noServer>true</noServer>
+         </properties>
       </profile>
    </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <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.QueueSelectorExample</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>queue-selector</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/queue-selector/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/queue-selector/readme.html b/examples/jms/queue-selector/readme.html
index 4af57ba..edb3f7b 100644
--- a/examples/jms/queue-selector/readme.html
+++ b/examples/jms/queue-selector/readme.html
@@ -27,139 +27,26 @@ under the License.
   <body onload="prettyPrint()">
      <h1>JMS Queue Selector Example</h1>
 
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
+
      <p>This example shows you how to selectively consume messages using message selectors with queue consumers.</p>
-     
+
      <p>Message selectors are strings with special syntax that can be used in creating consumers. Message consumers
      created with a message selector will only receive messages that match its selector. On message delivery, the JBoss Message
      Server evaluates the corresponding message headers of the messages against each selector, if any, and then delivers
      the 'matched' messages to its consumer. Please consult the JMS 1.1 specification for full details.</p>
-     
+
      <p>In this example, three message consumers are created on a queue. The first consumer is created with selector
      <code>'color=red'</code>, it only receives messages that
-     have a 'color' string property of 'red' value; the second is created with selector <code>'color=green'</code>, it 
-     only receives messages who have a 'color' string property of 
+     have a 'color' string property of 'red' value; the second is created with selector <code>'color=green'</code>, it
+     only receives messages who have a 'color' string property of
      'green' value; and the third without a selector, which means it receives all messages. To illustrate, three messages
      with different 'color' property values are created and sent.</p>
 
      <p>Selectors can be used with both queue consumers and topic consumers. The difference is that with queue consumers,
      a message is only delivered to one consumer on the queue, while topic consumers the message will be delivered to every
-     matching consumers. In this example, if the third consumer (anyConsumer) were the first consumer created, it will 
+     matching consumers. In this example, if the third consumer (anyConsumer) were the first consumer created, it will
      consume the first message delivered, therefore there is no chance for the next consumer to get the message, even if it
      matches the selector.</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>
-
-     <ol>
-        <li>First we need to get an initial context so we can look-up the JMS connection factory and destination objects from JNDI. This initial context will get it's properties from the <code>client-jndi.properties</code> file in the directory <code>../common/config</code></li>
-        <pre class="prettyprint">
-           <code>InitialContext initialContext = getContext();</code>
-        </pre>
-
-        <li>We look-up the JMS queue object from JNDI</li>
-        <pre class="prettyprint">
-           <code>Queue queue = (Queue) initialContext.lookup("/queue/exampleQueue");</code>
-        </pre>
-
-        <li>We look-up the JMS connection factory object from JNDI</li>
-        <pre class="prettyprint">
-           <code>ConnectionFactory cf = (ConnectionFactory) initialContext.lookup("/ConnectionFactory");</code>
-        </pre>
-
-        <li>We create a JMS connection</li>
-        <pre class="prettyprint">
-           <code>connection = cf.createConnection();</code>
-        </pre>
-
-        <li>We start the connection</li>
-        <pre class="prettyprint">
-           <code>connection.start();</code>
-        </pre>
-
-        <li>We create a JMS session. The session is created as non transacted and will auto acknowledge messages.</li>
-        <pre class="prettyprint">
-           <code>Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);</code>
-        </pre>
-
-        <li>We create a JMS message producer on the session. This will be used to send the messages.</li>
-        <pre class="prettyprint">
-          <code>MessageProducer messageProducer = session.createProducer(queue);</code>
-       </pre>
-
-        <li>We create two selectors.</li>
-         <pre class="prettyprint">
-           <code>
-           String redSelector = "color='red'";
-           String greenSelector = "color='green'";
-           </code>
-         </pre>
-
-        <li>We Create a JMS Message Consumer that receives 'red' messages.</li>
-        <pre class="prettyprint">
-          <code>
-          MessageConsumer redConsumer = session.createConsumer(queue, redSelector);
-          redConsumer.setMessageListener(new SimpleMessageListener("red"));
-         </code>
-        </pre>
-
-        <li>We Create a second JMS Message Consumer that receives 'green' messages.</li>
-        <pre class="prettyprint">
-          <code>
-          MessageConsumer greenConsumer = session.createConsumer(queue, greenSelector);
-          greenConsumer.setMessageListener(new SimpleMessageListener("green"));
-         </code>
-        </pre>
-
-        <li>We Create another JMS Message Consumer that receives all messages. Please not that the order
-        of consumers on a queue is of significance. If the anyConsumer is created before the above two, the 
-        result will be totally different.</li>
-        <pre class="prettyprint">
-          <code>
-          MessageConsumer anyConsumer = session.createConsumer(queue);
-          anyConsumer.setMessageListener(new SimpleMessageListener("any"));
-         </code>
-        </pre>
-
-        <li>We Create three messages, each has a different color property.</li>
-        <pre class="prettyprint">
-           <code>
-           TextMessage redMessage = session.createTextMessage("Red");
-           redMessage.setStringProperty("color", "red");
-           TextMessage greenMessage = session.createTextMessage("Green");
-           greenMessage.setStringProperty("color", "green");
-           TextMessage blueMessage = session.createTextMessage("Blue");
-           blueMessage.setStringProperty("color", "blue");
-           </code>
-        </pre>
-
-        <li>We send the messages to the topic</li>
-        <pre class="prettyprint">
-           <code>
-           producer.send(redMessage);
-           System.out.println("Message sent: " + redMessage.getText());
-           producer.send(greenMessage);
-           System.out.println("Message sent: " + greenMessage.getText());
-           producer.send(blueMessage);
-           System.out.println("Message sent: " + blueMessage.getText());
-           </code>
-        </pre>
-        
-        <li>And finally, <b>always</b> remember to close your JMS connections and resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
-
-        <pre class="prettyprint">
-           <code>finally
-           {
-              if (initialContext != null)
-              {
-                initialContext.close();
-              }
-              if (connection != null)
-              {
-                 connection.close();
-              }
-           }</code>
-        </pre>
-     </ol>
   </body>
 </html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/queue/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/queue/pom.xml b/examples/jms/queue/pom.xml
index fecaaf7..ba5e182 100644
--- a/examples/jms/queue/pom.xml
+++ b/examples/jms/queue/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-queue-example</artifactId>
+   <artifactId>queue</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS Queue Example</name>
 
@@ -37,71 +38,81 @@ under the License.
 
    <dependencies>
       <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
       </dependency>
    </dependencies>
 
    <profiles>
       <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>create</id>
-                        <goals>
-                           <goal>create</goal>
-                        </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.QueueExample</clientClass>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>cli</goal>
-                        </goals>
-                        <configuration>
-                           <args>
-                              <param>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-queue-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
+         <!-- specify -PnoServer if you don't want to start the server -->
+         <id>noServer</id>
+         <properties>
+            <noServer>true</noServer>
+         </properties>
       </profile>
    </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <spawn>true</spawn>
+                     <ignore>${noServer}</ignore>
+                     <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.QueueExample</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>queue</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/queue/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/queue/readme.html b/examples/jms/queue/readme.html
index a80d973..71d4a9b 100644
--- a/examples/jms/queue/readme.html
+++ b/examples/jms/queue/readme.html
@@ -27,88 +27,12 @@ under the License.
   <body onload="prettyPrint()">
      <h1>JMS Queue Example</h1>
 
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
+
+
      <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>
-
-     <ol>
-        <li>First we need to get an initial context so we can look-up the JMS connection factory and destination objects from JNDI. This initial context will get it's properties from the <code>client-jndi.properties</code> file in the directory <code>../common/config</code></li>
-        <pre class="prettyprint">
-           <code>InitialContext initialContext = getContext();</code>
-        </pre>
-
-        <li>We look-up the JMS queue object from JNDI</li>
-        <pre class="prettyprint">
-           <code>Queue queue = (Queue) initialContext.lookup("/queue/exampleQueue");</code>
-        </pre>
-
-        <li>We look-up the JMS connection factory object from JNDI</li>
-        <pre class="prettyprint">
-           <code>ConnectionFactory cf = (ConnectionFactory) initialContext.lookup("/ConnectionFactory");</code>
-        </pre>
-
-        <li>We create a JMS connection</li>
-        <pre class="prettyprint">
-           <code>connection = cf.createConnection();</code>
-        </pre>
-
-        <li>We create a JMS session. The session is created as non transacted and will auto acknowledge messages.</li>
-        <pre class="prettyprint">
-           <code>Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);</code>
-        </pre>
-
-        <li>We create a JMS message producer on the session. This will be used to send the messages.</li>
-        <pre class="prettyprint">
-          <code>MessageProducer messageProducer = session.createProducer(topic);</code>
-       </pre>
-
-        <li>We create a JMS text message that we are going to send.</li>
-        <pre class="prettyprint">
-           <code>TextMessage message = session.createTextMessage("This is a text message");</code>
-        </pre>
-
-        <li>We send message to the queue</li>
-        <pre class="prettyprint">
-           <code>messageProducer.send(message);</code>
-        </pre>
-
-        <li>We create a JMS Message Consumer to receive the message.</li>
-          <pre class="prettyprint">
-           <code>MessageConsumer messageConsumer = session.createConsumer(queue);</code>
-        </pre>
-
-        <li>We start the connection. In order for delivery to occur on any consumers or subscribers on a connection, the connection must be started</li>
-        <pre class="prettyprint">
-           <code>connection.start();</code>
-        </pre>
-
-        <li>The message arrives at the consumer. In this case we use a timeout of 5000 milliseconds but we could use a blocking 'receive()'</li>
-        <pre class="prettyprint">
-           <code>TextMessage messageReceived = (TextMessage) messageConsumer.receive(5000);</code>
-        </pre>
-
-        <li>And finally, <b>always</b> remember to close your JMS connections and resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
-
-        <pre class="prettyprint">
-           <code>finally
-           {
-              if (initialContext != null)
-              {
-                initialContext.close();
-              }
-              if (connection != null)
-              {
-                 connection.close();
-              }
-           }</code>
-        </pre>
-
-
-
-     </ol>
   </body>
 </html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/reattach-node/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/reattach-node/pom.xml b/examples/jms/reattach-node/pom.xml
index 885adcf..cb0d5d3 100644
--- a/examples/jms/reattach-node/pom.xml
+++ b/examples/jms/reattach-node/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-reattach-node-example</artifactId>
+   <artifactId>reattach-node</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS Reattach Node Example</name>
 
@@ -41,76 +42,79 @@ under the License.
          <artifactId>artemis-jms-client</artifactId>
          <version>${project.version}</version>
       </dependency>
-      <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
-      </dependency>
    </dependencies>
 
    <profiles>
       <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <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>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>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-reattach-node-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
+         <!-- specify -PnoServer if you don't want to start the server -->
+         <id>noServer</id>
+         <properties>
+            <noServer>true</noServer>
+         </properties>
       </profile>
    </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <instance>${basedir}/target/server0</instance>
+                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <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>
+                     <ignore>${noServer}</ignore>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>reattach-node</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/reattach-node/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/reattach-node/readme.html b/examples/jms/reattach-node/readme.html
index 36fbfa2..3ed6a4a 100644
--- a/examples/jms/reattach-node/readme.html
+++ b/examples/jms/reattach-node/readme.html
@@ -27,6 +27,9 @@ under the License.
   <body onload="prettyPrint()">
      <h1>JMS Reattach Example</h1>
 
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
+
+
      <p>This example demonstrates how ActiveMQ Artemis connections can be configured to be resilient to
      temporary network failures.</p>
      <p>In the case of a network failure being detected, either as a result of a failure to read/write to the connection,
@@ -48,104 +51,5 @@ under the License.
 
      <p>For more details on how to configure this and for clustering in general
      please consult the ActiveMQ Artemis user manual.</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>
-
-     <ol>
-        <li>Create an initial context to perform the JNDI lookup.</li>
-        <pre class="prettyprint">
-           <code>initialContext = getContext(0);</code>
-        </pre>
-
-        <li>Perform a lookup on the queue</li>
-        <pre class="prettyprint">
-           <code>Queue queue = (Queue) initialContext.lookup("/queue/exampleQueue");</code>
-        </pre>
-
-        <li>Perform a lookup on the Connection Factory</li>
-        <pre class="prettyprint">
-           <code>ConnectionFactory cf = (ConnectionFactory)initialContext.lookup("/ConnectionFactory");</code>
-        </pre>
-
-        <li>We create a JMS connection</li>
-        <pre class="prettyprint">
-           <code>connection = cf.createConnection();</code>
-        </pre>
-
-        <li>We create a JMS session. </li>
-        <pre class="prettyprint">
-           <code>Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);</code>
-        </pre>
-
-        <li>We create a JMS message producer.</li>
-        <pre class="prettyprint">
-          <code>MessageProducer messageProducer = session.createProducer(topic);</code>
-       </pre>
-
-        <li>We create a JMS text message that we are going to send.</li>
-        <pre class="prettyprint">
-           <code>TextMessage message = session.createTextMessage("This is a text message");</code>
-        </pre>
-
-        <li>We send message to the queue</li>
-        <pre class="prettyprint">
-           <code>messageProducer.send(message);</code>
-        </pre>
-
-        <li>We create a JMS Message Consumer to receive the message.</li>
-          <pre class="prettyprint">
-           <code>MessageConsumer messageConsumer = session.createConsumer(queue);</code>
-        </pre>
-
-        <li>We start the connection. In order for delivery to occur on any consumers or subscribers on a connection, the connection must be started</li>
-        <pre class="prettyprint">
-           <code>connection.start();</code>
-        </pre>
-
-        <li>To simulate a temporary problem on the network, we stop the remoting acceptor on the
-         server which will cause all client connections to fail.</li>
-        <pre class="prettyprint">
-           <code>stopAcceptor(initialContext);</code>
-        </pre>
-
-        <li>We wait 10 seconds, before restarting the acceptor. During this period the client will be retrying
-        to connect. When the acceptor is restarted it will be successful in reconnecting.</li>
-
-        <pre class="prettyprint">
-           <code>
-            Thread.sleep(10000);
-
-            startAcceptor(initialContext);
-           </code>
-        </pre>
-
-        <li>We receive the message after reattachment! Note that no exceptions were received by the client.</li>
-
-        <pre class="prettyprint">
-           <code>
-           TextMessage messageReceived = (TextMessage)messageConsumer.receive(5000);
-           </code>
-        </pre>
-
-        <li>And finally, <b>always</b> remember to close your JMS connections and resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
-
-        <pre class="prettyprint">
-           <code>finally
-           {
-              if (initialContext != null)
-              {
-                initialContext.close();
-              }
-              if (connection != null)
-              {
-                 connection.close();
-              }
-           }</code>
-        </pre>
-
-
-
-     </ol>
   </body>
 </html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 2b05090..3a47fca 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
@@ -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;
@@ -30,6 +28,7 @@ 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.jms.client.ActiveMQConnectionFactory;
 
 /**
  * This examples demonstrates a connection created to a server. Failure of the network connection is then simulated
@@ -127,11 +126,7 @@ public class ReattachExample
    // when the main connection has been stopped
    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");
-      properties.put("connectionFactory.ConnectionFactory", "tcp://localhost:61617");
-      InitialContext initialContext = new InitialContext(properties);
-      ConnectionFactory cf = (ConnectionFactory)initialContext.lookup("ConnectionFactory");
+      ConnectionFactory cf = new ActiveMQConnectionFactory("tcp://localhost:61617");
 
       Connection connection = null;
       try

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 20321a2..07e09bb 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:./data}/bindings</bindings-directory>
+      <bindings-directory>./data/bindings</bindings-directory>
 
-      <journal-directory>${data.dir:./data}/journal</journal-directory>
+      <journal-directory>./data/journal</journal-directory>
 
-      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
+      <large-messages-directory>./data/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir:./data}/paging</paging-directory>
+      <paging-directory>./data/paging</paging-directory>
 
       <!-- Connectors -->
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 2cd5072..a19dec5 100644
--- a/examples/jms/replicated-failback-static/pom.xml
+++ b/examples/jms/replicated-failback-static/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-replicated-failback-static-example</artifactId>
+   <artifactId>replicated-failback-static</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS Replicated Failback Static Example</name>
 
@@ -42,66 +43,62 @@ under the License.
          <version>${project.version}</version>
       </dependency>
       <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
       </dependency>
    </dependencies>
 
-   <profiles>
-      <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <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>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <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>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>runClient</id>
-                        <goals>
-                           <goal>runClient</goal>
-                        </goals>
-                        <configuration>
-                           <clientClass>org.apache.activemq.artemis.jms.example.ReplicatedFailbackStaticExample</clientClass>
-                           <args>
-                              <param>${basedir}/target/server0</param>
-                              <param>${basedir}/target/server1</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-replicated-failback-static-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
-      </profile>
-   </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <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>
+                  </configuration>
+               </execution>
+               <execution>
+                  <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>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>runClient</id>
+                  <goals>
+                     <goal>runClient</goal>
+                  </goals>
+                  <configuration>
+                     <clientClass>org.apache.activemq.artemis.jms.example.ReplicatedFailbackStaticExample</clientClass>
+                     <args>
+                        <param>${basedir}/target/server0</param>
+                        <param>${basedir}/target/server1</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>replicated-failback-static</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/replicated-failback-static/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/replicated-failback-static/readme.html b/examples/jms/replicated-failback-static/readme.html
index 1dfb8b6..a3cf681 100644
--- a/examples/jms/replicated-failback-static/readme.html
+++ b/examples/jms/replicated-failback-static/readme.html
@@ -26,145 +26,13 @@ under the License.
   </head>
   <body onload="prettyPrint()">
      <h1>JMS Multiple Failover using Replication Example</h1>
-     
+
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory.</pre>
+
      <p>This example demonstrates three servers coupled as a live-backup-backup group for high availability (HA) using replication, and a client
      connection failing over from live to backup when the live server is crashed and then to the second backup once the new live fails.</p>
 
      <p>For more information on ActiveMQ Artemis failover and HA, and clustering in general, please see the clustering
      section of the user manual.</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>
-     <p>In this example, the live server is server 1, and the backup server is server 0</p>
-     <p>The connection will initially be created to server1, server 1 will crash, and the client will carry on
-     seamlessly on server 0, the backup server.</p>
-
-     <ol>
-        <li>Get an initial context for looking up JNDI from server #0.</li>
-        <pre class="prettyprint">
-           initialContext = getContext(0);
-        </pre>
-
-        <li>Look up the JMS resources from JNDI on server #0.</li>
-        <pre class="prettyprint">
-           Queue queue = (Queue)initialContext.lookup("/queue/exampleQueue");
-           ConnectionFactory connectionFactory = (ConnectionFactory)initialContext.lookup("/ConnectionFactory");
-        </pre>
-
-        <li>Create a JMS Connection</li>
-        <pre class="prettyprint">
-           connection = connectionFactory.createConnection();
-        </pre>
-        
-        <li>Create a client acknowledged Session</li>
-        <pre class="prettyprint">
-           Session session = connection.createSession(false, Session.CLIENT_ACKNOWLEDGE);
-        </pre>
-        
-        <li>Start the connection to ensure delivery occurs</li>
-        <pre class="prettyprint">
-           connection.start();
-        </pre>
-
-        <li>Create a JMS MessageProducer</li>
-        <pre class="prettyprint">
-           MessageProducer producer = session.createProducer(queue);
-        </pre>
-
-        <li>Create a JMS MessageConsumer</li>
-        <pre class="prettyprint">
-           MessageConsumer consumer = session.createConsumer(queue);
-        </pre>
-
-        <li>Send some messages to server #0, the live server</li>
-        <pre class="prettyprint">
-           for (int i = 0; i < numMessages; i++)
-            {
-                TextMessage message = session.createTextMessage("This is text message " + i);
-                producer.send(message);
-                System.out.println("Sent message: " + message.getText());
-            }
-        </pre>
-
-        <li>Receive and acknowledge a third of the sent messages</li>
-        <pre class="prettyprint">
-           TextMessage message0 = null;
-            for (int i = 0; i < numMessages / 3; i++)
-            {
-               message0 = (TextMessage)consumer.receive(5000);
-               System.out.println("Got message: " + message0.getText());
-            }
-            message0.acknowledge();
-        </pre>
-
-        <p>When server #0 crashes, the client automatically detects the failure and automatically
-            fails over from server #0 to server #1 (in your real program you wouldn't need to sleep).
-        </p>
-        
-        <li>Acknowledging the 2nd third of the sent messages will fail as failover to the backup server has occurred</li>
-        <pre class="prettyprint">
-           try
-             {
-               message0.acknowledge();
-            }
-             catch (JMSException e)
-            {
-               System.err.println("Got exception while acknowledging message: " + e.getMessage());
-            }
-        </pre>
-        
-        <li>Consume again the 2nd third of the messages again. Note that they are not considered as redelivered.</li>
-        <pre class="prettyprint">
-           for (int i = numMessages / 3; i < (numMessages / 3) * 2; i++)
-            {
-              message0 = (TextMessage)consumer.receive(5000);
-             System.out.printf("Got message: %s (redelivered?: %s)\n", message0.getText(), message0.getJMSRedelivered());
-             }
-         message0.acknowledge();
-        </pre>
-
-         <p>now we Kill server #1 and wait for the server #2 to take over the responsibilities.</p>
-
-        <li>Acknowledging the 3rd third of the sent messages will fail as failover to the backup server has occurred</li>
-        <pre class="prettyprint">
-           try
-            {
-               message0.acknowledge();
-           }
-           catch (JMSException e)
-          {
-                System.err.println("Got exception while acknowledging message: " + e.getMessage());
-             }
-        </pre>
-        
-
-        <li>Consume again the 3rd third of the messages again. Note that they are not considered as redelivered</li>
-        <pre class="prettyprint">
-            for (int i = (numMessages / 3) * 2; i < numMessages; i++)
-             {
-               message0 = (TextMessage)consumer.receive(5000);
-               System.out.printf("Got message: %s (redelivered?: %s)\n", message0.getText(), message0.getJMSRedelivered());
-            }
-             message0.acknowledge();
-        </pre>
-        
-        <li>And finally, <strong>always</strong> remember to close your resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
-
-        <pre class="prettyprint">
-           finally
-           {
-              if (connection != null)
-              {
-                 connection.close();
-              }
-
-              if (initialContext != null)
-              {
-                 initialContext.close();
-              }
-           }
-        </pre>
-
-     </ol>
   </body>
 </html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 f59bdbc..f6fa349 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:./data}/bindings</bindings-directory>
+      <bindings-directory>./data/bindings</bindings-directory>
 
-      <journal-directory>${data.dir:./data}/journal</journal-directory>
+      <journal-directory>./data/journal</journal-directory>
 
-      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
+      <large-messages-directory>./data/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir:./data}/paging</paging-directory>
+      <paging-directory>./data/paging</paging-directory>
 
       <cluster-user>exampleUser</cluster-user>
 


[11/18] activemq-artemis git commit: ARTEMIS-180 removing -Pexample and some other improvements around the examples

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/expiry/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/expiry/readme.html b/examples/jms/expiry/readme.html
index acbbe4b..65cb534 100644
--- a/examples/jms/expiry/readme.html
+++ b/examples/jms/expiry/readme.html
@@ -26,6 +26,7 @@ under the License.
   </head>
   <body onload="prettyPrint()">
      <h1>JMS Expiration Example</h1>
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
 
      <p>This example shows you how to configure ActiveMQ Artemis so messages are expipired after a certain time.</p>
      <p>Messages can be retained in the messaging system for a limited period of time before being removed.
@@ -44,7 +45,7 @@ under the License.
             &lt;expiry-address&gt;jms.queue.expiryQueue&lt;/expiry-address&gt;
          &lt;/address-setting&gt;
          </code>
-     </pre>          
+     </pre>
      <p>This configuration will moved expired messages from the <code>exampleQueue</code> to the <code>expiryQueue</code></p>
      <p>ActiveMQ Artemis allows to specify either a <code>Queue</code> by prefixing the <code>expiry-address</code> with <code>jms.queue.</code>
          or a <code>Topic</code> by prefixing with <code>jms.topic.</code>.<br />
@@ -56,151 +57,5 @@ under the License.
             &lt;entry name="/queue/expiryQueue"/&gt;
          &lt;/queue&gt;</code>
      </pre>
-     </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>
-     <ol>
-        <li>First we need to get an initial context so we can look-up the JMS connection factory and destination objects from JNDI. This initial context will get it's properties from the <code>client-jndi.properties</code> file in the directory <code>../common/config</code></li>
-        <pre class="prettyprint">
-           <code>InitialContext initialContext = getContext();</code>
-        </pre>
-
-        <li>We look up the JMS queue object from JNDI</li>
-        <pre class="prettyprint">
-           <code>Queue queue = (Queue) initialContext.lookup("/queue/exampleQueue");</code>
-        </pre>
-
-        <li>We look up the JMS connection factory object from JNDI</li>
-        <pre class="prettyprint">
-           <code>ConnectionFactory cf = (ConnectionFactory) initialContext.lookup("/ConnectionFactory");</code>
-        </pre>
-
-        <li>We create a JMS connection</li>
-        <pre class="prettyprint">
-           <code>connection = cf.createConnection();</code>
-        </pre>
-
-        <li>We create a JMS session. The session is created as non transacted and will auto acknowledge messages</li>
-        <pre class="prettyprint">
-           <code>Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);</code>
-        </pre>
-
-        <li>We create a JMS message producer on the session. This will be used to send the messages</li>
-        <pre class="prettyprint">
-          <code>MessageProducer messageProducer = session.createProducer(topic);</code>
-       </pre>
-       
-       <li>Messages sent by this producer will be retained for 1s (1000ms) before expiration</li>
-       <pre class="prettyprint">
-           <code>producer.setTimeToLive(1000);</code>
-       </pre>
-
-        <li>We create a text messages</li>
-        <pre class="prettyprint">
-            <code>TextMessage message = session.createTextMessage("this is a text message");</code>
-        </pre>
-
-        <li>We send the message to the queue</li>
-        <pre class="prettyprint">
-            <code>producer.send(message);</code>
-        </pre>
-        
-       <li>We sleep a little bit to let the message expire</li>
-        <pre class="prettyprint">
-            <code>Thread.sleep(5000);</code>
-        </pre>
-
-        <p>We will now try to consume the message from the queue but it won't be there since it has expired</p>
-
-        <li>We create a JMS message consumer on the queue</li>
-        <pre class="prettyprint">
-            <code>MessageConsumer messageConsumer = session.createConsumer(queue);</code>
-        </pre>
-        
-        <li>We start the connection. In order for delivery to occur on any consumers or subscribers on a connection, the connection must be started</li>
-        <pre class="prettyprint">
-           <code>connection.start();</code>
-        </pre>
-
-        <li>We try to receive a message from the queue. Since there is none, the call will timeout after 5000ms and <code>messageReceived</code> will be <code>null</code>
-        <pre class="prettyprint">
-           <code>TextMessage messageReceived = (TextMessage) messageConsumer.receive(5000);
-           System.out.println("Received message from " + queue.getQueueName() + ": " + messageReceived);</code>
-        </pre>
-        
-        <p>However, we have configured ActiveMQ Artemis to send any expired messages to the <code>expiryQueue</code>.
-            We will now consume messages from this expiry queue and receives the <em>expired</em> message.</p>
-            
-        <li>We look up the JMS <em>expiry queue</em> object from JNDI</li>
-        <pre class="prettyprint">
-           <code>Queue expiryQueue = (Queue)initialContext.lookup("/queue/expiryQueue");</code>
-        </pre>
-                  
-        <li>We create a JMS message consumer on the expiry queue</li>
-        <pre class="prettyprint">
-            <code>MessageConsumer expiryConsumer = session.createConsumer(expiryQueue);</code>
-        </pre>
-        
-        <li>We consume a message from the expiry queue:</li>
-        <pre class="prettyprint">
-            <code>messageReceived = (TextMessage)expiryConsumer.receive(5000);</code>
-        </pre>
-        
-        <li>The message consumed from the <em>expiry queue</em> has the <em>same content</em> than the message which was sent to the <em>queue</em>
-        <pre class="prettyprint">
-            <code>System.out.println("Received message from " + expiryQueue.getQueueName() + ": " + messageReceived.getText());</code>
-        </pre>    
-            
-        <p>JMS does not specify the notion of expiry queue. From JMS point of view, the message received from the expiry queue
-            is a <strong>different</strong> message than the message expired from the queue: the two messages have the same content (properties and body) but
-            their JMS headers differ.<br />
-            ActiveMQ Artemis defines additional properties to correlate the message received from the expiry queue with the 
-            message expired from the queue</p>
-            
-        <li>The expired message's destination is the expiry queue</li>
-        <pre class="prettyprint">
-            <code>System.out.println("Destination of the expired message: " + ((Queue)messageReceived.getJMSDestination()).getQueueName());</code>
-        </pre>
-
-        <li>The expired message has its own <em>expiration time</em> (its time to live in the <strong>expiry queue</strong>)</li>
-        <pre class="prettyprint">
-            <code>System.out.println("Expiration time of the expired message (relative to the expiry queue): " + messageReceived.getJMSExpiration());</code>
-        </pre>
-        
-        <p>As we have not defined a time-to-live for the expiry queue, messages sent to the expiry queue will be kept forever (their JMS Expiration value is 0)</p>
-
-        <li>The <strong>origin destination</strong> is stored in the <code>_HORNETQ_ORIG_DESTINATION</code> property
-        <pre class="prettyprint">
-            <code>System.out.println("*Origin destination* of the expired message: " + messageReceived.getStringProperty("_HORNETQ_ORIG_DESTINATION"));</code>
-        </pre>
-
-        <li>The <strong>actual expiration time</strong> (when the message was expired from the queue) is stored in the <code>_HORNETQ_ACTUAL_EXPIRY</code> property
-        <pre class="prettyprint">
-            <code>System.out.println("*Actual expiration time* of the expired message: " + messageReceived.getLongProperty("_HORNETQ_ACTUAL_EXPIRY"));</code>
-        </pre>
-
-        </p>    
-        <li>And finally, <b>always</b> remember to close your JMS connections and resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
-
-        <pre class="prettyprint">
-           <code>finally
-           {
-              if (initialContext != null)
-              {
-                initialContext.close();
-              }
-              if (connection != null)
-              {
-                 connection.close();
-              }
-           }</code>
-        </pre>
-     </ol>
-     
-     <h2>More information</h2>
-     
-     <ul>
-         <li>User Manual's <a href="../../../docs/user-manual/en/html_single/index.html#message-expiry">Message Expiry chapter</a></li>
-     </ul>
   </body>
 </html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 cace530..9e33342 100644
--- a/examples/jms/ha-policy-autobackup/pom.xml
+++ b/examples/jms/ha-policy-autobackup/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -42,65 +43,61 @@ under the License.
          <version>${project.version}</version>
       </dependency>
       <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
       </dependency>
    </dependencies>
 
-   <profiles>
-      <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <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>create2</id>
-                        <goals>
-                           <goal>create</goal>
-                        </goals>
-                        <configuration>
-                           <instance>${basedir}/target/server1</instance>
-                           <configuration>${basedir}/target/classes/activemq/server1</configuration>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>runClient</id>
-                        <goals>
-                           <goal>runClient</goal>
-                        </goals>
-                        <configuration>
-                           <clientClass>org.apache.activemq.artemis.jms.example.HAPolicyAutoBackupExample</clientClass>
-                           <args>
-                              <param>${basedir}/target/server0</param>
-                              <param>${basedir}/target/server1</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>ha-policy-autobackup</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
-      </profile>
-   </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <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>create2</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <instance>${basedir}/target/server1</instance>
+                     <configuration>${basedir}/target/classes/activemq/server1</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>runClient</id>
+                  <goals>
+                     <goal>runClient</goal>
+                  </goals>
+                  <configuration>
+                     <clientClass>org.apache.activemq.artemis.jms.example.HAPolicyAutoBackupExample</clientClass>
+                     <args>
+                        <param>${basedir}/target/server0</param>
+                        <param>${basedir}/target/server1</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>ha-policy-autobackup</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 d561750..93d3d53 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,12 +16,6 @@
  */
 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;
@@ -29,13 +23,18 @@ import javax.jms.MessageProducer;
 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.api.jms.ActiveMQJMSClient;
+import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
+import org.apache.activemq.artemis.util.ServerUtil;
+
 /**
  * A simple example that demonstrates server side load-balancing of messages between the queue instances on different
  * nodes of the cluster.
@@ -52,33 +51,17 @@ public class HAPolicyAutoBackupExample
 
       Connection connection1 = null;
 
-      InitialContext ic0 = null;
-
-      InitialContext ic1 = null;
-
       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", "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", "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
-         Queue queue = (Queue) ic0.lookup("queue/exampleQueue");
+         Queue queue = ActiveMQJMSClient.createQueue("exampleQueue");
 
-         // Step 3. Look-up a JMS Connection Factory object from JNDI on server 0 and 1
-         ConnectionFactory cf0 = (ConnectionFactory) ic0.lookup("ConnectionFactory");
-         ConnectionFactory cf1 = (ConnectionFactory) ic1.lookup("ConnectionFactory");
+         // Step 3. new connection factories towards server 0 and 1
+         ConnectionFactory cf0 = new ActiveMQConnectionFactory("tcp://localhost:61616?ha=true&retryInterval=1000&retryIntervalMultiplier=1.0&reconnectAttempts=-1");
+         ConnectionFactory cf1 = new ActiveMQConnectionFactory("tcp://localhost:61617?ha=true&retryInterval=1000&retryIntervalMultiplier=1.0&reconnectAttempts=-1");
 
          // Step 6. We create JMS Connections to server 0 and 1
          connection0 = cf0.createConnection();
@@ -129,7 +112,7 @@ public class HAPolicyAutoBackupExample
 
          // Step 15.now kill server1, messages will be scaled down to server0
          ServerUtil.killServer(server1);
-         Thread.sleep(40000);
+         Thread.sleep(5000);
 
          // 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/dd820318/examples/jms/http-transport/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/http-transport/pom.xml b/examples/jms/http-transport/pom.xml
index 0d9c91d..6e2914b 100644
--- a/examples/jms/http-transport/pom.xml
+++ b/examples/jms/http-transport/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-http-transport-example</artifactId>
+   <artifactId>http-transport</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS Http Transport Example</name>
 
@@ -37,71 +38,82 @@ under the License.
 
    <dependencies>
       <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
       </dependency>
    </dependencies>
 
    <profiles>
       <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>create</id>
-                        <goals>
-                           <goal>create</goal>
-                        </goals>
-                     </execution>
-                     <execution>
-                        <id>start</id>
-                        <goals>
-                           <goal>cli</goal>
-                        </goals>
-                        <configuration>
-                           <spawn>true</spawn>
-                           <testURI>tcp://localhost:8080?http-enabled=true</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.HttpTransportExample</clientClass>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>cli</goal>
-                        </goals>
-                        <configuration>
-                           <args>
-                              <param>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-http-transport-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
+         <!-- specify -PnoServer if you don't want to start the server -->
+         <id>noServer</id>
+         <properties>
+            <noServer>true</noServer>
+         </properties>
       </profile>
    </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <spawn>true</spawn>
+                     <testURI>tcp://localhost:8080?http-enabled=true</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.HttpTransportExample</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>http-transport</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/http-transport/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/http-transport/readme.html b/examples/jms/http-transport/readme.html
index 9cc3f8c..a0f0005 100644
--- a/examples/jms/http-transport/readme.html
+++ b/examples/jms/http-transport/readme.html
@@ -27,14 +27,17 @@ under the License.
   <body onload="prettyPrint()">
      <h1>JMS HTTP Example</h1>
 
+
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
+
      <p>This example shows you how to configure ActiveMQ Artemis to use the HTTP protocol as its transport layer.</p>
-     
+
      <p>ActiveMQ Artemis supports a variety of network protocols to be its underlying transport without any specific code change.</p>
-     
+
      <p>This example is taken from the queue example without any code change. By changing the configuration file, one can get ActiveMQ Artemis working with HTTP transport.</p>
      <p>All you need to do is open the server0/broker.xml and enable HTTP like the following</p>
- 
- 
+
+
       <pre class="prettyprint">
       <code>
       &lt;connector name=&quot;netty-connector&quot;&gt;tcp://localhost:8080?httpEnabled=true&lt;/connector&gt;
@@ -44,84 +47,6 @@ under the License.
       &lt;acceptor name=&quot;netty-acceptor&quot;&gt;tcp://localhost:8080 &lt;/acceptor&gt;
       </code>
       </pre>
-     
-     <h2>Example step-by-step</h2>
-     <p><i>To run the example, simply type <code>mvn verify -Pexample</code> from this directory</i></p>
-
-     <ol>
-        <li>First we need to get an initial context so we can look-up the JMS connection factory and destination objects from JNDI. This initial context will get it's properties from the <code>client-jndi.properties</code> file in the directory <code>../common/config</code></li>
-        <pre class="prettyprint">
-           <code>InitialContext initialContext = getContext();</code>
-        </pre>
-
-        <li>We look-up the JMS queue object from JNDI</li>
-        <pre class="prettyprint">
-           <code>Queue queue = (Queue) initialContext.lookup("/queue/exampleQueue");</code>
-        </pre>
-
-        <li>We look-up the JMS connection factory object from JNDI</li>
-        <pre class="prettyprint">
-           <code>ConnectionFactory cf = (ConnectionFactory) initialContext.lookup("/ConnectionFactory");</code>
-        </pre>
-
-        <li>We create a JMS connection</li>
-        <pre class="prettyprint">
-           <code>connection = cf.createConnection();</code>
-        </pre>
-
-        <li>We create a JMS session. The session is created as non transacted and will auto acknowledge messages.</li>
-        <pre class="prettyprint">
-           <code>Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);</code>
-        </pre>
-
-        <li>We create a JMS message producer on the session. This will be used to send the messages.</li>
-        <pre class="prettyprint">
-          <code>MessageProducer messageProducer = session.createProducer(topic);</code>
-       </pre>
-
-        <li>We create a JMS text message that we are going to send.</li>
-        <pre class="prettyprint">
-           <code>TextMessage message = session.createTextMessage("This is a text message");</code>
-        </pre>
-
-        <li>We send message to the queue</li>
-        <pre class="prettyprint">
-           <code>messageProducer.send(message);</code>
-        </pre>
-
-        <li>We create a JMS Message Consumer to receive the message.</li>
-          <pre class="prettyprint">
-           <code>MessageConsumer messageConsumer = session.createConsumer(queue);</code>
-        </pre>
-
-        <li>We start the connection. In order for delivery to occur on any consumers or subscribers on a connection, the connection must be started</li>
-        <pre class="prettyprint">
-           <code>connection.start();</code>
-        </pre>
-
-        <li>The message arrives at the consumer. In this case we use a timeout of 5000 milliseconds but we could use a blocking 'receive()'</li>
-        <pre class="prettyprint">
-           <code>TextMessage messageReceived = (TextMessage) messageConsumer.receive(5000);</code>
-        </pre>
-
-        <li>And finally, <b>always</b> remember to close your JMS connections and resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
-
-        <pre class="prettyprint">
-           <code>finally
-           {
-              if (initialContext != null)
-              {
-                initialContext.close();
-              }
-              if (connection != null)
-              {
-                 connection.close();
-              }
-           }</code>
-        </pre>
-
-
 
-     </ol>
   </body>
 </html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 cd2e175..9ae1cba 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,6 +25,9 @@ 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.jms.client.ActiveMQConnectionFactory;
+
 /**
  * A simple JMS Queue example that uses HTTP protocol.
  */
@@ -33,17 +36,13 @@ public class HttpTransportExample
    public static void main(final String[] args) throws Exception
    {
       Connection connection = null;
-      InitialContext initialContext = null;
       try
       {
-         // Step 1. Create an initial context to perform the JNDI lookup.
-         initialContext = new InitialContext();
-
          // Step 2. Perfom a lookup on the queue
-         Queue queue = (Queue)initialContext.lookup("queue/exampleQueue");
+         Queue queue = ActiveMQJMSClient.createQueue("exampleQueue");
 
          // Step 3. Perform a lookup on the Connection Factory
-         ConnectionFactory cf = (ConnectionFactory)initialContext.lookup("ConnectionFactory");
+         ConnectionFactory cf = new ActiveMQConnectionFactory("tcp://localhost:8080?http-enabled=true");
 
          // Step 4.Create a JMS Connection
          connection = cf.createConnection();
@@ -75,15 +74,9 @@ public class HttpTransportExample
 
          System.out.println("Received message: " + messageReceived.getText());
 
-         initialContext.close();
       }
       finally
       {
-         // Step 12. Be sure to close our JMS resources!
-         if (initialContext != null)
-         {
-            initialContext.close();
-         }
          if (connection != null)
          {
             connection.close();

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 ea39ccd..d1a4d2a 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,13 +29,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>${data.dir:../data}/bindings</bindings-directory>
+      <bindings-directory>./data/bindings</bindings-directory>
 
-      <journal-directory>${data.dir:../data}/journal</journal-directory>
+      <journal-directory>./data/journal</journal-directory>
 
-      <large-messages-directory>${data.dir:../data}/largemessages</large-messages-directory>
+      <large-messages-directory>./data/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir:../data}/paging</paging-directory>
+      <paging-directory>./data/paging</paging-directory>
 
       <!-- Acceptors -->
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/http-transport/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/examples/jms/http-transport/src/main/resources/jndi.properties b/examples/jms/http-transport/src/main/resources/jndi.properties
deleted file mode 100644
index 15dae0b..0000000
--- a/examples/jms/http-transport/src/main/resources/jndi.properties
+++ /dev/null
@@ -1,20 +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.
-
-java.naming.factory.initial=org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory
-connectionFactory.ConnectionFactory=tcp://localhost:8080?http-enabled=true
-queue.queue/exampleQueue=exampleQueue

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 774b2b2..1f4d2e6 100644
--- a/examples/jms/instantiate-connection-factory/pom.xml
+++ b/examples/jms/instantiate-connection-factory/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-instantiate-connection-factory-example</artifactId>
+   <artifactId>instantiate-connection-factory</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS Instantiate Connection Factory Example</name>
 
@@ -35,83 +36,85 @@ under the License.
       <activemq.basedir>${project.basedir}/../../..</activemq.basedir>
    </properties>
 
+
    <dependencies>
       <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>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
-      </dependency>
    </dependencies>
 
    <profiles>
       <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>create</id>
-                        <goals>
-                           <goal>create</goal>
-                        </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.InstantiateConnectionFactoryExample</clientClass>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>cli</goal>
-                        </goals>
-                        <configuration>
-                           <args>
-                              <param>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-instantiate-connection-factory-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
+         <!-- specify -PnoServer if you don't want to start the server -->
+         <id>noServer</id>
+         <properties>
+            <noServer>true</noServer>
+         </properties>
       </profile>
    </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <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.InstantiateConnectionFactoryExample
+                     </clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>instantiate-connection-factory</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/instantiate-connection-factory/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/instantiate-connection-factory/readme.html b/examples/jms/instantiate-connection-factory/readme.html
index ff4e17a..fa062ea 100644
--- a/examples/jms/instantiate-connection-factory/readme.html
+++ b/examples/jms/instantiate-connection-factory/readme.html
@@ -26,7 +26,9 @@ under the License.
   </head>
   <body onload="prettyPrint()">
      <h1>JMS Instantiate Connection Factory Example</h1>
-     
+
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
+
      <p>Usually, JMS Objects such as ConnectionFactories, Queue and Topic instances are looked up from JNDI
      before being used by the client code. This objects are called "administered objects" in JMS specification
      terminology.</p>
@@ -43,95 +45,5 @@ under the License.
      are that it wishes to connect to, or for specifying live-backup pairs of servers for failover.</p>
      <p>For more information on instantiating ConnectionFactories directly please consult the user manual and
      javadoc.</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>
-
-     <ol>
-        <li>Instead of looking it up from JNDI we directly instantiate the JMS Queue object. We
-        pass in the name of the JMS Queue in the constructor. The actual JMS Queue must already be deployed on
-        the server.</li>
-        <pre class="prettyprint">
-           <code>
-     Queue queue = new ActiveMQQueue("exampleQueue");</code>
-        </pre>
-
-        <li>Instantiate the TransportConfiguration object. The TransportConfiguration instance encapsulates
-        the connection details of the server we're connecting to. In this case we're using Netty as a transport, and
-        we're specifying to connect on port 61617.</li>
-        <pre class="prettyprint">
-           <code>
-     Map<String, Object> connectionParams = new HashMap<String, Object>();
-
-     connectionParams.put(PORT_PROP_NAME, 61617);
-
-     TransportConfiguration transportConfiguration = new TransportConfiguration(NettyConnectorFactory.class.getName(),
-                                                                                connectionParams);
-           
-           </code>
-        </pre>
-
-        <li>Directly instantiate the JMS ConnectionFactory object using that TransportConfiguration.</li>
-        <pre class="prettyprint">
-           <code>
-     ConnectionFactory cf = ActiveMQJMSClient.createConnectionFactoryWithoutHA(transportConfiguration);
-           </code>
-        </pre>
-
-        <li>We create a JMS connection</li>
-        <pre class="prettyprint">
-           <code>connection = cf.createConnection();</code>
-        </pre>
-
-        <li>We create a JMS session. The session is created as non transacted and will auto acknowledge messages.</li>
-        <pre class="prettyprint">
-           <code>Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);</code>
-        </pre>
-
-        <li>We create a JMS message producer on the session. This will be used to send the messages.</li>
-        <pre class="prettyprint">
-          <code>MessageProducer messageProducer = session.createProducer(topic);</code>
-       </pre>
-
-        <li>We create a JMS text message that we are going to send.</li>
-        <pre class="prettyprint">
-           <code>TextMessage message = session.createTextMessage("This is a text message");</code>
-        </pre>
-
-        <li>We send message to the queue</li>
-        <pre class="prettyprint">
-           <code>messageProducer.send(message);</code>
-        </pre>
-
-        <li>We create a JMS Message Consumer to receive the message.</li>
-          <pre class="prettyprint">
-           <code>MessageConsumer messageConsumer = session.createConsumer(queue);</code>
-        </pre>
-
-        <li>We start the connection. In order for delivery to occur on any consumers or subscribers on a connection, the connection must be started</li>
-        <pre class="prettyprint">
-           <code>connection.start();</code>
-        </pre>
-
-        <li>The message arrives at the consumer. In this case we use a timeout of 5000 milliseconds but we could use a blocking 'receive()'</li>
-        <pre class="prettyprint">
-           <code>TextMessage messageReceived = (TextMessage) messageConsumer.receive(5000);</code>
-        </pre>
-
-        <li>And finally, <b>always</b> remember to close your resources after use, in a <code>finally</code> block.</li>
-
-        <pre class="prettyprint">
-           <code>finally
-           {
-              if (connection != null)
-              {
-                 connection.close();
-              }
-           }</code>
-        </pre>
-
-
-
-     </ol>
-  </body>
+       </body>
 </html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 b0acce4..9b1e46e 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
@@ -23,14 +23,9 @@ 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;
-import org.apache.activemq.artemis.api.jms.JMSFactoryType;
-import org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnectorFactory;
-import org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants;
+import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
 
 /**
  *
@@ -49,17 +44,8 @@ public class InstantiateConnectionFactoryExample
          // Step 1. Directly instantiate the JMS Queue object.
          Queue queue = ActiveMQJMSClient.createQueue("exampleQueue");
 
-         // Step 2. Instantiate the TransportConfiguration object which contains the knowledge of what transport to use,
-         // The server port etc.
-
-         Map<String, Object> connectionParams = new HashMap<String, Object>();
-         connectionParams.put(TransportConstants.PORT_PROP_NAME, 61616);
-
-         TransportConfiguration transportConfiguration = new TransportConfiguration(NettyConnectorFactory.class.getName(),
-                                                                                    connectionParams);
-
-         // Step 3 Directly instantiate the JMS ConnectionFactory object using that TransportConfiguration
-         ConnectionFactory cf = ActiveMQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, transportConfiguration);
+         // Starting with Artemis 1.0.1 you can just use the URI to instantiate the object directly
+         ConnectionFactory cf = new ActiveMQConnectionFactory("tcp://localhost:61616");
 
          // Step 4.Create a JMS Connection
          connection = cf.createConnection();

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/interceptor/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/interceptor/pom.xml b/examples/jms/interceptor/pom.xml
index 530a7b9..63ab338 100644
--- a/examples/jms/interceptor/pom.xml
+++ b/examples/jms/interceptor/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-interceptor-example</artifactId>
+   <artifactId>interceptor</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS Interceptor Example</name>
 
@@ -41,72 +42,79 @@ under the License.
          <artifactId>artemis-jms-client</artifactId>
          <version>${project.version}</version>
       </dependency>
-      <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
-      </dependency>
    </dependencies>
 
    <profiles>
       <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>create</id>
-                        <goals>
-                           <goal>create</goal>
-                        </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.InterceptorExample</clientClass>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>cli</goal>
-                        </goals>
-                        <configuration>
-                           <args>
-                              <param>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-interceptor-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                   </dependencies>
-               </plugin>
-            </plugins>
-         </build>
+         <!-- specify -PnoServer if you don't want to start the server -->
+         <id>noServer</id>
+         <properties>
+            <noServer>true</noServer>
+         </properties>
       </profile>
    </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <libList><arg>org.apache.activemq.examples.jms:interceptor:${project.version}</arg></libList>
+                     <ignore>${noServer}</ignore>
+                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <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.InterceptorExample</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>interceptor</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/interceptor/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/interceptor/readme.html b/examples/jms/interceptor/readme.html
index a680c12..e4d3601 100644
--- a/examples/jms/interceptor/readme.html
+++ b/examples/jms/interceptor/readme.html
@@ -27,6 +27,9 @@ under the License.
   <body onload="prettyPrint()">
      <h1>JMS Interceptor Example</h1>
 
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
+
+
      <p>This example shows you how to implement and configure a simple incoming, server-side interceptor with ActiveMQ Artemis.</p>
 
      <p>ActiveMQ Artemis allows an application to use an interceptor to hook into the messaging system. All that needs to do is to implement the
@@ -59,113 +62,6 @@ under the License.
      <p>With our interceptor we always return <code>true</code> from the <code>intercept</code> method. If we were
      to return <code>false</code> that signifies that no more interceptors are to run or the target
      is not to be called. Return <code>false</code> to abort processing of the packet.</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>
-
-     <ol>
-        <li>First we need to get an initial context so we can look-up the JMS connection factory and destination objects from JNDI. This initial context will get it's properties from the <code>client-jndi.properties</code> file in the directory <code>../common/config</code></li>
-        <pre class="prettyprint">
-           <code>InitialContext initialContext = getContext(0);</code>
-        </pre>
-
-        <li>We look-up the JMS queue object from JNDI</li>
-        <pre class="prettyprint">
-           <code>Queue queue = (Queue) initialContext.lookup("/queue/exampleQueue");</code>
-        </pre>
-
-        <li>We look-up the JMS connection factory object from JNDI</li>
-        <pre class="prettyprint">
-           <code>ConnectionFactory cf = (ConnectionFactory) initialContext.lookup("/ConnectionFactory");</code>
-        </pre>
-
-        <li>We create a JMS connection</li>
-        <pre class="prettyprint">
-           <code>connection = cf.createConnection();</code>
-        </pre>
-
-        <li>We create a JMS session. The session is created as non transacted and will auto acknowledge messages.</li>
-        <pre class="prettyprint">
-           <code>Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);</code>
-        </pre>
-
-        <li>We create a JMS message producer on the session. This will be used to send the messages.</li>
-        <pre class="prettyprint">
-          <code>MessageProducer messageProducer = session.createProducer(topic);</code>
-       </pre>
-
-        <li>We create a JMS text message that we are going to send.</li>
-        <pre class="prettyprint">
-           <code>TextMessage message = session.createTextMessage("This is a text message");</code>
-        </pre>
-
-        <li>We send message to the queue</li>
-        <pre class="prettyprint">
-           <code>messageProducer.send(message);</code>
-        </pre>
-
-        <li>We create a JMS Message Consumer to receive the message.</li>
-          <pre class="prettyprint">
-           <code>MessageConsumer messageConsumer = session.createConsumer(queue);</code>
-        </pre>
-
-        <li>We start the connection. In order for delivery to occur on any consumers or subscribers on a connection, the connection must be started</li>
-        <pre class="prettyprint">
-           <code>connection.start();</code>
-        </pre>
-
-        <li>The message arrives at the consumer. In this case we use a timeout of 5000 milliseconds but we could use a blocking 'receive()'</li>
-        <pre class="prettyprint">
-           <code>TextMessage messageReceived = (TextMessage) messageConsumer.receive(5000);</code>
-        </pre>
-
-        <li>We print out the message and the new property that has been added by the interceptor</li>
-        <pre class="prettyprint">
-           <code>System.out.println("Received message [" + messageReceived.getText() + "] with String property: " + messageReceived.getStringProperty("newproperty"));</code>
-        </pre>
-
-        <li>And finally, <b>always</b> remember to close your JMS connections and resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
-
-        <pre class="prettyprint">
-           <code>
-           finally
-           {
-              if (initialContext != null)
-              {
-                initialContext.close();
-              }
-              if (connection != null)
-              {
-                 connection.close();
-              }
-           }
-           </code>
-        </pre>
-     </ol>
-     <ol>
-        <li>The SimpleInterceptor:</li>
-        <pre class="prettyprint">
-           <code>
-           public class SimpleInterceptor implements Interceptor
-           {
-              public boolean intercept(Packet packet, RemotingConnection connection) throws ActiveMQException
-              {
-                 System.out.println("SimpleInterceptor gets called!");
-                 System.out.println("Packet: " + packet.getClass().getName());
-                 System.out.println("RemotingConnection: " + connection.getRemoteAddress());
-
-                 if (packet instanceof SessionSendMessage)
-                 {
-                    SessionSendMessage realPacket = (SessionSendMessage)packet;
-                    Message msg = realPacket.getServerMessage();
-                    msg.putStringProperty(new SimpleString("newproperty"), new SimpleString("Hello from interceptor!"));
-                 }
-                 return true;
-              }
-           }
-           </code>
-        </pre>
-     </ol>
   </body>
 </html>
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 17376ab..3066fa5 100644
--- a/examples/jms/jms-auto-closeable/pom.xml
+++ b/examples/jms/jms-auto-closeable/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-auto-closeable-example</artifactId>
+   <artifactId>auto-closeable</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS Auto Closable Example</name>
 
@@ -37,71 +38,78 @@ under the License.
 
    <dependencies>
       <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
       </dependency>
    </dependencies>
 
    <profiles>
       <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>create</id>
-                        <goals>
-                           <goal>create</goal>
-                        </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.JMSAutoCloseableExample</clientClass>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>cli</goal>
-                        </goals>
-                        <configuration>
-                           <args>
-                              <param>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-auto-closeable-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
+         <!-- specify -PnoServer if you don't want to start the server -->
+         <id>noServer</id>
+         <properties>
+            <noServer>true</noServer>
+         </properties>
       </profile>
    </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+               </execution>
+               <execution>
+                  <id>start</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <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.JMSAutoCloseableExample</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>auto-closeable</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/jms-auto-closeable/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/jms-auto-closeable/readme.html b/examples/jms/jms-auto-closeable/readme.html
index 48cc246..7e71553 100644
--- a/examples/jms/jms-auto-closeable/readme.html
+++ b/examples/jms/jms-auto-closeable/readme.html
@@ -27,11 +27,12 @@ under the License.
   <body onload="prettyPrint()">
      <h1>JMS Auto Closable Example</h1>
 
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
+
      <p>This example shows you how JMS resources, such as connections, sessions and consumers, in JMS 2 can be automatically closed on error.</p>
      <p>In this instance we auto close a connection after a subsequent call to a JMS producer send fails</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>
 
      <ol>
         <li>First we need to get an initial context so we can look-up the JMS connection factory and destination objects from JNDI. This initial context will get it's properties from the <code>client-jndi.properties</code> file in the directory <code>../common/config</code></li>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 555e8ff..a4f13e8 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
@@ -16,9 +16,12 @@
  */
 package org.apache.activemq.artemis.jms.example;
 
-import javax.jms.*;
-import javax.naming.InitialContext;
-import java.lang.Exception;
+import javax.jms.JMSContext;
+import javax.jms.JMSProducer;
+import javax.jms.Queue;
+
+import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
+import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
 
 /**
  * A simple JMS example that shows how AutoCloseable is used by JMS 2 resources.
@@ -27,45 +30,24 @@ public class JMSAutoCloseableExample
 {
    public static void main(final String[] args) throws Exception
    {
-      InitialContext initialContext = null;
+      // Step 2. Perfom a lookup on the queue
+      Queue queue = ActiveMQJMSClient.createQueue("exampleQueue");
+
+      // Step 4.Create a JMS Context using the try-with-resources statement
       try
+         (
+            // Even though ConnectionFactory is not closeable it would be nice to close an ActiveMQConnectionFactory
+            ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory();
+            JMSContext jmsContext = cf.createContext()
+         )
       {
-         // Step 1. Create an initial context to perform the JNDI lookup.
-         initialContext = new InitialContext();
-
-         // Step 2. Perfom a lookup on the queue
-         Queue queue = (Queue)initialContext.lookup("queue/exampleQueue");
+         // Step 5. create a jms producer
+         JMSProducer jmsProducer = jmsContext.createProducer();
 
-         // Step 3. Perform a lookup on the Connection Factory
-         ConnectionFactory cf = (ConnectionFactory)initialContext.lookup("ConnectionFactory");
+         // Step 6. Try sending a message, we don't have the appropriate privileges to do this so this will throw an exception
+         jmsProducer.send(queue, "A Message from JMS2!");
 
-         // Step 4.Create a JMS Context using the try-with-resources statement
-         try
-                 (
-                         JMSContext jmsContext = cf.createContext()
-                 )
-         {
-            // Step 5. create a jms producer
-            JMSProducer jmsProducer = jmsContext.createProducer();
-
-            // Step 6. Try sending a message, we don't have the appropriate privileges to do this so this will throw an exception
-            jmsProducer.send(queue, "this message will fail security!");
-         }
-         catch(JMSRuntimeException e)
-         {
-            //Step 7. we can handle the new JMSRuntimeException if we want or let the exception get handled elsewhere, the
-            //JMSCcontext will have been closed by the time we get to this point
-            System.out.println("expected exception from jmsProducer.send: " + e.getMessage());
-         }
-      }
-      finally
-      {
-         // Step 8. Be sure to close our Initial Context, note that we don't have to close the JMSContext as it is auto closeable
-         //and closed by the vm
-         if (initialContext != null)
-         {
-            initialContext.close();
-         }
+         System.out.println("Received:" + jmsContext.createConsumer(queue).receiveBody(String.class));
       }
    }
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/jms-bridge/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/jms-bridge/pom.xml b/examples/jms/jms-bridge/pom.xml
index ac21a8c..9627051 100644
--- a/examples/jms/jms-bridge/pom.xml
+++ b/examples/jms/jms-bridge/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-bridge-example</artifactId>
+   <artifactId>bridge</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS Bridge Example</name>
 
@@ -42,115 +43,126 @@ under the License.
          <version>${project.version}</version>
       </dependency>
       <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
       </dependency>
    </dependencies>
 
    <profiles>
       <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <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>create1</id>
-                        <goals>
-                           <goal>create</goal>
-                        </goals>
-                        <configuration>
-                           <instance>${basedir}/target/server1</instance>
-                           <configuration>${basedir}/target/classes/activemq/server1</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>
-                           <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>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-bridge-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
+         <!-- specify -PnoServer if you don't want to start the server -->
+         <id>noServer</id>
+         <properties>
+            <noServer>true</noServer>
+         </properties>
       </profile>
    </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create0</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <instance>${basedir}/target/server0</instance>
+                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create1</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <instance>${basedir}/target/server1</instance>
+                     <configuration>${basedir}/target/classes/activemq/server1</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start0</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <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>
+                     <ignore>${noServer}</ignore>
+                     <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>
+                     <ignore>${noServer}</ignore>
+                     <location>${basedir}/target/server0</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop1</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <location>${basedir}/target/server1</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>bridge</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/jms-bridge/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/jms-bridge/readme.html b/examples/jms/jms-bridge/readme.html
index 973abfd..2ded751 100644
--- a/examples/jms/jms-bridge/readme.html
+++ b/examples/jms/jms-bridge/readme.html
@@ -26,6 +26,9 @@ under the License.
   </head>
   <body onload="prettyPrint()">
      <h1>JMS Bridge Example</h1>
+
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
+
      <p>This example shows you how to create a JMS Bridge between two ActiveMQ Artemis servers.</p>
      <img src="jms-bridge.png"  />
      <p>The example will use two ActiveMQ Artemis servers:</p>


[13/18] activemq-artemis git commit: ARTEMIS-180 removing -Pexample and some other improvements around the examples

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/clustered-static-oneway/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-static-oneway/readme.html b/examples/jms/clustered-static-oneway/readme.html
index 4aacbbd..d19ba03 100644
--- a/examples/jms/clustered-static-oneway/readme.html
+++ b/examples/jms/clustered-static-oneway/readme.html
@@ -26,6 +26,7 @@ under the License.
   </head>
   <body onload="prettyPrint()">
      <h1>JMS Load Balanced Static Clustered One Way Queue Example</h1>
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
 
      <p>This example demonstrates a JMS queue deployed on three different nodes. The three nodes are configured to form a one way cluster
        from a <em>static</em> list of nodes. </p>
@@ -59,190 +60,5 @@ under the License.
      </pre>
      <p>For more information on ActiveMQ Artemis load balancing, and clustering in general, please see the clustering
      section of the user manual.</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>
-
-     <ol>
-        <li> Get an initial context for looking up JNDI from server 0.</li>
-        <pre class="prettyprint">
-           <code>
-   ic0 = getContext(0);
-   </code>
-        </pre>
-
-        <li>Look-up the JMS Queue object from JNDI</li>
-        <pre class="prettyprint">
-           <code>
-   Queue queue = (Queue)ic0.lookup("/queue/exampleQueue");
-           </code>
-        </pre>
-
-        <li>Look-up a JMS Connection Factory object from JNDI on server 0</li>
-        <pre class="prettyprint">
-           <code>
-   ConnectionFactory cf0 = (ConnectionFactory)ic0.lookup("/ConnectionFactory");
-           </code>
-        </pre>
-
-
-        <li>grab an initial connection and wait, in reality you wouldn't do it this way but since we want to ensure an
-        equal load balance we do this and then create 4 connections round robined</li>
-        <pre class="prettyprint">
-           <code>
-   initialConnection = cf0.createConnection();
-           </code>
-        </pre>
-
-        <li>We create a JMS Connection connection0 which is a connection to server 0</li>
-        <pre class="prettyprint">
-           <code>
-   connection0 = cf0.createConnection()
-           </code>
-        </pre>
-
-        <li>We create a JMS Connection connection0 which is a connection to server 1</li>
-        <pre class="prettyprint">
-           <code>
-   connection1 = cf0.createConnection()
-           </code>
-        </pre>
-
-        <li>We create a JMS Connection connection0 which is a connection to server 2</li>
-        <pre class="prettyprint">
-           <code>
-   connection2 = cf0.createConnection()
-           </code>
-        </pre>
-
-        <li>We create a JMS Session on server 0</li>
-        <pre class="prettyprint">
-           <code>
-   Session session0 = connection0.createSession(false, Session.AUTO_ACKNOWLEDGE);
-           </code>
-        </pre>
-
-        <li>We create a JMS Session on server 1</li>
-        <pre class="prettyprint">
-           <code>
-   Session session1 = connection1.createSession(false, Session.AUTO_ACKNOWLEDGE);
-            </code>
-        </pre>
-
-        <li>We create a JMS Session on server 1</li>
-        <pre class="prettyprint">
-           <code>
-   Session session2 = connection2.createSession(false, Session.AUTO_ACKNOWLEDGE);
-            </code>
-        </pre>
-        <li>We start the connections to ensure delivery occurs on them</li>
-        <pre class="prettyprint">
-           <code>
-   connection0.start();
-
-   connection1.start();
-
-   connection2.start();
-           </code>
-        </pre>
-
-
-        <li>We create JMS MessageConsumer objects on server 0 and server 1</li>
-        <pre class="prettyprint">
-           <code>
-   MessageConsumer consumer0 = session0.createConsumer(queue);
-
-   MessageConsumer consumer2 = session2.createConsumer(queue);
-
-   MessageConsumer consumer3 = session3.createConsumer(queue);
-           </code>
-        </pre>
-
-
-        <li>We create a JMS MessageProducer object on server 0.</li>
-        <pre class="prettyprint">
-           <code>
-   Session sendSession = getServerConnection(0, connection0, connection1, connection2).createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-   MessageProducer producer = sendSession.createProducer(queue);
-           </code>
-        </pre>
-
-        <li>We send some messages to server 0.</li>
-        <pre class="prettyprint">
-           <code>
-	final int numMessages = 18;
-
-	for (int i = 0; i < numMessages; i++)
-	{
-	   TextMessage message = session0.createTextMessage("This is text message " + i);
-
-	   producer.send(message);
-
-	   System.out.println("Sent message: " + message.getText());
-	}
-           </code>
-        </pre>
-
-        <li>We now consume those messages on *both* server 0 and server 1.
-         We note the messages have been distributed between servers in a round robin fashion.
-         ActiveMQ Artemis has <b>load balanced</b> the messages between the available consumers on the different nodes.
-         ActiveMQ Artemis can be configured to always load balance messages to all nodes, or to only balance messages
-         to nodes which have consumers with no or matching selectors. See the user manual for more details.</li>
-         JMS Queues implement point-to-point message where each message is only ever consumed by a
-         maximum of one consumer.
-        <pre class="prettyprint">
-           <code>
-	for (int i = 0; i < numMessages; i += 2)
-	{
-	   TextMessage message0 = (TextMessage)consumer0.receive(5000);
-
-	   System.out.println("Got message: " + message0.getText() + " from node 0");
-
-	   TextMessage message1 = (TextMessage)consumer1.receive(5000);
-
-	   System.out.println("Got message: " + message1.getText() + " from node 1");
-
-	   TextMessage message2 = (TextMessage)consumer2.receive(5000);
-
-	   System.out.println("Got message: " + message2.getText() + " from node " + con2Node);
-	}
-           </code>
-        </pre>
-
-        <li>And finally (no pun intended), <b>always</b> remember to close your JMS resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
-
-        <pre class="prettyprint">
-           <code>
-    finally
-    {
-      if (initialConnection != null)
-      {
-         initialConnection.close();
-      }
-
-      if (connection0 != null)
-      {
-         connection0.close();
-      }
-
-      if (connection1 != null)
-      {
-         connection1.close();
-      }
-
-      if (connection2 != null)
-      {
-         connection2.close();
-      }
-
-      if (ic0 != null)
-      {
-         ic0.close();
-      }
-    }
-           </code>
-        </pre>
-
-     </ol>
   </body>
 </html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 e061722..53d98bc 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 org.apache.activemq.artemis.util.ServerUtil;
-
 import javax.jms.Connection;
 import javax.jms.ConnectionFactory;
 import javax.jms.MessageConsumer;
@@ -25,8 +23,10 @@ import javax.jms.MessageProducer;
 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.api.jms.ActiveMQJMSClient;
+import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
+import org.apache.activemq.artemis.util.ServerUtil;
 
 /**
  * A simple example that demonstrates server side load-balancing of messages between the queue instances on different
@@ -44,22 +44,13 @@ public class ClusterStaticOnewayExample
 
       Connection connection2 = null;
 
-      InitialContext ic0 = null;
-
       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", "tcp://localhost:61616");
-         properties.put("queue.queue/exampleQueue", "exampleQueue");
-         ic0 = new InitialContext(properties);
-
-         // Step 2. Look-up the JMS Queue object from JNDI
-         Queue queue = (Queue)ic0.lookup("queue/exampleQueue");
+         // Step 2. Instantiate Queue
+         Queue queue = ActiveMQJMSClient.createQueue("exampleQueue");
 
          // Step 3. Look-up a JMS Connection Factory object from JNDI on server 0
-         ConnectionFactory cf0 = (ConnectionFactory)ic0.lookup("ConnectionFactory");
+         ConnectionFactory cf0 = new ActiveMQConnectionFactory("tcp://localhost:61616");
 
          //step 4. grab an initial connection and wait, in reality you wouldn't do it this way but since we want to ensure an
          // equal load balance we do this and then create 4 connections round robined
@@ -173,11 +164,6 @@ public class ClusterStaticOnewayExample
          {
             connection2.close();
          }
-
-         if (ic0 != null)
-         {
-            ic0.close();
-         }
       }
    }
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 2d77bb1..3e86ed3 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,13 +26,13 @@
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>${data.dir:./data}/bindings</bindings-directory>
+      <bindings-directory>./data/bindings</bindings-directory>
 
-      <journal-directory>${data.dir:./data}/journal</journal-directory>
+      <journal-directory>./data/journal</journal-directory>
 
-      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
+      <large-messages-directory>./data/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir:./data}/paging</paging-directory>
+      <paging-directory>./data/paging</paging-directory>
 
       <!-- Connectors -->
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 9b5fdf8..1464ea9 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,13 +26,13 @@
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>${data.dir:./data}/bindings</bindings-directory>
+      <bindings-directory>./data/bindings</bindings-directory>
 
-      <journal-directory>${data.dir:./data}/journal</journal-directory>
+      <journal-directory>./data/journal</journal-directory>
 
-      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
+      <large-messages-directory>./data/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir:./data}/paging</paging-directory>
+      <paging-directory>./data/paging</paging-directory>
 
       <!-- Connectors -->
       <connectors>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 147a9b9..b1043f5 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,13 +26,13 @@
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>${data.dir:./data}/bindings</bindings-directory>
+      <bindings-directory>./data/bindings</bindings-directory>
 
-      <journal-directory>${data.dir:./data}/journal</journal-directory>
+      <journal-directory>./data/journal</journal-directory>
 
-      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
+      <large-messages-directory>./data/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir:./data}/paging</paging-directory>
+      <paging-directory>./data/paging</paging-directory>
 
       <!-- Connectors -->
       <connectors>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/clustered-topic/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-topic/pom.xml b/examples/jms/clustered-topic/pom.xml
index 418d98f..2982b21 100644
--- a/examples/jms/clustered-topic/pom.xml
+++ b/examples/jms/clustered-topic/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-clustered-topic-example</artifactId>
+   <artifactId>clustered-topic</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS Clustered Topic Example</name>
 
@@ -37,115 +38,125 @@ under the License.
 
    <dependencies>
       <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
       </dependency>
    </dependencies>
 
    <profiles>
       <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <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>create1</id>
-                        <goals>
-                           <goal>create</goal>
-                        </goals>
-                        <configuration>
-                           <instance>${basedir}/target/server1</instance>
-                           <configuration>${basedir}/target/classes/activemq/server1</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>
-                           <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>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-clustered-topic-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
+         <!-- specify -PnoServer if you don't want to start the server -->
+         <id>noServer</id>
+         <properties>
+            <noServer>true</noServer>
+         </properties>
       </profile>
    </profiles>
-
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create0</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <instance>${basedir}/target/server0</instance>
+                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create1</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <instance>${basedir}/target/server1</instance>
+                     <configuration>${basedir}/target/classes/activemq/server1</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start0</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <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>
+                     <ignore>${noServer}</ignore>
+                     <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>
+                     <ignore>${noServer}</ignore>
+                     <location>${basedir}/target/server0</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop1</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <location>${basedir}/target/server1</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>clustered-topic</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/clustered-topic/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-topic/readme.html b/examples/jms/clustered-topic/readme.html
index bf92e08..cd29bb4 100644
--- a/examples/jms/clustered-topic/readme.html
+++ b/examples/jms/clustered-topic/readme.html
@@ -26,6 +26,7 @@ under the License.
   </head>
   <body onload="prettyPrint()">
      <h1>JMS Clustered Topic Example</h1>
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
 
      <p>This example demonstrates a JMS Topic deployed on two different nodes. The two nodes are configured to form a cluster.</p>
      <p>We then create a subscriber on the topic on each node, and we create a producer on only one of the nodes.</p>
@@ -50,144 +51,5 @@ under the License.
      </pre>
      <p>For more information on ActiveMQ Artemis load balancing, and clustering in general, please see the clustering
      section of the user manual.</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>
-
-     <ol>
-        <li> Get an initial context for looking up JNDI from server 0.</li>
-        <pre class="prettyprint">
-           <code>
-   ic0 = getContext(0);
-   </code>
-        </pre>
-
-        <li>Look-up the JMS Topic object from JNDI</li>
-        <pre class="prettyprint">
-           <code>Topic topic = (Topic)ic0.lookup("/topic/exampleTopic");</code>
-        </pre>
-
-        <li>Look-up a JMS Connection Factory object from JNDI on server 0</li>
-        <pre class="prettyprint">
-           <code>ConnectionFactory cf0 = (ConnectionFactory)ic0.lookup("/ConnectionFactory");</code>
-        </pre>
-
-        <li>Get an initial context for looking up JNDI from server 1.</li>
-        <pre class="prettyprint">
-           <code>ic1 = getContext(1);</code>
-        </pre>
-
-        <li>Look-up a JMS Connection Factory object from JNDI on server 1</li>
-        <pre class="prettyprint">
-           <code>ConnectionFactory cf1 = (ConnectionFactory)ic1.lookup("/ConnectionFactory");
-           </code>
-        </pre>
-
-        <li>We create a JMS Connection connection0 which is a connection to server 0</li>
-        <pre class="prettyprint">
-          <code>
-   connection0 = cf0.createConnection();
-          </code>
-        </pre>
-
-        <li>We create a JMS Connection connection1 which is a connection to server 1</li>
-        <pre class="prettyprint">
-          <code>
-   connection1 = cf1.createConnection();
-          </code>
-        </pre>
-
-        <li>We create a JMS Session on server 0</li>
-        <pre class="prettyprint">
-           <code>
-   Session session0 = connection0.createSession(false, Session.AUTO_ACKNOWLEDGE);
-           </code>
-        </pre>
-
-        <li>We create a JMS Session on server 1</li>
-        <pre class="prettyprint">
-           <code>
-   Session session1 = connection1.createSession(false, Session.AUTO_ACKNOWLEDGE);
-            </code>
-        </pre>
-
-        <li>We start the connections to ensure delivery occurs on them</li>
-        <pre class="prettyprint">
-           <code>
-   connection0.start();
-
-   connection1.start();
-           </code>
-        </pre>
-
-        <li>We create JMS MessageConsumer (Topic subscriber) objects on server 0 and server 1</li>
-        <pre class="prettyprint">
-           <code>
-   MessageConsumer consumer0 = session0.createConsumer(topic);
-
-   MessageConsumer consumer1 = session1.createConsumer(topic);
-           </code>
-        </pre>
-
-        <li>We create a JMS MessageProducer object on server 0.</li>
-        <pre class="prettyprint">
-           <code>
-   MessageProducer producer = session0.createProducer(topic);</code>
-        </pre>
-
-        <li>We send some messages to server 0.</li>
-        <pre class="prettyprint">
-           <code>
-	final int numMessages = 10;
-
-	for (int i = 0; i < numMessages; i++)
-	{
-	   TextMessage message = session0.createTextMessage("This is text message " + i);
-
-	   producer.send(message);
-
-	   System.out.println("Sent message: " + message.getText());
-	}
-           </code>
-        </pre>
-
-        <li>
-        We now consume those messages on <b>both</b> server 0 and server 1.
-        We note that all messages have been consumed by <b>both</b> consumers.
-        JMS Topics implement <b>publish-subscribe</b> messaging where all consumers get a copy of all messages.
-        <pre class="prettyprint">
-           <code>
-	for (int i = 0; i < numMessages; i ++)
-	{
-	   TextMessage message0 = (TextMessage)consumer0.receive(5000);
-
-	   System.out.println("Got message: " + message0.getText() + " from node 0");
-
-	   TextMessage message1 = (TextMessage)consumer1.receive(5000);
-
-	   System.out.println("Got message: " + message1.getText() + " from node 1");
-	}
-           </code>
-        </pre>
-
-        <li>And finally (no pun intended), <b>always</b> remember to close your JMS resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
-
-        <pre class="prettyprint">
-           <code>
-	finally
-	{
-	   if (connection0 != null)
-	   {
-	      connection0.close();
-	   }
-
-	   if (connection1 != null)
-	   {
-	      connection1.close();
-	   }
-	}
-           </code>
-        </pre>
-
-     </ol>
   </body>
 </html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 31b3d41..a12fedd 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
@@ -24,7 +24,9 @@ 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.api.jms.ActiveMQJMSClient;
+import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
 
 /**
  * A simple example that shows a JMS Topic clustered across two nodes of a cluster.
@@ -44,56 +46,44 @@ public class ClusteredTopicExample
 
       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", "tcp://localhost:61616");
-         properties.put("topic.topic/exampleTopic", "exampleTopic");
-         ic0 = new InitialContext(properties);
-
-         // Step 2. Look-up the JMS Topic object from JNDI
-         Topic topic = (Topic)ic0.lookup("topic/exampleTopic");
 
-         // Step 3. Look-up a JMS Connection Factory object from JNDI on server 0
-         ConnectionFactory cf0 = (ConnectionFactory)ic0.lookup("ConnectionFactory");
+         // Step 1. Instantiate topic
+         Topic topic = ActiveMQJMSClient.createTopic("exampleTopic");
 
-         // 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", "tcp://localhost:61617");
-         ic1 = new InitialContext(properties);
+         // Step 2. Look-up a JMS Connection Factory object from JNDI on server 0
+         ConnectionFactory cf0 = new ActiveMQConnectionFactory("tcp://localhost:61616");
 
-         // Step 5. Look-up a JMS Connection Factory object from JNDI on server 1
-         ConnectionFactory cf1 = (ConnectionFactory)ic1.lookup("ConnectionFactory");
+         // Step 3. Look-up a JMS Connection Factory object from JNDI on server 1
+         ConnectionFactory cf1 = new ActiveMQConnectionFactory("tcp://localhost:61617");
 
-         // Step 6. We create a JMS Connection connection0 which is a connection to server 0
+         // Step 4. We create a JMS Connection connection0 which is a connection to server 0
          connection0 = cf0.createConnection();
 
-         // Step 7. We create a JMS Connection connection1 which is a connection to server 1
+         // Step 5. We create a JMS Connection connection1 which is a connection to server 1
          connection1 = cf1.createConnection();
 
-         // Step 8. We create a JMS Session on server 0
+         // Step 6. We create a JMS Session on server 0
          Session session0 = connection0.createSession(false, Session.AUTO_ACKNOWLEDGE);
 
-         // Step 9. We create a JMS Session on server 1
+         // Step 7. We create a JMS Session on server 1
          Session session1 = connection1.createSession(false, Session.AUTO_ACKNOWLEDGE);
 
-         // Step 10. We start the connections to ensure delivery occurs on them
+         // Step 8. We start the connections to ensure delivery occurs on them
          connection0.start();
 
          connection1.start();
 
-         // Step 11. We create JMS MessageConsumer objects on server 0 and server 1
+         // Step 9. We create JMS MessageConsumer objects on server 0 and server 1
          MessageConsumer consumer0 = session0.createConsumer(topic);
 
          MessageConsumer consumer1 = session1.createConsumer(topic);
 
          Thread.sleep(1000);
 
-         // Step 12. We create a JMS MessageProducer object on server 0
+         // Step 10. We create a JMS MessageProducer object on server 0
          MessageProducer producer = session0.createProducer(topic);
 
-         // Step 13. We send some messages to server 0
+         // Step 11. We send some messages to server 0
 
          final int numMessages = 10;
 
@@ -106,7 +96,7 @@ public class ClusteredTopicExample
             System.out.println("Sent message: " + message.getText());
          }
 
-         // Step 14. We now consume those messages on *both* server 0 and server 1.
+         // Step 12. We now consume those messages on *both* server 0 and server 1.
          // We note that all messages have been consumed by *both* consumers.
          // JMS Topics implement *publish-subscribe* messaging where all consumers get a copy of all messages
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 452b412..a4e8dde 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,13 +29,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>${data.dir:./data}/bindings</bindings-directory>
+      <bindings-directory>./data/bindings</bindings-directory>
 
-      <journal-directory>${data.dir:./data}/journal</journal-directory>
+      <journal-directory>./data/journal</journal-directory>
 
-      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
+      <large-messages-directory>./data/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir:./data}/paging</paging-directory>
+      <paging-directory>./data/paging</paging-directory>
 
       <!-- Connectors -->
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 c1a763b..78beec3 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,13 +29,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>${data.dir:./data}/bindings</bindings-directory>
+      <bindings-directory>./data/bindings</bindings-directory>
 
-      <journal-directory>${data.dir:./data}/journal</journal-directory>
+      <journal-directory>./data/journal</journal-directory>
 
-      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
+      <large-messages-directory>./data/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir:./data}/paging</paging-directory>
+      <paging-directory>./data/paging</paging-directory>
 
       <!-- Connectors -->
       <connectors>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 ea1fb10..d2947c4 100644
--- a/examples/jms/colocated-failover-scale-down/pom.xml
+++ b/examples/jms/colocated-failover-scale-down/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -42,65 +43,61 @@ under the License.
          <version>${project.version}</version>
       </dependency>
       <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
       </dependency>
    </dependencies>
-
-   <profiles>
-      <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <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>create1</id>
-                        <goals>
-                           <goal>create</goal>
-                        </goals>
-                        <configuration>
-                           <instance>${basedir}/target/server1</instance>
-                           <configuration>${basedir}/target/classes/activemq/server1</configuration>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>runClient</id>
-                        <goals>
-                           <goal>runClient</goal>
-                        </goals>
-                        <configuration>
-                           <clientClass>org.apache.activemq.artemis.jms.example.ColocatedFailoverScaleDownExample</clientClass>
-                           <args>
-                              <param>${basedir}/target/server0</param>
-                              <param>${basedir}/target/server1</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>colocated-failover-scale-down</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
-      </profile>
-   </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <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>create1</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <instance>${basedir}/target/server1</instance>
+                     <configuration>${basedir}/target/classes/activemq/server1</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>runClient</id>
+                  <goals>
+                     <goal>runClient</goal>
+                  </goals>
+                  <configuration>
+                     <clientClass>org.apache.activemq.artemis.jms.example.ColocatedFailoverScaleDownExample
+                     </clientClass>
+                     <args>
+                        <param>${basedir}/target/server0</param>
+                        <param>${basedir}/target/server1</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>colocated-failover-scale-down</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/colocated-failover-scale-down/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/colocated-failover-scale-down/readme.html b/examples/jms/colocated-failover-scale-down/readme.html
index 46eeef6..ffcd73b 100644
--- a/examples/jms/colocated-failover-scale-down/readme.html
+++ b/examples/jms/colocated-failover-scale-down/readme.html
@@ -26,6 +26,8 @@ under the License.
   </head>
   <body onload="prettyPrint()">
      <h1>JMS Colocated Failover Recover Only Example</h1>
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory. This example will always spawn and stop multiple servers.</pre>
+
 
      <p>This example demonstrates how you can colocate live and backup servers in the same VM. We do this by creating an
          HA Policy that is colocated. colocated means that backup servers can be created and maintained by live servers on behalf
@@ -59,133 +61,5 @@ under the License.
      from the list of available connectors which in  this case is the first INVM connector</p>
      <p> One other thing to notice is that the cluster connection has its reconnect attempts set to 5, this is so it will
          disconnect instead of trying to reconnect to a backup that doesn't exist.</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>
-
-     <ol>
-        <li> Get an initial context for looking up JNDI for both servers</li>
-        <pre class="prettyprint">
-           <code>
-    initialContext1 = getContext(1);
-    initialContext = getContext(0);
-   </code>
-        </pre>
-
-        <li>Look up the JMS resources from JNDI</li>
-        <pre class="prettyprint">
-           <code>
-    Queue queue = (Queue)initialContext.lookup("/queue/exampleQueue");
-    ConnectionFactory connectionFactory = (ConnectionFactory)initialContext.lookup("/ConnectionFactory");
-    ConnectionFactory connectionFactory1 = (ConnectionFactory)initialContext1.lookup("/ConnectionFactory");
-           </code>
-        </pre>
-
-        <li>Create a JMS Connections</li>
-        <pre class="prettyprint">
-           <code>
-    connection = connectionFactory.createConnection();
-    connection1 = connectionFactory1.createConnection();
-           </code>
-        </pre>
-
-        <li>Create a *non-transacted* JMS Session with client acknowledgement</li>
-        <pre class="prettyprint">
-           <code>
-    Session session = connection.createSession(false, Session.CLIENT_ACKNOWLEDGE);
-    Session session1 = connection1.createSession(false, Session.CLIENT_ACKNOWLEDGE);
-           </code>
-        </pre>
-
-        <li>Create a JMS MessageProducer</li>
-        <pre class="prettyprint">
-           <code>
-    MessageProducer producer = session.createProducer(queue);
-    MessageProducer producer1 = session1.createProducer(queue);
-           </code>
-        </pre>
-
-        <li>Send some messages to both servers</li>
-        <pre class="prettyprint">
-          <code>
-    for (int i = 0; i < numMessages; i++)
-    {
-      TextMessage message = session.createTextMessage("This is text message " + i);
-      producer.send(message);
-      System.out.println("Sent message: " + message.getText());
-      message = session1.createTextMessage("This is another text message " + i);
-      producer1.send(message);
-      System.out.println("Sent message: " + message.getText());
-    }
-          </code>
-        </pre>
-        
-        <li>Crash server #0, the live server</li>
-        <pre class="prettyprint">
-          <code>
-    killServer(0);
-          </code>
-        </pre>
-
-        <li>start the connection ready to receive messages</li>
-        <pre class="prettyprint">
-           <code>
-    connection1.start();
-           </code>
-        </pre>
-        
-        <li>create a consumer</li>
-        <pre class="prettyprint">
-           <code>
-    MessageConsumer consumer = session1.createConsumer(queue);
-            </code>
-        </pre>
-
-        <li>Receive and acknowledge all of the sent messages, notice that they will be out of order, this is
-             because they were initially round robined to both nodes then when the server failed were reloaded into the
-             live server.</li>
-        <pre class="prettyprint">
-           <code>
-    TextMessage message0 = null;
-    for (int i = 0; i < numMessages * 2; i++)
-    {
-       message0 = (TextMessage)consumer.receive(5000);
-       System.out.println("Got message: " + message0.getText());
-    }
-    message0.acknowledge();
-           </code>
-        </pre>
-
-
-        </pre> 
-
-        <li>And finally (no pun intended), <b>always</b> remember to close your JMS resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
-
-        <pre class="prettyprint">
-           <code>
-    finally
-    {
-       if (connection != null)
-       {
-       connection.close();
-       }
-
-       if (initialContext != null)
-       {
-       initialContext.close();
-       }
-       if (connection1 != null)
-       {
-       connection1.close();
-       }
-
-       if (initialContext1 != null)
-       {
-       initialContext1.close();
-       }
-    }
-           </code>
-        </pre>
-
-     </ol>
   </body>
 </html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/colocated-failover/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/colocated-failover/pom.xml b/examples/jms/colocated-failover/pom.xml
index a501d38..121b296 100644
--- a/examples/jms/colocated-failover/pom.xml
+++ b/examples/jms/colocated-failover/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -42,64 +43,60 @@ under the License.
          <version>${project.version}</version>
       </dependency>
       <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
       </dependency>
    </dependencies>
 
-   <profiles>
-      <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <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>create1</id>
-                        <goals>
-                           <goal>create</goal>
-                        </goals>
-                        <configuration>
-                           <instance>${basedir}/target/server1</instance>
-                           <configuration>${basedir}/target/classes/activemq/server1</configuration>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>runClient</id>
-                        <goals>
-                           <goal>runClient</goal>
-                        </goals>
-                        <configuration>
-                           <clientClass>org.apache.activemq.artemis.jms.example.ColocatedFailoverExample</clientClass>
-                           <args>
-                              <param>${basedir}/target/server0</param>
-                              <param>${basedir}/target/server1</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>colocated-failover</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
-      </profile>
-   </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <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>create1</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <instance>${basedir}/target/server1</instance>
+                     <configuration>${basedir}/target/classes/activemq/server1</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>runClient</id>
+                  <goals>
+                     <goal>runClient</goal>
+                  </goals>
+                  <configuration>
+                     <clientClass>org.apache.activemq.artemis.jms.example.ColocatedFailoverExample</clientClass>
+                     <args>
+                        <param>${basedir}/target/server0</param>
+                        <param>${basedir}/target/server1</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>colocated-failover</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/colocated-failover/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/colocated-failover/readme.html b/examples/jms/colocated-failover/readme.html
index 9e787d5..dceae4f 100644
--- a/examples/jms/colocated-failover/readme.html
+++ b/examples/jms/colocated-failover/readme.html
@@ -26,6 +26,7 @@ under the License.
   </head>
   <body onload="prettyPrint()">
      <h1>JMS Colocated Failover Shared Store Example</h1>
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory. This example will always spawn and stop multiple servers.</pre>
 
      <p>This example demonstrates how you can colocate live and backup servers in the same VM. We do this by creating an
      HA Policy that is colocated. colocated means that backup servers can be created and maintained by live servers on behalf
@@ -51,143 +52,5 @@ under the License.
      </pre>
      <p>notice that we have used a template to set some sensible defaults but overridden the backup strategy so back ups
      are full servers</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>
-
-     <ol>
-        <li> Get an initial context for looking up JNDI for both servers</li>
-        <pre class="prettyprint">
-           <code>
-    initialContext1 = getContext(1);
-    initialContext = getContext(0);
-   </code>
-        </pre>
-
-        <li>Look up the JMS resources from JNDI</li>
-        <pre class="prettyprint">
-           <code>
-    Queue queue = (Queue)initialContext.lookup("/queue/exampleQueue");
-    ConnectionFactory connectionFactory = (ConnectionFactory)initialContext.lookup("/ConnectionFactory");
-    ConnectionFactory connectionFactory1 = (ConnectionFactory)initialContext1.lookup("/ConnectionFactory");
-           </code>
-        </pre>
-
-        <li>Create a JMS Connections</li>
-        <pre class="prettyprint">
-           <code>
-    connection = connectionFactory.createConnection();
-    connection1 = connectionFactory1.createConnection();
-           </code>
-        </pre>
-
-        <li>Create a *non-transacted* JMS Session with client acknowledgement</li>
-        <pre class="prettyprint">
-           <code>
-    Session session = connection.createSession(false, Session.CLIENT_ACKNOWLEDGE);
-    Session session1 = connection1.createSession(false, Session.CLIENT_ACKNOWLEDGE);
-           </code>
-        </pre>
-
-        <li>Create a JMS MessageProducer</li>
-        <pre class="prettyprint">
-           <code>
-    MessageProducer producer = session.createProducer(queue);
-    MessageProducer producer1 = session1.createProducer(queue);
-           </code>
-        </pre>
-
-        <li>Send some messages to both servers</li>
-        <pre class="prettyprint">
-          <code>
-    for (int i = 0; i < numMessages; i++)
-    {
-      TextMessage message = session.createTextMessage("This is text message " + i);
-      producer.send(message);
-      System.out.println("Sent message: " + message.getText());
-      message = session1.createTextMessage("This is another text message " + i);
-      producer1.send(message);
-      System.out.println("Sent message: " + message.getText());
-    }
-          </code>
-        </pre>
-        
-        <li>Crash server #0, the live server</li>
-        <pre class="prettyprint">
-          <code>
-    killServer(0);
-          </code>
-        </pre>
-
-        <li>start the connection ready to receive messages</li>
-        <pre class="prettyprint">
-           <code>
-    connection1.start();
-           </code>
-        </pre>
-        
-        <li>create a consumer</li>
-        <pre class="prettyprint">
-           <code>
-    MessageConsumer consumer = session1.createConsumer(queue);
-            </code>
-        </pre>
-
-        <li>Receive and acknowledge all of the sent messages, the backup server that is colocated with server 1
-            will have become live and is now handling messages for server 0.</li>
-        <pre class="prettyprint">
-           <code>
-    TextMessage message0 = null;
-    for (int i = 0; i < numMessages; i++)
-    {
-       message0 = (TextMessage)consumer.receive(5000);
-       System.out.println("Got message: " + message0.getText());
-    }
-    message0.acknowledge();
-           </code>
-        </pre>
-
-         <li>Receive and acknowledge the rest of the sent messages from server 1.</li>
-        <pre class="prettyprint">
-           <code>
-   for (int i = 0; i < numMessages; i++)
-   {
-   message0 = (TextMessage)consumer1.receive(5000);
-   System.out.println("Got message: " + message0.getText());
-   }
-   message0.acknowledge();
-           </code>
-        </pre>
-
-        </pre> 
-
-        <li>And finally (no pun intended), <b>always</b> remember to close your JMS resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
-
-        <pre class="prettyprint">
-           <code>
-    finally
-    {
-       if (connection != null)
-       {
-       connection.close();
-       }
-
-       if (initialContext != null)
-       {
-       initialContext.close();
-       }
-       if (connection1 != null)
-       {
-       connection1.close();
-       }
-
-       if (initialContext1 != null)
-       {
-       initialContext1.close();
-       }
-    }
-           </code>
-        </pre>
-
-     </ol>
   </body>
 </html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 b6442a0..32bce35 100644
--- a/examples/jms/consumer-rate-limit/pom.xml
+++ b/examples/jms/consumer-rate-limit/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-consumer-rate-limit-example</artifactId>
+   <artifactId>consumer-rate-limit</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS Consumer Rate Limit Example</name>
 
@@ -37,71 +38,81 @@ under the License.
 
    <dependencies>
       <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
       </dependency>
    </dependencies>
 
    <profiles>
       <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>create</id>
-                        <goals>
-                           <goal>create</goal>
-                        </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.ConsumerRateLimitExample</clientClass>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>cli</goal>
-                        </goals>
-                        <configuration>
-                           <args>
-                              <param>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-consumer-rate-limit-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
+         <!-- specify -PnoServer if you don't want to start the server -->
+         <id>noServer</id>
+         <properties>
+            <noServer>true</noServer>
+         </properties>
       </profile>
    </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <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.ConsumerRateLimitExample</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>consumer-rate-limit</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 6492b37..8b7c9e2 100644
--- a/examples/jms/consumer-rate-limit/readme.html
+++ b/examples/jms/consumer-rate-limit/readme.html
@@ -26,6 +26,7 @@ under the License.
   </head>
   <body onload="prettyPrint()">
      <h1>JMS Message Consumer Rate Limiting</h1>
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
 
      <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 configuring the connection factory. See <code>jndi.properties</code>.</p>
@@ -42,131 +43,5 @@ connectionFactory.ConnectionFactory=tcp://localhost:61616?consumerMaxRate=10
      <p>We then simply consume as many messages as we can in 10 seconds and note how many messages are actually consumed.</p>
      <p>We note that the number of messages consumed per second never exceeds the specified value of <code>10</code> messages per second.</p>
 
-     <p><i>To run the example, simply type <code>mvn verify -Pexample</code> from this directory</i></p>
-
-     <ol>
-        <li>Create an initial context to perform the JNDI lookup.</li>
-        <pre class="prettyprint">
-           <code>initialContext = getContext(0);</code>
-        </pre>
-
-        <li>Perfom a lookup on the queue</li>
-        <pre class="prettyprint">
-           <code>Queue queue = (Queue)initialContext.lookup("/queue/exampleQueue");</code>
-        </pre>
-
-        <li>Perform a lookup on the Connection Factory</li>
-        <pre class="prettyprint">
-           <code>ConnectionFactory cf = (ConnectionFactory)initialContext.lookup("/ConnectionFactory");</code>
-        </pre>
-
-        <li>Create a JMS Connection</li>
-        <pre class="prettyprint">
-           <code>connection = cf.createConnection();</code>
-        </pre>
-
-        <li>Create a JMS Session</li>
-        <pre class="prettyprint">
-           <code>Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);</code>
-        </pre>
-
-        <li>Create a JMS MessageProducer</li>
-        <pre class="prettyprint">
-          <code>MessageProducer producer = session.createProducer(queue);</code>
-        </pre>
-
-        <li>Create a JMS MessageConsumer</li>
-        <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;
-
-   int i = 0;
-
-   long start = System.currentTimeMillis();
-
-   while (System.currentTimeMillis() - start <= duration)
-   {
-      TextMessage message = (TextMessage)consumer.receive(2000);
-
-      if (message == null)
-      {
-         return false;
-      }
-
-      i++;
-   }
-
-   long end = System.currentTimeMillis();
-
-   double rate = 1000 * (double)i / (end - start);
-
-   System.out.println("We consumed " + i + " messages in " + (end - start) + " milliseconds");
-
-   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>
-
-        <li>Be sure to close our resources!</li>
-
-        <pre class="prettyprint">
-           <code>
-           finally
-           {
-              if (initialContext != null)
-              {
-                initialContext.close();
-              }
-
-              if (connection != null)
-              {
-                 connection.close();
-              }
-           }</code>
-        </pre>
-
-
-
-     </ol>
   </body>
 </html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/dead-letter/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/dead-letter/pom.xml b/examples/jms/dead-letter/pom.xml
index 94f2c4c..5a39fd4 100644
--- a/examples/jms/dead-letter/pom.xml
+++ b/examples/jms/dead-letter/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-dead-letter-example</artifactId>
+   <artifactId>dead-letter</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS Dead Letter Example</name>
 
@@ -37,71 +38,82 @@ under the License.
 
    <dependencies>
       <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
       </dependency>
    </dependencies>
 
    <profiles>
       <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>create</id>
-                        <goals>
-                           <goal>create</goal>
-                        </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.DeadLetterExample</clientClass>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>cli</goal>
-                        </goals>
-                        <configuration>
-                           <args>
-                              <param>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-dead-letter-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
+         <!-- specify -PnoServer if you don't want to start the server -->
+         <id>noServer</id>
+         <properties>
+            <noServer>true</noServer>
+         </properties>
       </profile>
    </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                     <ignore>${noServer}</ignore>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <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.DeadLetterExample</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>dead-letter</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>


[02/18] activemq-artemis git commit: ARTEMIS-180 removing -Pexample and some other improvements around the examples

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/transactional/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/transactional/pom.xml b/examples/jms/transactional/pom.xml
index 9029124..82bde8a 100644
--- a/examples/jms/transactional/pom.xml
+++ b/examples/jms/transactional/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-transactional-example</artifactId>
+   <artifactId>transactional</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS Transactional Example</name>
 
@@ -37,71 +38,81 @@ under the License.
 
    <dependencies>
       <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
       </dependency>
    </dependencies>
 
    <profiles>
       <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>create</id>
-                        <goals>
-                           <goal>create</goal>
-                        </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.TransactionalExample</clientClass>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>cli</goal>
-                        </goals>
-                        <configuration>
-                           <args>
-                              <param>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-transactional-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
+         <!-- specify -PnoServer if you don't want to start the server -->
+         <id>noServer</id>
+         <properties>
+            <noServer>true</noServer>
+         </properties>
       </profile>
    </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <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.TransactionalExample</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>transactional</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/transactional/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/transactional/readme.html b/examples/jms/transactional/readme.html
index a7517c5..a988c27 100644
--- a/examples/jms/transactional/readme.html
+++ b/examples/jms/transactional/readme.html
@@ -27,122 +27,14 @@ under the License.
   <body onload="prettyPrint()">
      <h1>JMS Transactional Session Example</h1>
 
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
+
+
      <p>This example shows you how to use a transacted Session with ActiveMQ Artemis.</p>
      <p>Firstly 2 messages are sent via the transacted sending session before being committed. This ensures that both message
      are sent</p>
      <p>Secondly the receiving session receives the messages firstly demonstrating a message being redelivered after the session
      being rolled back and then acknowledging receipt of the messages via the commit method.</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>
-
-     <ol>
-        <li>First we need to get an initial context so we can look-up the JMS connection factory and destination objects from JNDI. This initial context will get it's properties from the <code>client-jndi.properties</code> file in the directory <code>../common/config</code></li>
-        <pre class="prettyprint">
-           <code>initialContext = getContext();</code>
-        </pre>
-
-        <li>We look-up the JMS queue object from JNDI</li>
-        <pre class="prettyprint">
-           <code>Queue queue = (Queue) initialContext.lookup("/queue/exampleQueue");</code>
-        </pre>
-
-        <li>We look-up the JMS connection factory object from JNDI</li>
-        <pre class="prettyprint">
-           <code>ConnectionFactory cf = (ConnectionFactory) initialContext.lookup("/ConnectionFactory");</code>
-        </pre>
-
-        <li>We create a JMS connection</li>
-        <pre class="prettyprint">
-           <code>connection = cf.createConnection();</code>
-        </pre>
-         
-        <li>We start the connection. In order for delivery to occur on any consumers or subscribers on a connection, the connection must be started</li>
-        <pre class="prettyprint">
-           <code>connection.start();</code>
-        </pre>
-         
-        <li>We create a JMS session. The session is created as transacted.</li>
-        <pre class="prettyprint">
-           <code>Session session = connection.createSession(true, Session.SESSION_TRANSACTED);</code>
-        </pre>
-
-        <li>We create a JMS message producer on the session. This will be used to send the messages.</li>
-	<pre class="prettyprint">
-	   <code>MessageProducer messageProducer = session.createProducer(queue);</code>
-        </pre>
-
-        <li>We create a message consumer</li>
-	<pre class="prettyprint">
-	   <code>MessageConsumer messageConsumer = session.createConsumer(queue);</code>
-        </pre>
-
-        <li>We create 2 text messages</li>
-	<pre class="prettyprint">
-           <code>TextMessage message1 = session.createTextMessage("This is a text message1");</code>
-           <code>TextMessage message2 = session.createTextMessage("This is a text message2");</code>
-        </pre>
-   
-        <li>We send the text messages to the queue</li>
-        <pre class="prettyprint">
-           <code>messageProducer.send(message1);</code>
-           <code>messageProducer.send(message2);</code>
-        </pre>
-
-        <li>We receive the message, it will return null as the transaction is not committed.</li>
-        <pre class="prettyprint">
-           <code>TextMessage receivedMessage = (TextMessage) messageConsumer.receive(5000);</code>
-        </pre>
-
-        <li>We commit the session</li>
-	<pre class="prettyprint">
-           <code>session.commit();</code>
-        </pre>
-         
-        <li>We receive the messages again</li>
-        <pre class="prettyprint">
-           <code>receivedMessage = (TextMessage) messageConsumer.receive(5000);</code>
-        </pre>
-
-        <li>We roll back the session, this will cause the received message canceled and redelivered again</li>
-        <pre class="prettyprint"> 
-           <code>session.rollback();</code>
-        </pre>
-
-        <li>We receive the message again, we will get two messages. Nothing more, nothing less</li>
-        <pre class="prettyprint"> 
-           <code>receivedMessage = (TextMessage) messageConsumer.receive(5000);</code>
-           <code>receivedMessage = (TextMessage) messageConsumer.receive(5000);</code>
-        </pre>
-
-        <li>We commit the session</li>
-        <pre class="prettyprint"> 
-           <code>session.commit();</code>
-        </pre>
-
-        <li>We receive the message again. Nothing should be received</li>
-        <pre class="prettyprint"> 
-           <code>receivedMessage = (TextMessage) messageConsumer.receive(5000);</code>
-        </pre>
-
-
-        <li>And finally, <b>always</b> remember to close your JMS connections and resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
 
-        <pre class="prettyprint">
-           <code>finally
-           {
-              if (initialContext != null)
-              {
-                initialContext.close();
-              }
-              if (connection != null)
-              {
-                 connection.close();
-              }
-           }</code>
-        </pre>
-         
-     </ol>
   </body>
 </html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/xa-heuristic/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/xa-heuristic/pom.xml b/examples/jms/xa-heuristic/pom.xml
index ada7aaf..3ea0740 100644
--- a/examples/jms/xa-heuristic/pom.xml
+++ b/examples/jms/xa-heuristic/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-xa-heuristic-example</artifactId>
+   <artifactId>xa-heuristic</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS XAHeuristicExample Example</name>
 
@@ -38,83 +39,83 @@ under the License.
    <dependencies>
       <dependency>
          <groupId>org.apache.activemq</groupId>
-         <artifactId>artemis-core-client</artifactId>
+         <artifactId>artemis-jms-client</artifactId>
          <version>${project.version}</version>
       </dependency>
-      <dependency>
-         <groupId>org.apache.activemq</groupId>
-         <artifactId>artemis-commons</artifactId>
-         <version>${project.version}</version>
-      </dependency>
-      <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
-      </dependency>
    </dependencies>
 
    <profiles>
       <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>create</id>
-                        <goals>
-                           <goal>create</goal>
-                        </goals>
-                        <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>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-xa-heuristic-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
+         <!-- specify -PnoServer if you don't want to start the server -->
+         <id>noServer</id>
+         <properties>
+            <noServer>true</noServer>
+         </properties>
       </profile>
    </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <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>
+                     <ignore>${noServer}</ignore>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <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>
+                     <ignore>${noServer}</ignore>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>xa-heuristic</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/xa-heuristic/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/xa-heuristic/readme.html b/examples/jms/xa-heuristic/readme.html
index 9ca84b0..c026def 100644
--- a/examples/jms/xa-heuristic/readme.html
+++ b/examples/jms/xa-heuristic/readme.html
@@ -26,222 +26,23 @@ under the License.
   </head>
   <body onload="prettyPrint()">
      <h1>JMS XA Heuristic Example</h1>
+
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
+
      <p>This example shows you how to make an XA heuristic decision through the ActiveMQ Artemis Management Interface.</p>
-     
-     <p>A heuristic decision is a unilateral decision to commit or rollback an XA transaction branch after it has 
+
+     <p>A heuristic decision is a unilateral decision to commit or rollback an XA transaction branch after it has
      been prepared. </p>
-     
+
      <p>In this example we simulate a transaction manager to control the transactions. First we create an XASession
      and enlist it in a transaction through its XAResource. We then send a text message, 'hello' and end/prepare the transaction
      on the XAResource, but neither commit nor roll back the transaction. Another transaction is created and
      associated with the same XAResource, and a second message, 'world' is sent on behalf of the second transaction. Again we leave
-     the second transaction in prepare state. 
-     Then we get the MBeanServerConnection object to manipulate the prepared transactions. To illustrate, we roll back the first 
+     the second transaction in prepare state.
+     Then we get the MBeanServerConnection object to manipulate the prepared transactions. To illustrate, we roll back the first
      transaction but commit the second. This will result in that only the message 'world' is received. </p>
 
      <p>This example uses JMX to manipulate transactions in a ActiveMQ Artemis Server. For details on JMX facilities with ActiveMQ Artemis,
      please look at the JMX Example.</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>
-     <ol>
-        <li>First we need to get an initial context so we can look-up the JMS connection factory and destination objects from JNDI. This initial context will get it's properties from the <code>client-jndi.properties</code> file in the directory <code>../common/config</code></li>
-        <pre class="prettyprint">
-           <code>InitialContext initialContext = getContext(0);</code>
-        </pre>
-
-        <li>We look-up the JMS queue object from JNDI</li>
-        <pre class="prettyprint">
-           <code>Queue queue = (Queue) initialContext.lookup("/queue/exampleQueue");</code>
-        </pre>
-
-        <li>We perform a lookup on the XA Connection Factory</li>
-        <pre class="prettyprint">
-           <code>XAConnectionFactory cf = (XAConnectionFactory) initialContext.lookup("/XAConnectionFactory");</code>
-        </pre>
-
-        <li>We create a JMS XAConnection</li>
-        <pre class="prettyprint">
-           <code>connection = cf.createXAConnection();</code>
-        </pre>
-
-        <li>We Start the connection</li>
-        <pre class="prettyprint">
-           <code>connection.start();</code>
-        </pre>
-
-        <li>We create a JMS XASession</li>
-        <pre class="prettyprint">
-          <code>XASession xaSession = connection.createXASession();</code>
-       </pre>
-
-        <li>We create a normal session</li>
-        <pre class="prettyprint">
-          <code>Session normalSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);</code>
-       </pre>
-
-        <li>We create a normal Message Consumer</li>
-        <pre class="prettyprint">
-           <code>
-           MessageConsumer normalConsumer = normalSession.createConsumer(queue);
-           normalConsumer.setMessageListener(new SimpleMessageListener());
-           </code>
-       </pre>
-
-        <li>We get the JMS Session</li>
-        <pre class="prettyprint">
-          <code>Session session = xaSession.getSession();</code>
-       </pre>
-
-        <li>We create a message producer</li>
-        <pre class="prettyprint">
-          <code>MessageProducer producer = session.createProducer(queue); </code>
-       </pre>
-
-        <li>We create two Text Messages</li>
-        <pre class="prettyprint">
-          <code>
-          TextMessage helloMessage = session.createTextMessage("hello");
-          TextMessage worldMessage = session.createTextMessage("world");
-          </code>
-       </pre>
-
-        <li>We create a transaction</li>
-        <pre class="prettyprint">
-          <code>Xid xid1 = new XidImpl("xa-example1".getBytes(), 1, UUIDGenerator.getInstance().generateStringUUID().getBytes());</code>
-       </pre>
-
-        <li>We get the JMS XAResource</li>
-        <pre class="prettyprint">
-          <code>XAResource xaRes = xaSession.getXAResource();</code>
-       </pre>
-
-        <li>We begin the Transaction work</li>
-        <pre class="prettyprint">
-          <code>xaRes.start(xid1, XAResource.TMNOFLAGS);</code>
-       </pre>
-
-        <li>We do work, sending hello message.</li>
-        <pre class="prettyprint">
-          <code>
-          normalProducer.send(helloMessage);
-          </code>
-       </pre>
-
-        <li>We stop the work for xid1</li>
-        <pre class="prettyprint">
-          <code>xaRes.end(xid1, XAResource.TMSUCCESS);</code>
-       </pre>
-
-        <li>We prepare xid1</li>
-        <pre class="prettyprint">
-          <code>xaRes.prepare(xid1);</code>
-       </pre>
-
-        <li>We check the none should be received.</li>
-        <pre class="prettyprint">
-          <code>checkNoMessageReceived();</code>
-       </pre>
-
-        <li>We create another transaction </li>
-        <pre class="prettyprint">
-          <code>Xid xid2 = new XidImpl("xa-example2".getBytes(), 1, UUIDGenerator.getInstance().generateStringUUID().getBytes());</code>
-       </pre>
-
-        <li>We begin the transaction work</li>
-        <pre class="prettyprint">
-          <code>xaRes.start(xid2, XAResource.TMNOFLAGS);</code>
-       </pre>
-
-        <li>We send the second message</li>
-        <pre class="prettyprint">
-           <code>producer.send(worldMessage);</code>
-       </pre>
-
-        <li>We stop the work for xid2</li>
-        <pre class="prettyprint">
-          <code>xaRes.end(xid2, XAResource.TMSUCCESS);</code>
-       </pre>
-
-        <li>We prepare xid2</li>
-        <pre class="prettyprint">
-          <code>xaRes.prepare(xid2);</code>
-       </pre>
-
-       <li>Again, no messages should be received!</li>
-       <pre class="prettyprint">
-          <code>checkNoMessageReceived();</code>
-       </pre>
-
-        <li>We create JMX Connector to connect to the server's MBeanServer.</li>
-        <pre class="prettyprint">
-          <code>
-          JMXConnector connector = JMXConnectorFactory.connect(new JMXServiceURL(JMX_URL), new HashMap<String, String>());
-          </code>
-       </pre>
-
-        <li>We retrieve the MBeanServerConnection</li>
-        <pre class="prettyprint">
-          <code>MBeanServerConnection mbsc = connector.getMBeanServerConnection();</code>
-       </pre>
-
-        <li>We list the prepared transactions</li>
-        <pre class="prettyprint">
-          <code>
-          ObjectName serverObject = ObjectNameBuilder.DEFAULT.getMessagingServerObjectName();
-          String[] infos = (String[])mbsc.invoke(serverObject, "listPreparedTransactions", null, null);
-         
-          System.out.println("Prepared transactions: ");
-          for (String i : infos)
-          {
-             System.out.println(i);
-          }
-          </code>
-       </pre>
-
-        <li>We roll back the first transaction</li>
-        <pre class="prettyprint">
-          <code>mbsc.invoke(serverObject, "rollbackPreparedTransaction", new String[] {XidImpl.toBase64String(xid1)}, new String[]{"java.lang.String"});</code>
-       </pre>
-
-        <li>We commit the second one</li>
-        <pre class="prettyprint">
-          <code>mbsc.invoke(serverObject, "commitPreparedTransaction", new String[] {XidImpl.toBase64String(xid2)}, new String[]{"java.lang.String"});</code>
-       </pre>
-
-        <li>We check the result, only the 'world' message received</li>
-        <pre class="prettyprint">
-          <code>checkMessageReceived("world");</code>
-       </pre>
-
-        <li>We check the prepared transaction again, should have none.</li>
-        <pre class="prettyprint">
-          <code>
-          infos = (String[])mbsc.invoke(serverObject, "listPreparedTransactions", null, null);
-          System.out.println("No. of prepared transactions now: " + infos.length);
-          </code>
-       </pre>
-
-        <li>We close the JMX connector.</li>
-        <pre class="prettyprint">
-          <code>connector.close();</code>
-       </pre>
-       
-        <li>And finally, <b>always</b> remember to close your JMS connections and resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
-
-        <pre class="prettyprint">
-           <code>finally
-           {
-              if (initialContext != null)
-              {
-                initialContext.close();
-              }
-              if (connection != null)
-              {
-                 connection.close();
-              }
-           }</code>
-        </pre>
-     </ol>
   </body>
 </html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/xa-receive/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/xa-receive/pom.xml b/examples/jms/xa-receive/pom.xml
index 8336c5f..c7b7da8 100644
--- a/examples/jms/xa-receive/pom.xml
+++ b/examples/jms/xa-receive/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-xa-receive-example</artifactId>
+   <artifactId>xa-receive</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS XA Receive Example</name>
 
@@ -38,76 +39,80 @@ under the License.
    <dependencies>
       <dependency>
          <groupId>org.apache.activemq</groupId>
-         <artifactId>artemis-commons</artifactId>
+         <artifactId>artemis-jms-client</artifactId>
          <version>${project.version}</version>
       </dependency>
-      <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
-      </dependency>
    </dependencies>
 
    <profiles>
       <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>create</id>
-                        <goals>
-                           <goal>create</goal>
-                        </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.XAReceiveExample</clientClass>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>cli</goal>
-                        </goals>
-                        <configuration>
-                           <args>
-                              <param>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-xa-receive-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
+         <!-- specify -PnoServer if you don't want to start the server -->
+         <id>noServer</id>
+         <properties>
+            <noServer>true</noServer>
+         </properties>
       </profile>
    </profiles>
-
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <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.XAReceiveExample</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>xa-receive</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/xa-receive/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/xa-receive/readme.html b/examples/jms/xa-receive/readme.html
index 0d24cde..47f2fef 100644
--- a/examples/jms/xa-receive/readme.html
+++ b/examples/jms/xa-receive/readme.html
@@ -26,197 +26,23 @@ under the License.
   </head>
   <body onload="prettyPrint()">
      <h1>JMS XA Receive Example</h1>
+
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
+
+
      <p>This example demonstrates receiving a message within the scope of an XA transaction. When using an XA transaction
          the message will only be acknowledged and removed from the queue when the transaction is committed.
      If the transaction is not committed the message maybe redelivered after rollback or during XA recovery.</p>
-     
+
      <p>ActiveMQ Artemis is JTA aware, meaning you can use ActiveMQ Artemis in an XA transactional environment
      and participate in XA transactions. It provides the javax.transaction.xa.XAResource interface for that
      purpose. Users can get a XAConnectionFactory to create XAConnections and XASessions.</p>
-     
+
      <p>In this example we simulate a transaction manager to control the transactions. First we create an XASession
       for receiving and a normal session for sending. Then we start a new xa transaction and enlist the receiving
-      XASession through its XAResource. We then send two words, 'hello' and 'world', receive them, and let the 
+      XASession through its XAResource. We then send two words, 'hello' and 'world', receive them, and let the
       transaction roll back. The received messages are cancelled back to the queue. Next we start
-      a new transaction with the same XAResource enlisted, but this time we commit the transaction after receiving the 
+      a new transaction with the same XAResource enlisted, but this time we commit the transaction after receiving the
       messages. Then we check that no more messages are to be received.</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>
-     <ol>
-        <li>First we need to get an initial context so we can look-up the JMS connection factory and destination objects from JNDI. This initial context will get it's properties from the <code>client-jndi.properties</code> file in the directory <code>../common/config</code></li>
-        <pre class="prettyprint">
-           <code>InitialContext initialContext = getContext(0);</code>
-        </pre>
-
-        <li>We look-up the JMS queue object from JNDI</li>
-        <pre class="prettyprint">
-           <code>Queue queue = (Queue) initialContext.lookup("/queue/exampleQueue");</code>
-        </pre>
-
-        <li>We perform a lookup on the XA Connection Factory</li>
-        <pre class="prettyprint">
-           <code>XAConnectionFactory cf = (XAConnectionFactory) initialContext.lookup("/XAConnectionFactory");</code>
-        </pre>
-
-        <li>We create a JMS XAConnection</li>
-        <pre class="prettyprint">
-           <code>connection = cf.createXAConnection();</code>
-        </pre>
-
-        <li>We Start the connection</li>
-        <pre class="prettyprint">
-           <code>connection.start();</code>
-        </pre>
-
-        <li>We create a JMS XASession</li>
-        <pre class="prettyprint">
-          <code>XASession xaSession = connection.createXASession();</code>
-       </pre>
-
-        <li>We create a normal session</li>
-        <pre class="prettyprint">
-          <code>Session normalSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);</code>
-       </pre>
-
-        <li>We create a normal Message Producer</li>
-        <pre class="prettyprint">
-           <code>
-           MessageProducer normalProducer = normalSession.createProducer(queue);
-           </code>
-       </pre>
-
-        <li>We get the JMS Session</li>
-        <pre class="prettyprint">
-          <code>Session session = xaSession.getSession();</code>
-       </pre>
-
-        <li>We create a message consumer</li>
-        <pre class="prettyprint">
-          <code>MessageConsumer xaConsumer = session.createConsumer(queue); </code>
-       </pre>
-
-        <li>We create two Text Messages</li>
-        <pre class="prettyprint">
-          <code>
-          TextMessage helloMessage = session.createTextMessage("hello");
-          TextMessage worldMessage = session.createTextMessage("world");
-          </code>
-       </pre>
-
-        <li>We create a transaction</li>
-        <pre class="prettyprint">
-          <code>Xid xid1 = new XidImpl("xa-example1".getBytes(), 1, UUIDGenerator.getInstance().generateStringUUID().getBytes());</code>
-       </pre>
-
-        <li>We get the JMS XAResource</li>
-        <pre class="prettyprint">
-          <code>XAResource xaRes = xaSession.getXAResource();</code>
-       </pre>
-
-        <li>We begin the Transaction work</li>
-        <pre class="prettyprint">
-          <code>xaRes.start(xid1, XAResource.TMNOFLAGS);</code>
-       </pre>
-
-        <li>We send two messages.</li>
-        <pre class="prettyprint">
-          <code>
-         normalProducer.send(helloMessage);
-         normalProducer.send(worldMessage);
-          </code>
-       </pre>
-
-        <li>We receive the messages</li>
-        <pre class="prettyprint">
-          <code>
-          TextMessage rm1 = (TextMessage)xaConsumer.receive();
-          System.out.println("Message received: " + rm1.getText());
-          TextMessage rm2 = (TextMessage)xaConsumer.receive();
-          System.out.println("Message received: " + rm2.getText());
-          </code>
-       </pre>
-
-        <li>We stop the work</li>
-        <pre class="prettyprint">
-          <code>xaRes.end(xid1, XAResource.TMSUCCESS);</code>
-       </pre>
-
-        <li>We prepare</li>
-        <pre class="prettyprint">
-          <code>xaRes.prepare(xid1);</code>
-       </pre>
-
-        <li>We roll back the transaction </li>
-        <pre class="prettyprint">
-          <code>xaRes.rollback(xid1);</code>
-       </pre>
-
-        <li>We create another transaction </li>
-        <pre class="prettyprint">
-          <code>Xid xid2 = new XidImpl("xa-example2".getBytes(), 1, UUIDGenerator.getInstance().generateStringUUID().getBytes());</code>
-       </pre>
-
-        <li>We start the transaction</li>
-        <pre class="prettyprint">
-          <code>xaRes.start(xid2, XAResource.TMNOFLAGS);</code>
-       </pre>
-
-        <li>We receive those messages again</li>
-        <pre class="prettyprint">
-           <code>
-           rm1 = (TextMessage)xaConsumer.receive();
-           System.out.println("Message received again: " + rm1.getText());
-           rm2 = (TextMessage)xaConsumer.receive();
-           System.out.println("Message received again: " + rm2.getText());
-            </code>
-       </pre>
-
-        <li>We stop the work</li>
-        <pre class="prettyprint">
-          <code>xaRes.end(xid2, XAResource.TMSUCCESS);</code>
-       </pre>
-
-        <li>We prepare</li>
-        <pre class="prettyprint">
-          <code>xaRes.prepare(xid2);</code>
-       </pre>
-
-       <li>We commit!</li>
-       <pre class="prettyprint">
-          <code>xaRes.commit(xid2, false);</code>
-       </pre>
-
-        <li>We check that no more messages are received.</li>
-        <pre class="prettyprint">
-          <code>
-          TextMessage rm3 = (TextMessage)xaConsumer.receive(2000);
-          if (rm3 == null)
-          {
-             System.out.println("No message received after commit.");
-          }
-          else
-          {
-             result = false;
-          }
-          </code>
-       </pre>
-
-        <li>And finally, <b>always</b> remember to close your JMS connections and resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
-
-        <pre class="prettyprint">
-           <code>finally
-           {
-              if (initialContext != null)
-              {
-                initialContext.close();
-              }
-              if (connection != null)
-              {
-                 connection.close();
-              }
-           }</code>
-        </pre>
-     </ol>
   </body>
 </html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/xa-send/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/xa-send/pom.xml b/examples/jms/xa-send/pom.xml
index 3038202..cc6ab8f 100644
--- a/examples/jms/xa-send/pom.xml
+++ b/examples/jms/xa-send/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-xa-send-example</artifactId>
+   <artifactId>xa-send</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS XA Send Example</name>
 
@@ -38,74 +39,80 @@ under the License.
    <dependencies>
       <dependency>
          <groupId>org.apache.activemq</groupId>
-         <artifactId>artemis-commons</artifactId>
+         <artifactId>artemis-jms-client</artifactId>
          <version>${project.version}</version>
       </dependency>
-      <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
-      </dependency>
    </dependencies>
 
    <profiles>
       <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>create</id>
-                        <goals>
-                           <goal>create</goal>
-                        </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.XASendExample</clientClass>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>cli</goal>
-                        </goals>
-                        <configuration>
-                           <args>
-                              <param>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-xa-send-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
+         <!-- specify -PnoServer if you don't want to start the server -->
+         <id>noServer</id>
+         <properties>
+            <noServer>true</noServer>
+         </properties>
       </profile>
    </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <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.XASendExample</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>xa-send</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
+
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/pom.xml
----------------------------------------------------------------------
diff --git a/examples/pom.xml b/examples/pom.xml
index 1371354..456023a 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -60,6 +60,7 @@ under the License.
       </pluginRepository>
    </pluginRepositories>
 
+   <!-- You need to activate -Pexamples to run all the examples -->
    <modules>
       <module>core</module>
       <module>jms</module>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 28d48ef..f11c018 100644
--- a/pom.xml
+++ b/pom.xml
@@ -563,7 +563,6 @@
             <module>integration/activemq-spring-integration</module>
             <module>integration/activemq-aerogear-integration</module>
             <module>integration/activemq-vertx-integration</module>
-            <module>examples</module>
             <module>tests</module>
             <module>artemis-distribution</module>
          </modules>


[17/18] activemq-artemis git commit: ARTEMIS-180 removing -Pexample and some other improvements around the examples

Posted by cl...@apache.org.
ARTEMIS-180 removing -Pexample and some other improvements around the examples


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

Branch: refs/heads/master
Commit: dd8203185ba081df233f6e6526aec18fc9b3c694
Parents: 138bfe9
Author: Clebert Suconic <cl...@apache.org>
Authored: Wed Aug 5 15:33:20 2015 -0400
Committer: Clebert Suconic <cl...@apache.org>
Committed: Fri Aug 7 15:17:28 2015 -0400

----------------------------------------------------------------------
 .../artemis/cli/commands/ActionContext.java     |   6 +-
 .../activemq/artemis/cli/commands/Create.java   |  53 +-
 .../artemis/cli/commands/InputAbstract.java     |   2 +-
 .../cli/commands/tools/XmlDataExporter.java     |   2 +-
 .../artemis/cli/commands/etc/broker.xml         |   2 +-
 .../apache/activemq/cli/test/ArtemisTest.java   |  30 +-
 .../core/client/ActiveMQClientLogger.java       |   2 +-
 .../src/main/resources/README.html              |   2 +-
 .../artemis/maven/ActiveMQClientPlugin.java     |  65 ---
 .../artemis/maven/ActiveMQCreatePlugin.java     | 343 ------------
 .../artemis/maven/ArtemisAbstractPlugin.java    |  48 ++
 .../artemis/maven/ArtemisCLIPlugin.java         |  16 +-
 .../artemis/maven/ArtemisClientPlugin.java      |  65 +++
 .../artemis/maven/ArtemisCreatePlugin.java      | 364 +++++++++++++
 .../artemis/maven/LibInstallPlugin.java         | 147 -----
 docs/user-manual/en/using-server.md             |   4 +-
 examples/core/embedded/pom.xml                  |   5 -
 examples/core/embedded/readme.html              |   2 +-
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 examples/core/pom.xml                           |   3 +-
 examples/jms/README.md                          |  13 +-
 examples/jms/aerogear/pom.xml                   | 157 +++---
 examples/jms/aerogear/readme.html               |   3 +
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 examples/jms/application-layer-failover/pom.xml | 113 ++--
 .../jms/application-layer-failover/readme.html  |  15 +-
 .../ApplicationLayerFailoverExample.java        |  40 +-
 examples/jms/bridge/pom.xml                     | 227 ++++----
 examples/jms/bridge/readme.html                 | 162 +-----
 examples/jms/browser/pom.xml                    | 135 ++---
 examples/jms/browser/readme.html                | 113 +---
 .../jms/example/QueueBrowserExample.java        |   3 +
 examples/jms/client-kickoff/pom.xml             | 142 ++---
 examples/jms/client-kickoff/readme.html         | 106 +---
 .../jms/client-side-failoverlistener/pom.xml    | 126 ++---
 .../client-side-failoverlistener/readme.html    |  78 +--
 examples/jms/client-side-load-balancing/pom.xml | 302 ++++++-----
 .../jms/client-side-load-balancing/readme.html  | 127 +----
 .../jms/clustered-durable-subscription/pom.xml  | 227 ++++----
 .../clustered-durable-subscription/readme.html  | 155 +-----
 .../ClusteredDurableSubscriptionExample.java    |  62 +--
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 .../main/resources/activemq/server1/broker.xml  |   8 +-
 examples/jms/clustered-grouping/pom.xml         | 299 +++++-----
 examples/jms/clustered-grouping/readme.html     | 190 +------
 .../jms/example/ClusteredGroupingExample.java   |  91 +---
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 .../main/resources/activemq/server1/broker.xml  |   8 +-
 .../main/resources/activemq/server2/broker.xml  |   8 +-
 examples/jms/clustered-jgroups/pom.xml          | 235 ++++----
 examples/jms/clustered-jgroups/readme.html      | 150 +----
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 .../main/resources/activemq/server1/broker.xml  |   8 +-
 examples/jms/clustered-queue/pom.xml            | 220 ++++----
 examples/jms/clustered-queue/readme.html        | 144 +----
 .../jms/example/ClusteredQueueExample.java      |  43 +-
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 examples/jms/clustered-standalone/pom.xml       | 188 -------
 examples/jms/clustered-standalone/readme.html   |  70 ---
 .../jms/example/ClusteredStandaloneExample.java | 181 -------
 .../main/resources/activemq/server0/broker.xml  |  95 ----
 .../main/resources/activemq/server1/broker.xml  |  95 ----
 .../main/resources/activemq/server2/broker.xml  |  95 ----
 examples/jms/clustered-static-discovery/pom.xml | 376 +++++++------
 .../jms/clustered-static-discovery/readme.html  | 143 +----
 .../example/StaticClusteredQueueExample.java    |  30 +-
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 .../main/resources/activemq/server1/broker.xml  |   8 +-
 .../main/resources/activemq/server2/broker.xml  |   8 +-
 .../main/resources/activemq/server3/broker.xml  |   8 +-
 examples/jms/clustered-static-oneway/pom.xml    | 299 +++++-----
 .../jms/clustered-static-oneway/readme.html     | 186 +------
 .../jms/example/ClusterStaticOnewayExample.java |  28 +-
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 .../main/resources/activemq/server1/broker.xml  |   8 +-
 .../main/resources/activemq/server2/broker.xml  |   8 +-
 examples/jms/clustered-topic/pom.xml            | 223 ++++----
 examples/jms/clustered-topic/readme.html        | 140 +----
 .../jms/example/ClusteredTopicExample.java      |  46 +-
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 .../main/resources/activemq/server1/broker.xml  |   8 +-
 .../jms/colocated-failover-scale-down/pom.xml   | 115 ++--
 .../colocated-failover-scale-down/readme.html   | 130 +----
 examples/jms/colocated-failover/pom.xml         | 113 ++--
 examples/jms/colocated-failover/readme.html     | 139 +----
 examples/jms/consumer-rate-limit/pom.xml        | 133 ++---
 examples/jms/consumer-rate-limit/readme.html    | 127 +----
 examples/jms/dead-letter/pom.xml                | 134 ++---
 examples/jms/dead-letter/readme.html            | 168 +-----
 examples/jms/delayed-redelivery/pom.xml         | 134 ++---
 examples/jms/delayed-redelivery/readme.html     | 139 +----
 examples/jms/divert/pom.xml                     | 223 ++++----
 examples/jms/divert/readme.html                 | 321 +----------
 .../artemis/jms/example/DivertExample.java      |  46 +-
 examples/jms/durable-subscription/pom.xml       | 134 ++---
 examples/jms/durable-subscription/readme.html   | 124 +----
 examples/jms/embedded-simple/pom.xml            |  67 ++-
 examples/jms/embedded/pom.xml                   |  67 ++-
 examples/jms/embedded/readme.html               |  71 +--
 examples/jms/expiry/pom.xml                     | 134 ++---
 examples/jms/expiry/readme.html                 | 149 +----
 examples/jms/ha-policy-autobackup/pom.xml       | 113 ++--
 .../jms/example/HAPolicyAutoBackupExample.java  |  41 +-
 examples/jms/http-transport/pom.xml             | 134 ++---
 examples/jms/http-transport/readme.html         |  89 +--
 .../jms/example/HttpTransportExample.java       |  17 +-
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 .../src/main/resources/jndi.properties          |  20 -
 .../jms/instantiate-connection-factory/pom.xml  | 139 ++---
 .../instantiate-connection-factory/readme.html  |  96 +---
 .../InstantiateConnectionFactoryExample.java    |  20 +-
 examples/jms/interceptor/pom.xml                | 134 ++---
 examples/jms/interceptor/readme.html            | 110 +---
 examples/jms/jms-auto-closeable/pom.xml         | 130 ++---
 examples/jms/jms-auto-closeable/readme.html     |   3 +-
 .../jms/example/JMSAutoCloseableExample.java    |  58 +-
 examples/jms/jms-bridge/pom.xml                 | 222 ++++----
 examples/jms/jms-bridge/readme.html             |   3 +
 examples/jms/jms-completion-listener/pom.xml    | 134 ++---
 .../jms/jms-completion-listener/readme.html     |   3 +-
 .../example/JMSCompletionListenerExample.java   |  16 +-
 examples/jms/jms-context/pom.xml                | 133 ++---
 examples/jms/jms-context/readme.html            |  62 +--
 .../artemis/jms/example/JMSContextExample.java  |  47 +-
 .../src/main/resources/jndi.properties          |  20 -
 examples/jms/jms-shared-consumer/pom.xml        | 135 ++---
 examples/jms/jms-shared-consumer/readme.html    |   3 +-
 examples/jms/jmx/pom.xml                        | 140 ++---
 examples/jms/jmx/readme.html                    |  33 +-
 examples/jms/large-message/pom.xml              |  85 ++-
 examples/jms/large-message/readme.html          |  28 +-
 examples/jms/last-value-queue/pom.xml           | 133 ++---
 examples/jms/last-value-queue/readme.html       |  25 +-
 .../jms/example/LastValueQueueExample.java      |  26 +-
 examples/jms/management-notifications/pom.xml   | 133 ++---
 .../jms/management-notifications/readme.html    |  40 +-
 examples/jms/management/pom.xml                 | 132 ++---
 examples/jms/message-counters/pom.xml           | 142 ++---
 examples/jms/message-counters/readme.html       |  35 +-
 examples/jms/message-group/pom.xml              | 133 ++---
 examples/jms/message-group/readme.html          |  13 +-
 .../jms/example/MessageGroupExample.java        |  23 +-
 examples/jms/message-group2/pom.xml             | 133 ++---
 examples/jms/message-group2/readme.html         |  14 +-
 .../jms/example/MessageGroup2Example.java       |  22 +-
 .../src/main/resources/jndi.properties          |  20 -
 examples/jms/message-priority/pom.xml           | 133 ++---
 examples/jms/message-priority/readme.html       |  19 +-
 .../jms/example/MessagePriorityExample.java     |  14 +-
 .../src/main/resources/jndi.properties          |  20 -
 examples/jms/multiple-failover-failback/pom.xml | 148 +++--
 examples/jms/multiple-failover/pom.xml          | 148 +++--
 examples/jms/no-consumer-buffering/pom.xml      | 133 ++---
 examples/jms/no-consumer-buffering/readme.html  |  67 +--
 .../jms/example/NoConsumerBufferingExample.java |  18 +-
 examples/jms/non-transaction-failover/pom.xml   | 127 +++--
 .../jms/non-transaction-failover/readme.html    |  22 +-
 examples/jms/openwire/pom.xml                   | 110 ----
 examples/jms/openwire/readme.html               |  98 ----
 .../artemis/jms/example/OpenWireExample.java    |  91 ----
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |  71 ---
 examples/jms/paging/pom.xml                     | 133 ++---
 examples/jms/paging/readme.html                 |  40 +-
 examples/jms/perf/pom.xml                       |   4 +-
 examples/jms/pom.xml                            | 122 +----
 examples/jms/pre-acknowledge/pom.xml            | 132 ++---
 examples/jms/pre-acknowledge/readme.html        |  36 +-
 .../jms/example/PreacknowledgeExample.java      |  17 +-
 examples/jms/producer-rate-limit/pom.xml        | 133 ++---
 examples/jms/producer-rate-limit/readme.html    |  27 +-
 .../jms/example/ProducerRateLimitExample.java   |  16 +-
 examples/jms/proton-cpp/pom.xml                 | 128 +++--
 examples/jms/proton-j/pom.xml                   | 128 +++--
 examples/jms/proton-j/readme.html               |   3 +
 examples/jms/proton-ruby/pom.xml                |  64 +--
 examples/jms/proton-ruby/readme.html            |   2 +-
 .../jms/queue-message-redistribution/pom.xml    | 223 ++++----
 .../queue-message-redistribution/readme.html    | 195 +------
 .../QueueMessageRedistributionExample.java      |  36 +-
 examples/jms/queue-requestor/pom.xml            | 128 ++---
 examples/jms/queue-requestor/readme.html        |  99 +---
 examples/jms/queue-selector/pom.xml             | 133 ++---
 examples/jms/queue-selector/readme.html         | 127 +----
 examples/jms/queue/pom.xml                      | 133 ++---
 examples/jms/queue/readme.html                  |  82 +--
 examples/jms/reattach-node/pom.xml              | 138 ++---
 examples/jms/reattach-node/readme.html          | 102 +---
 .../artemis/jms/example/ReattachExample.java    |   9 +-
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 examples/jms/replicated-failback-static/pom.xml | 119 ++--
 .../jms/replicated-failback-static/readme.html  | 138 +----
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 .../main/resources/activemq/server1/broker.xml  |   8 +-
 examples/jms/replicated-failback/pom.xml        | 114 ++--
 examples/jms/replicated-failback/readme.html    | 138 +----
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 .../main/resources/activemq/server1/broker.xml  |   8 +-
 .../jms/replicated-multiple-failover/pom.xml    | 144 +++--
 .../replicated-multiple-failover/readme.html    | 133 +----
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 .../main/resources/activemq/server1/broker.xml  |   8 +-
 .../main/resources/activemq/server2/broker.xml  |   8 +-
 .../jms/replicated-transaction-failover/pom.xml | 121 ++---
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 .../main/resources/activemq/server1/broker.xml  |   8 +-
 examples/jms/request-reply/pom.xml              | 137 ++---
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |  67 ---
 examples/jms/rest/dup-send/pom.xml              |   2 +-
 examples/jms/rest/javascript-chat/pom.xml       |   2 +-
 examples/jms/rest/jms-to-rest/pom.xml           |   2 +-
 examples/jms/rest/pom.xml                       |   2 +-
 examples/jms/rest/push/pom.xml                  |   2 +-
 examples/jms/scale-down/pom.xml                 | 117 ++--
 examples/jms/scale-down/readme.html             | 126 +----
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 .../main/resources/activemq/server1/broker.xml  |   8 +-
 examples/jms/scheduled-message/pom.xml          | 133 ++---
 examples/jms/scheduled-message/readme.html      |  15 +-
 examples/jms/security/pom.xml                   | 137 ++---
 examples/jms/security/readme.html               |  49 +-
 examples/jms/send-acknowledgements/pom.xml      | 127 ++---
 examples/jms/send-acknowledgements/readme.html  |  29 +-
 examples/jms/spring-integration/pom.xml         |  62 +--
 examples/jms/spring-integration/readme.html     |   6 +-
 examples/jms/ssl-enabled/pom.xml                | 133 ++---
 examples/jms/ssl-enabled/readme.html            |  99 +---
 examples/jms/static-selector-jms/pom.xml        | 106 ----
 examples/jms/static-selector-jms/readme.html    | 158 ------
 .../jms/example/StaticSelectorJMSExample.java   | 147 -----
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |  62 ---
 .../src/main/resources/jndi.properties          |  20 -
 examples/jms/static-selector/pom.xml            |  26 +-
 examples/jms/static-selector/readme.html        | 120 +---
 examples/jms/stomp-websockets/pom.xml           | 133 ++---
 examples/jms/stomp-websockets/readme.html       |   7 +-
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 examples/jms/stomp/pom.xml                      | 133 ++---
 examples/jms/stomp/readme.html                  | 100 +---
 examples/jms/stomp1.1/pom.xml                   | 135 ++---
 examples/jms/stomp1.1/readme.html               | 108 +---
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 examples/jms/stomp1.2/pom.xml                   | 133 ++---
 examples/jms/stomp1.2/readme.html               | 108 +---
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 examples/jms/stop-server-failover/pom.xml       | 234 ++++----
 examples/jms/stop-server-failover/readme.html   | 121 +----
 examples/jms/symmetric-cluster/pom.xml          | 541 ++++++++++---------
 examples/jms/symmetric-cluster/readme.html      | 208 +------
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 .../main/resources/activemq/server1/broker.xml  |   8 +-
 .../main/resources/activemq/server2/broker.xml  |   8 +-
 .../main/resources/activemq/server3/broker.xml  |   8 +-
 .../main/resources/activemq/server4/broker.xml  |   8 +-
 .../main/resources/activemq/server5/broker.xml  |   8 +-
 examples/jms/temp-queue/pom.xml                 | 133 ++---
 examples/jms/temp-queue/readme.html             | 128 +----
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 examples/jms/topic-hierarchies/pom.xml          | 132 ++---
 examples/jms/topic-hierarchies/readme.html      | 164 +-----
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 examples/jms/topic-selector-example1/pom.xml    | 133 ++---
 .../jms/topic-selector-example1/readme.html     | 147 +----
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 examples/jms/topic-selector-example2/pom.xml    | 133 ++---
 .../jms/topic-selector-example2/readme.html     | 126 +----
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 examples/jms/topic/pom.xml                      | 134 ++---
 examples/jms/topic/readme.html                  |  91 +---
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 examples/jms/transaction-failover/pom.xml       | 114 ++--
 examples/jms/transaction-failover/readme.html   | 112 +---
 examples/jms/transactional/pom.xml              | 133 ++---
 examples/jms/transactional/readme.html          | 114 +---
 examples/jms/xa-heuristic/pom.xml               | 145 ++---
 examples/jms/xa-heuristic/readme.html           | 215 +-------
 examples/jms/xa-receive/pom.xml                 | 135 ++---
 examples/jms/xa-receive/readme.html             | 190 +------
 examples/jms/xa-send/pom.xml                    | 135 ++---
 examples/pom.xml                                |   1 +
 pom.xml                                         |   1 -
 286 files changed, 8206 insertions(+), 16137 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/ActionContext.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/ActionContext.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/ActionContext.java
index fd44d15..29911e5 100644
--- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/ActionContext.java
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/ActionContext.java
@@ -29,9 +29,9 @@ public class ActionContext
       this.err = err;
    }
 
-   InputStream in;
-   PrintStream out;
-   PrintStream err;
+   public InputStream in;
+   public PrintStream out;
+   public PrintStream err;
 
    public static ActionContext system()
    {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 90c6d2b..533d7c4 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
@@ -24,6 +24,8 @@ import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
+import java.io.PrintWriter;
+import java.io.StringWriter;
 import java.nio.file.Files;
 import java.nio.file.attribute.PosixFilePermission;
 import java.text.DecimalFormat;
@@ -161,6 +163,12 @@ public class Create extends InputAbstract
    @Option(name = "--no-web", description = "This will remove the web server definition from bootstrap.xml")
    boolean noWeb;
 
+   @Option(name = "--queues", description = "comma separated list of jms queues.")
+   String queues;
+
+   @Option(name = "--topics", description = "comma separated list of jms topics ")
+   String topics;
+
    boolean IS_WINDOWS;
 
    boolean IS_CYGWIN;
@@ -564,7 +572,6 @@ public class Create extends InputAbstract
       filters.put("${password}", getPassword());
       filters.put("${role}", getRole());
 
-
       if (clustered)
       {
          filters.put("${host}", getHostForClustered());
@@ -587,6 +594,7 @@ public class Create extends InputAbstract
          filters.put("${cluster-password}", "");
       }
 
+      applyJMSObjects(filters);
 
       if (home != null)
       {
@@ -706,6 +714,24 @@ public class Create extends InputAbstract
       return null;
    }
 
+   /** It will create the jms configurations */
+   private void applyJMSObjects(HashMap<String, String> filters)
+   {
+      StringWriter writer = new StringWriter();
+      PrintWriter printWriter = new PrintWriter(writer);
+      printWriter.println();
+
+      for (String str : getQueueList())
+      {
+         printWriter.println("      <queue name=\"" + str + "\"/>");
+      }
+      for (String str : getTopicList())
+      {
+         printWriter.println("      <topic name=\"" + str + "\"/>");
+      }
+      filters.put("${jms-list.settings}", writer.toString());
+   }
+
    private void performAutoTune(HashMap<String, String> filters, boolean aio, File dataFolder)
    {
       if (noAutoTune)
@@ -793,6 +819,31 @@ public class Create extends InputAbstract
       }
    }
 
+
+   private String[] getQueueList()
+   {
+      if (queues == null)
+      {
+         return new String[0];
+      }
+      else
+      {
+         return queues.split(",");
+      }
+   }
+
+   private String[] getTopicList()
+   {
+      if (topics == null)
+      {
+         return new String[0];
+      }
+      else
+      {
+         return topics.split(",");
+      }
+   }
+
    String path(String value, boolean unixPaths) throws IOException
    {
       return path(new File(value), unixPaths);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/InputAbstract.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/InputAbstract.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/InputAbstract.java
index c348484..f5180ef 100644
--- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/InputAbstract.java
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/InputAbstract.java
@@ -26,7 +26,7 @@ public class InputAbstract extends ActionAbstract
 
    private Scanner scanner;
 
-   @Option(name = "--silent-input", description = "It will disable all the inputs, and it would make a best guess for any required input")
+   @Option(name = "--silent", description = "It will disable all the inputs, and it would make a best guess for any required input")
    private boolean silentInput = false;
 
    public boolean isSilentInput()

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/XmlDataExporter.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/XmlDataExporter.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/XmlDataExporter.java
index cf5be12..3ea76ce 100644
--- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/XmlDataExporter.java
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/XmlDataExporter.java
@@ -131,7 +131,7 @@ public final class XmlDataExporter extends DataAbstract implements Action
 
       try
       {
-         process(System.out, getBinding(), getJournal(), getPaging(), getLargeMessages());
+         process(context.out, getBinding(), getJournal(), getPaging(), getLargeMessages());
       }
       catch (Exception e)
       {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/broker.xml
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/broker.xml b/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/broker.xml
index 1cd3245..75cd6ee 100644
--- a/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/broker.xml
+++ b/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/broker.xml
@@ -24,7 +24,7 @@ under the License.
 
    <jms xmlns="urn:activemq:jms">
       <queue name="DLQ"/>
-      <queue name="ExpiryQueue"/>
+      <queue name="ExpiryQueue"/>${jms-list.settings}
    </jms>
 
    <core xmlns="urn:activemq:core">

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/artemis-cli/src/test/java/org/apache/activemq/cli/test/ArtemisTest.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/test/java/org/apache/activemq/cli/test/ArtemisTest.java b/artemis-cli/src/test/java/org/apache/activemq/cli/test/ArtemisTest.java
index 3aed71e..a42fae9 100644
--- a/artemis-cli/src/test/java/org/apache/activemq/cli/test/ArtemisTest.java
+++ b/artemis-cli/src/test/java/org/apache/activemq/cli/test/ArtemisTest.java
@@ -23,9 +23,14 @@ import javax.jms.TextMessage;
 import java.io.File;
 import java.util.concurrent.TimeUnit;
 
+import org.apache.activemq.artemis.api.core.SimpleString;
+import org.apache.activemq.artemis.api.core.client.ClientSession;
+import org.apache.activemq.artemis.api.core.client.ClientSessionFactory;
+import org.apache.activemq.artemis.api.core.client.ServerLocator;
 import org.apache.activemq.artemis.cli.Artemis;
 import org.apache.activemq.artemis.cli.commands.Run;
 import org.apache.activemq.artemis.cli.commands.util.SyncCalculation;
+import org.apache.activemq.artemis.core.client.impl.ServerLocatorImpl;
 import org.apache.activemq.artemis.jlibaio.LibaioContext;
 import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
 import org.apache.activemq.artemis.jms.client.ActiveMQDestination;
@@ -83,15 +88,35 @@ public class ArtemisTest
       Assert.assertEquals(0, LibaioContext.getTotalMaxIO());
 
    }
-
    @Test
    public void testSimpleRun() throws Exception
    {
+      String queues = "q1,t2";
+      String topics = "t1,t2";
       Run.setEmbedded(true);
-      Artemis.main("create", temporaryFolder.getRoot().getAbsolutePath(), "--force", "--silent-input", "--no-web");
+      Artemis.main("create", temporaryFolder.getRoot().getAbsolutePath(), "--force", "--silent", "--no-web", "--queues", queues, "--topics", topics);
       System.setProperty("artemis.instance", temporaryFolder.getRoot().getAbsolutePath());
       // Some exceptions may happen on the initialization, but they should be ok on start the basic core protocol
       Artemis.execute("run");
+
+
+      try (ServerLocator locator = ServerLocatorImpl.newLocator("tcp://localhost:61616");
+           ClientSessionFactory factory = locator.createSessionFactory();
+           ClientSession coreSession = factory.createSession())
+      {
+         for (String str: queues.split(","))
+         {
+            ClientSession.QueueQuery queryResult = coreSession.queueQuery(SimpleString.toSimpleString("jms.queue." + str));
+            Assert.assertTrue("Couldn't find queue " + str, queryResult.isExists());
+         }
+         for (String str: topics.split(","))
+         {
+            ClientSession.QueueQuery queryResult = coreSession.queueQuery(SimpleString.toSimpleString("jms.topic." + str));
+            Assert.assertTrue("Couldn't find topic " + str, queryResult.isExists());
+         }
+      }
+
+
       Assert.assertEquals(Integer.valueOf(1000), Artemis.execute("producer", "--message-count", "1000", "--verbose"));
       Assert.assertEquals(Integer.valueOf(1000), Artemis.execute("consumer", "--verbose", "--break-on-null", "--receive-timeout", "100"));
 
@@ -100,6 +125,7 @@ public class ArtemisTest
       Session session = connection.createSession(true, Session.SESSION_TRANSACTED);
       MessageProducer producer = session.createProducer(ActiveMQDestination.createDestination("queue://TEST", ActiveMQDestination.QUEUE_TYPE));
 
+
       TextMessage message = session.createTextMessage("Banana");
       message.setStringProperty("fruit", "banana");
       producer.send(message);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/ActiveMQClientLogger.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/ActiveMQClientLogger.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/ActiveMQClientLogger.java
index ba3fad8..8b3d0da 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/ActiveMQClientLogger.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/ActiveMQClientLogger.java
@@ -181,7 +181,7 @@ public interface ActiveMQClientLogger extends BasicLogger
    @Message(id = 212028, value = "error starting server locator", format = Message.Format.MESSAGE_FORMAT)
    void errorStartingLocator(@Cause Exception e);
 
-   @LogMessage(level = Logger.Level.WARN)
+   @LogMessage(level = Logger.Level.DEBUG)
    @Message(id = 212029,
             value = "Closing a Server Locator left open. Please make sure you close all Server Locators explicitly before letting them go out of scope! {0}",
             format = Message.Format.MESSAGE_FORMAT)

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/artemis-distribution/src/main/resources/README.html
----------------------------------------------------------------------
diff --git a/artemis-distribution/src/main/resources/README.html b/artemis-distribution/src/main/resources/README.html
index f832706..fe89886 100644
--- a/artemis-distribution/src/main/resources/README.html
+++ b/artemis-distribution/src/main/resources/README.html
@@ -71,7 +71,7 @@ SYNOPSIS
     [--clustered] [--data <data>] [--encoding <encoding>] [--force]
         [--home <home>] [--host <host>] [--java-options <javaOptions>]
             [--password <password>] [--port-offset <portOffset>] [--replicated]
-                [--role <role>] [--shared-store] [--silent-input] [--user <user>] [--]
+                [--role <role>] [--shared-store] [--silent] [--user <user>] [--]
                     <directory>
      ...
 </PRE>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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
deleted file mode 100644
index c269e4f..0000000
--- a/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/ActiveMQClientPlugin.java
+++ /dev/null
@@ -1,65 +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 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
- */
-@Mojo(name = "runClient", defaultPhase = LifecyclePhase.VERIFY)
-public class ActiveMQClientPlugin extends AbstractMojo
-{
-
-   @Parameter
-   String clientClass;
-
-   @Parameter
-   String[] args;
-
-   /**
-    * @parameter
-    */
-   private Properties systemProperties;
-
-   public void execute() throws MojoExecutionException, MojoFailureException
-   {
-      try
-      {
-         if (systemProperties != null && !systemProperties.isEmpty())
-         {
-            System.getProperties().putAll(systemProperties);
-         }
-         Class aClass = Class.forName(clientClass);
-         Method method = aClass.getDeclaredMethod("main", new Class[]{String[].class});
-         method.invoke(null, new Object[]{args});
-      }
-      catch (Exception e)
-      {
-         getLog().error(e);
-         throw new MojoFailureException(e.getMessage());
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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
deleted file mode 100644
index 405b2b1..0000000
--- a/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/ActiveMQCreatePlugin.java
+++ /dev/null
@@ -1,343 +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 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;
-
-   @Parameter(defaultValue = "false")
-   private boolean failoverOnShutdown;
-
-   @Parameter(defaultValue = "ON_DEMAND")
-   private String messageLoadBalancing;
-
-   @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
-   {
-      if (System.getProperty("bypassAddress") != null)
-      {
-         System.out.println("BYPASSADDRESS");
-      }
-      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 (sharedStore)
-      {
-         add(listCommands, "--shared-store");
-      }
-
-      if (clustered)
-      {
-         add(listCommands, "--clustered");
-         add(listCommands, "--message-load-balancing", messageLoadBalancing);
-      }
-
-      if (failoverOnShutdown)
-      {
-         add(listCommands, "--failover-on-shutdown");
-      }
-
-      add(listCommands, "--no-autotune");
-      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/dd820318/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/ArtemisAbstractPlugin.java
----------------------------------------------------------------------
diff --git a/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/ArtemisAbstractPlugin.java b/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/ArtemisAbstractPlugin.java
new file mode 100644
index 0000000..43cc075
--- /dev/null
+++ b/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/ArtemisAbstractPlugin.java
@@ -0,0 +1,48 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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 org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugins.annotations.Parameter;
+
+public abstract class ArtemisAbstractPlugin extends AbstractMojo
+{
+
+
+   /** It will ignore executioni if ignore has been set to true. This is useful as a property from the build. */
+   @Parameter(defaultValue = "")
+   private boolean ignore;
+
+   public void execute() throws MojoExecutionException, MojoFailureException
+   {
+      if (ignore)
+      {
+         getLog().debug("******************************************************************************************************");
+         getLog().debug("Execution of " + getClass().getSimpleName() + " is being ignored as ignore has been set to true");
+         getLog().debug("******************************************************************************************************");
+      }
+      else
+      {
+         doExecute();
+      }
+   }
+
+   protected abstract void doExecute() throws MojoExecutionException, MojoFailureException;
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 1fd4614..45aafcb 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,10 +16,14 @@
  */
 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 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;
@@ -28,13 +32,8 @@ 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
+public class ArtemisCLIPlugin extends ArtemisAbstractPlugin
 {
    private PluginDescriptor descriptor;
 
@@ -98,7 +97,8 @@ public class ArtemisCLIPlugin extends AbstractMojo
 
    }
 
-   public void execute() throws MojoExecutionException, MojoFailureException
+   @Override
+   protected void doExecute() throws MojoExecutionException, MojoFailureException
    {
       // This is to avoid the Run issuing a kill at any point
       Run.setEmbedded(true);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/ArtemisClientPlugin.java
----------------------------------------------------------------------
diff --git a/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/ArtemisClientPlugin.java b/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/ArtemisClientPlugin.java
new file mode 100644
index 0000000..1716c03
--- /dev/null
+++ b/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/ArtemisClientPlugin.java
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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.lang.reflect.Method;
+import java.util.Properties;
+
+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;
+
+/**
+ * Allows a Java Client to be run which must hve a static main(String[] args) method
+ */
+@Mojo(name = "runClient", defaultPhase = LifecyclePhase.VERIFY)
+public class ArtemisClientPlugin extends ArtemisAbstractPlugin
+{
+
+   @Parameter
+   String clientClass;
+
+   @Parameter
+   String[] args;
+
+   /**
+    * @parameter
+    */
+   private Properties systemProperties;
+
+   @Override
+   protected void doExecute() throws MojoExecutionException, MojoFailureException
+   {
+      try
+      {
+         if (systemProperties != null && !systemProperties.isEmpty())
+         {
+            System.getProperties().putAll(systemProperties);
+         }
+         Class aClass = Class.forName(clientClass);
+         Method method = aClass.getDeclaredMethod("main", new Class[]{String[].class});
+         method.invoke(null, new Object[]{args});
+      }
+      catch (Exception e)
+      {
+         getLog().error(e);
+         throw new MojoFailureException(e.getMessage());
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/ArtemisCreatePlugin.java
----------------------------------------------------------------------
diff --git a/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/ArtemisCreatePlugin.java b/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/ArtemisCreatePlugin.java
new file mode 100644
index 0000000..eb3462e
--- /dev/null
+++ b/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/ArtemisCreatePlugin.java
@@ -0,0 +1,364 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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.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 ArtemisCreatePlugin extends ArtemisAbstractPlugin
+
+{
+
+   @Parameter
+   String name;
+
+   /**
+    * The plugin descriptor
+    */
+   private PluginDescriptor descriptor;
+
+   /** Directory to replace the configuration with */
+   @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 = "false")
+   private boolean clustered;
+
+   @Parameter(defaultValue = "false")
+   private boolean slave;
+
+   @Parameter(defaultValue = "./data")
+   String dataFolder;
+
+   @Parameter(defaultValue = "false")
+   private boolean failoverOnShutdown;
+
+   /** it will disable auto-tune*/
+   @Parameter(defaultValue = "true")
+   private boolean noAutoTune;
+
+   @Parameter(defaultValue = "ON_DEMAND")
+   private String messageLoadBalancing;
+
+   @Component
+   private RepositorySystem repositorySystem;
+
+   @Parameter(defaultValue = "${repositorySystemSession}")
+   private RepositorySystemSession repoSession;
+
+   @Parameter(defaultValue = "${project.remoteProjectRepositories}")
+   private List<RemoteRepository> remoteRepos;
+
+   /**
+    * For extra stuff not covered by the properties
+    */
+   @Parameter
+   ArrayList<String> args = new ArrayList<>();
+
+
+
+   @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);
+      }
+   }
+
+   @Override
+   protected void doExecute() throws MojoExecutionException, MojoFailureException
+   {
+      if (System.getProperty("bypassAddress") != null)
+      {
+         System.out.println("BYPASSADDRESS");
+      }
+      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", "--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 (sharedStore)
+      {
+         add(listCommands, "--shared-store");
+      }
+
+      if (clustered)
+      {
+         add(listCommands, "--clustered");
+         add(listCommands, "--message-load-balancing", messageLoadBalancing);
+      }
+
+      if (failoverOnShutdown)
+      {
+         add(listCommands, "--failover-on-shutdown");
+      }
+
+      if (noAutoTune)
+      {
+         add(listCommands, "--no-autotune");
+      }
+
+      add(listCommands, "--verbose");
+
+      for (String str : args)
+      {
+         add(listCommands, str);
+      }
+
+      add(listCommands, instance.getAbsolutePath());
+
+      getLog().debug("***** Server created at " + instance + " with home=" + home + " *****");
+
+      try
+      {
+         Artemis.execute(home, null, listCommands);
+
+         if (configuration != null)
+         {
+            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);
+               }
+            }
+         }
+
+         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/dd820318/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
deleted file mode 100644
index e65108d..0000000
--- a/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/LibInstallPlugin.java
+++ /dev/null
@@ -1,147 +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 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/dd820318/docs/user-manual/en/using-server.md
----------------------------------------------------------------------
diff --git a/docs/user-manual/en/using-server.md b/docs/user-manual/en/using-server.md
index 2fa214d..9a59c29 100644
--- a/docs/user-manual/en/using-server.md
+++ b/docs/user-manual/en/using-server.md
@@ -93,7 +93,7 @@ For a full list of updated properties always use:
                  [--clustered] [--data <data>] [--encoding <encoding>] [--force]
                  [--home <home>] [--host <host>] [--java-options <javaOptions>]
                  [--password <password>] [--port-offset <portOffset>] [--replicated]
-                 [--role <role>] [--shared-store] [--silent-input] [--user <user>] [--]
+                 [--role <role>] [--shared-store] [--silent] [--user <user>] [--]
                  <directory>
 
  OPTIONS
@@ -143,7 +143,7 @@ For a full list of updated properties always use:
          --shared-store
              Enable broker shared store
 
-         --silent-input
+         --silent
              It will disable all the inputs, and it would make a best guess for
              any required input
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/core/embedded/pom.xml
----------------------------------------------------------------------
diff --git a/examples/core/embedded/pom.xml b/examples/core/embedded/pom.xml
index 8453105..ebe5254 100644
--- a/examples/core/embedded/pom.xml
+++ b/examples/core/embedded/pom.xml
@@ -61,9 +61,6 @@ under the License.
       </dependency>
    </dependencies>
 
-   <profiles>
-      <profile>
-         <id>example</id>
          <build>
             <plugins>
                <plugin>
@@ -84,6 +81,4 @@ under the License.
                </plugin>
             </plugins>
          </build>
-      </profile>
-   </profiles>
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/core/embedded/readme.html
----------------------------------------------------------------------
diff --git a/examples/core/embedded/readme.html b/examples/core/embedded/readme.html
index c5c2141..d65caa2 100644
--- a/examples/core/embedded/readme.html
+++ b/examples/core/embedded/readme.html
@@ -38,7 +38,7 @@ under the License.
      <p>ActiveMQ Artemis Embedded could be used from very simple use cases with only InVM support to very complex cases with clustering, persistence and fail over.</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>
+     <p><i>To run the example, simply type <code>mvn verify</code> from this directory</i></p>
      <p>In this we don't use any configuration files. (Everything is embedded). We simply instantiate ConfigurationImpl, ActiveMQServer, start it and operate on JMS regularly</p>
 
      <ol>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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
index 8876d42..6e787fb 100644
--- a/examples/core/perf/src/main/resources/activemq/server0/broker.xml
+++ b/examples/core/perf/src/main/resources/activemq/server0/broker.xml
@@ -23,13 +23,13 @@ under the License.
             xsi:schemaLocation="urn:activemq /schema/artemis-server.xsd">
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>${data.dir:./data}/bindings</bindings-directory>
+      <bindings-directory>./data/bindings</bindings-directory>
 
-      <journal-directory>${data.dir:./data}/journal</journal-directory>
+      <journal-directory>./data/journal</journal-directory>
 
-      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
+      <large-messages-directory>./data/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir:./data}/paging</paging-directory>
+      <paging-directory>./data/paging</paging-directory>
 
       <!-- Acceptors -->
       <acceptors>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/core/pom.xml
----------------------------------------------------------------------
diff --git a/examples/core/pom.xml b/examples/core/pom.xml
index c88656e..fd3ba18 100644
--- a/examples/core/pom.xml
+++ b/examples/core/pom.xml
@@ -39,7 +39,8 @@ under the License.
 
    <profiles>
       <profile>
-         <id>release</id>
+         <!-- You need to activate -Pexamples to run all the examples -->
+         <id>examples</id>
          <modules>
             <module>embedded</module>
             <module>embedded-remote</module>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/README.md
----------------------------------------------------------------------
diff --git a/examples/jms/README.md b/examples/jms/README.md
index f0cd2af..e9d9e36 100644
--- a/examples/jms/README.md
+++ b/examples/jms/README.md
@@ -3,22 +3,25 @@ Running the ActiveMQ Artemis Examples
 
 To run an individual example firstly cd into the example directory and run
 
+```sh
+mvn verify
 ```
-mvn verify -Pexample
+
+Most examples offer a way to start them without creating and starting the server (say if you want to do it manually)
+
+```sh
+mvn verify -PnoServer
 ```
 
 If you are running against an un released version, i.e. from master branch, you will have to run `mvn install` on the root
 pom.xml and the example/activemq-jms-examples-common/pom.xml first.
 
-If you want to run all the examples (except those that need to be run standalone) you can run `mvn verify -Pexample` in the examples
+If you want to run all the examples (except those that need to be run standalone) you can run `mvn verify -Pexamples` in the examples
 directory but before you do you will need to up the memory used by running:
 
 ```
 export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=256m"
 ```
-
-To run the javaee examples follow the instructions in examples/javaee/README.md
-
 ### Recreating the examples
 
 If you are trying to copy the examples somewhere else and modifying them. Consider asking Maven to explicitly list all the dependencies:

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/aerogear/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/aerogear/pom.xml b/examples/jms/aerogear/pom.xml
index a42a6e8..fc224d6 100644
--- a/examples/jms/aerogear/pom.xml
+++ b/examples/jms/aerogear/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -34,7 +35,7 @@ under the License.
       <activemq.basedir>${project.basedir}/../../..</activemq.basedir>
    </properties>
 
-   <artifactId>artemis-jms-aerogear-example</artifactId>
+   <artifactId>aerogear</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS AeroGear Example</name>
 
@@ -48,80 +49,86 @@ under the License.
 
    <profiles>
       <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <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>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.AerogearExample</clientClass>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>cli</goal>
-                        </goals>
-                        <configuration>
-                           <args>
-                              <param>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-aerogear-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
+         <!-- specify -PnoServer if you don't want to start the server -->
+         <id>noServer</id>
+         <properties>
+            <noServer>true</noServer>
+         </properties>
       </profile>
    </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <!-- 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>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <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.AerogearExample</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>aerogear</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/aerogear/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/aerogear/readme.html b/examples/jms/aerogear/readme.html
index 661b7d1..bdddfa6 100644
--- a/examples/jms/aerogear/readme.html
+++ b/examples/jms/aerogear/readme.html
@@ -27,6 +27,9 @@ under the License.
   <body onload="prettyPrint()">
      <h1>JMS AeroGear Example</h1>
 
+
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
+
      <p>This example shows how you can send a message to a mobile device by leveraging <a href="http://aerogear.org/push/">AeroGears push</a> technology which
          provides support for different push notification technologies like Google Cloud Messaging, Apple's APNs or
          Mozilla's SimplePush.</p>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 5c389c8..1095761 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/bindings</bindings-directory>
 
-      <journal-directory>${data.dir:./data}/journal</journal-directory>
+      <journal-directory>./data/journal</journal-directory>
 
-      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
+      <large-messages-directory>./data/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir:./data}/paging</paging-directory>
+      <paging-directory>./data/paging</paging-directory>
 
       <!-- Acceptors -->
       <acceptors>


[03/18] activemq-artemis git commit: ARTEMIS-180 removing -Pexample and some other improvements around the examples

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/temp-queue/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/temp-queue/pom.xml b/examples/jms/temp-queue/pom.xml
index 1599fcc..ef544e1 100644
--- a/examples/jms/temp-queue/pom.xml
+++ b/examples/jms/temp-queue/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-temp-queue-example</artifactId>
+   <artifactId>temp-queue</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS Temporary Queue Example</name>
 
@@ -37,71 +38,81 @@ under the License.
 
    <dependencies>
       <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
       </dependency>
    </dependencies>
 
    <profiles>
       <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>create</id>
-                        <goals>
-                           <goal>create</goal>
-                        </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.TemporaryQueueExample</clientClass>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>cli</goal>
-                        </goals>
-                        <configuration>
-                           <args>
-                              <param>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-temp-queue-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
+         <!-- specify -PnoServer if you don't want to start the server -->
+         <id>noServer</id>
+         <properties>
+            <noServer>true</noServer>
+         </properties>
       </profile>
    </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <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.TemporaryQueueExample</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>temp-queue</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/temp-queue/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/temp-queue/readme.html b/examples/jms/temp-queue/readme.html
index 2685f31..f1cae4d 100644
--- a/examples/jms/temp-queue/readme.html
+++ b/examples/jms/temp-queue/readme.html
@@ -27,136 +27,14 @@ under the License.
   <body onload="prettyPrint()">
      <h1>JMS Temporary Queue Example</h1>
 
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
+
+
      <p>This example shows you how to use a TemporaryQueue with ActiveMQ Artemis. First a temporary queue is created to send and receive a message and then deleted.
          Then another temporary queue is created and used after its connection is closed to illustrate its scope.</p>
      <p>A TemporaryQueue is a JMS queue that exists only within the lifetime of its connection. It is often used in request-reply
          type messaging where the reply is sent through a temporary destination. The temporary queue is often created as
          a server resource, so after using, the user should call delete() method to release the resources.
          Please consult the JMS 1.1 specification for full details.</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>
-
-     <ol>
-        <li>First we need to get an initial context so we can look-up the JMS connection factory from JNDI. This initial context will get it's properties from the <code>client-jndi.properties</code> file in the directory <code>../common/config</code></li>
-        <pre class="prettyprint">
-           <code>initialContext = getContext();</code>
-        </pre>
-
-        <li>We look-up JMS connection factory from JNDI</li>
-        <pre class="prettyprint">
-           <code>ConnectionFactory cf = (ConnectionFactory)initialContext.lookup("/ConnectionFactory");</code>
-        </pre>
-
-        <li>We Create a JMS connection</li>
-        <pre class="prettyprint">
-           <code>connection = cf.createConnection();</code>
-        </pre>
-         
-        <li>We start the connection. In order for delivery to occur on any consumers or subscribers on a connection, the connection must be started</li>
-        <pre class="prettyprint">
-           <code>connection.start();</code>
-        </pre>
-         
-        <li>We create a JMS session. The session is created as non transacted and will auto acknowledge messages.</li>
-        <pre class="prettyprint">
-           <code>Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);</code>
-        </pre>
-        
-        <li>We create a Temporary Queue</li>
-        <pre class="prettyprint">
-           <code>Queue tempQueue = session.createTemporaryQueue();</code>
-        </pre>
-
-        <li>We create a JMS message producer to the temporary queue. This will be used to send the messages.</li>
-        <pre class="prettyprint">
-	        <code>MessageProducer messageProducer = session.createProducer(tempQueue);</code>
-        </pre>
-         
-        <li>We create a JMS text message to send </li>
-        <pre class="prettyprint">
-           <code>TextMessage message = session.createTextMessage("This is a text message");</code>
-        </pre>
-   
-        <li>We send the message to the temporary queue</li>
-        <pre class="prettyprint">
-           <code>messageProducer.send(message);</code>
-        </pre>
-
-        <li>We create a message consumer of the temporary queue</li>
-        <pre class="prettyprint">
-           <code>MessageConsumer messageConsumer = session.createConsumer(tempQueue);</code>
-        </pre>
-
-        <li>We receive the message from the temporary queue</li>
-        <pre class="prettyprint">
-           <code>message = (TextMessage) messageConsumer.receive(5000);</code>
-        </pre>
-
-        <li>We close the consumer and producer before destroying the temporary queue</li>
-        <pre class="prettyprint">
-           <code>messageConsumer.close();</code>
-           <code>messageProducer.close();</code>
-        </pre>
-
-        <li>We delete the temporary queue</li>
-        <pre class="prettyprint">
-           <code>tempQueue.delete();</code>
-        </pre>
-
-        <li>We create another temporary queue</li>
-        <pre class="prettyprint">
-           <code>TemporaryQueue tempQueue2 = session.createTemporaryQueue();</code>
-        </pre>
-
-        <li>We close the connection</li>
-        <pre class="prettyprint">
-           <code>connection.close();</code>
-        </pre>
-
-        <li>We create a new connection</li>
-        <pre class="prettyprint">
-           <code>connection = cf.createConnection();</code>
-        </pre>
-
-        <li>We create a new session</li>
-        <pre class="prettyprint">
-           <code>session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);</code>
-        </pre>
-
-        <li>We try to access the tempQueue2 outside its lifetime, this will cause exception thrown</li>
-        <pre class="prettyprint">
-           <code>
-         try
-         {
-            messageConsumer = session.createConsumer(tempQueue2);
-            throw new Exception("Temporary queue cannot be accessed outside its lifecycle!");
-         }
-         catch (InvalidDestinationException e)
-         {
-            System.out.println("Exception got when trying to access a temp queue outside its scope: " + e);
-         }
-           </code>
-        </pre>
-
-        <li>And finally, <b>always</b> remember to close your JMS connections and resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
-
-        <pre class="prettyprint">
-           <code>finally
-           {
-              if (initialContext != null)
-              {
-                initialContext.close();
-              }
-              if (connection != null)
-              {
-                 connection.close();
-              }
-           }</code>
-        </pre>
-
-
-         
-     </ol>
   </body>
 </html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 f1c14b2..2dd2df9 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,13 +29,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>${data.dir:./data}/bindings</bindings-directory>
+      <bindings-directory>./data/bindings</bindings-directory>
 
-      <journal-directory>${data.dir:./data}/journal</journal-directory>
+      <journal-directory>./data/journal</journal-directory>
 
-      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
+      <large-messages-directory>./data/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir:./data}/paging</paging-directory>
+      <paging-directory>./data/paging</paging-directory>
 
       <!-- Acceptors -->
       <acceptors>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/topic-hierarchies/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/topic-hierarchies/pom.xml b/examples/jms/topic-hierarchies/pom.xml
index 250abd3..320e870 100644
--- a/examples/jms/topic-hierarchies/pom.xml
+++ b/examples/jms/topic-hierarchies/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-topic-hierarchies-example</artifactId>
+   <artifactId>topic-hierarchies</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS Topic Hierarchies Example</name>
 
@@ -41,72 +42,77 @@ under the License.
          <artifactId>artemis-jms-client</artifactId>
          <version>${project.version}</version>
       </dependency>
-      <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
-      </dependency>
    </dependencies>
 
    <profiles>
       <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>create</id>
-                        <goals>
-                           <goal>create</goal>
-                        </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.TopicHierarchyExample</clientClass>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>cli</goal>
-                        </goals>
-                        <configuration>
-                           <args>
-                              <param>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-topic-hierarchies-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
+         <!-- specify -PnoServer if you don't want to start the server -->
+         <id>noServer</id>
+         <properties>
+            <noServer>true</noServer>
+         </properties>
       </profile>
    </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <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.TopicHierarchyExample</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>topic-hierarchies</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/topic-hierarchies/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/topic-hierarchies/readme.html b/examples/jms/topic-hierarchies/readme.html
index d87cb1a..c901d57 100644
--- a/examples/jms/topic-hierarchies/readme.html
+++ b/examples/jms/topic-hierarchies/readme.html
@@ -27,6 +27,9 @@ under the License.
   <body onload="prettyPrint()">
      <h1>Topic Hierarchy Example</h1>
 
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
+
+
      <p>ActiveMQ Artemis supports topic hierarchies. With a topic hierarchy you can register a subscriber with a wild-card
      and that subscriber will receive any messages routed to an address that match the wildcard.</p>
      <p>ActiveMQ Artemis wild-cards can use the character '#' which means "match any number of words", and
@@ -35,166 +38,5 @@ under the License.
      "news.europe", "news.europe.sport" and "news.europe.entertainment", but it does not match messages sent to the
      address "news.usa.wrestling"</p>
      <p>For more information on the wild-card syntax please consult the user manual.</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>
-     <p>In this example we will define a hierarchy of topics in the file <code>activemq-jms.xml</code></p>
-     <pre class="prettyprint">
-        <code>
-   &lt;topic name="news"&gt;
-      &lt;entry name="/topic/news"/&gt;
-   &lt;/topic&gt;
-   
-   &lt;topic name="news.usa"&gt;
-      &lt;entry name="/topic/news.usa"/&gt;
-   &lt;/topic&gt;
-   
-   &lt;topic name="news.usa.wrestling"&gt;
-      &lt;entry name="/topic/news.wrestling"/&gt;
-   &lt;/topic&gt;
-   
-   &lt;topic name="news.europe"&gt;
-      &lt;entry name="/topic/news.europe"/&gt;
-   &lt;/topic&gt;
-   
-   &lt;topic name="news.europe.sport"&gt;
-      &lt;entry name="/topic/news.europe.sport"/&gt;
-   &lt;/topic&gt;
-   
-   &lt;topic name="news.europe.entertainment"&gt;
-      &lt;entry name="/topic/news.europe.entertainment"/&gt;
-   &lt;/topic&gt;
-        </code>
-     </pre>
-     <p>Then we will create a subscriber using the wildcard "news.europe.#".</p>
-     <p>We will then send three messages: one to the address news.usa.wrestling, one to the address news.europe.sport,
-     and one to the address news.europe.entertainment.</p>
-     <p>We will verify that the message sent to news.usa.wrestling does not get received since it does not match, 
-     but the messages sent to the other two addresses do get received since they match.</p>
-
-     <ol>
-        <li>Create an initial context to perform the JNDI lookup.</code></li>
-        <pre class="prettyprint">
-           <code>initialContext = getContext(0);</code>
-        </pre>
-
-        <li>Perform a lookup on the Connection Factory</li>
-        <pre class="prettyprint">
-           <code>ConnectionFactory cf = (ConnectionFactory) initialContext.lookup("/ConnectionFactory");</code>
-        </pre>
-
-        <li>Create a JMS Connection</li>
-        <pre class="prettyprint">
-           <code>connection = cf.createConnection();</code>
-        </pre>
-
-        <li>Create a JMS Session</li>
-        <pre class="prettyprint">
-           <code>Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);</code>
-        </pre>
-
-        <li>Instantiate a topic representing the wildcard we're going to subscribe to.</li>
-        <pre class="prettyprint">
-           <code>Topic topicSubscribe = ActiveMQJMSClient.createActiveMQTopic("news.europe.#");</code>
-        </pre>
-
-        <li>Create a consumer (topic subscriber) that will consume using that wildcard.
-         The consumer will receive any messages sent to any topic that starts with news.europe</li>
-        <pre class="prettyprint">
-          <code>MessageConsumer messageConsumer = session.createConsumer(topicSubscribe);</code>
-       </pre>
-
-        <li>Create an anonymous producer. The sending address is specified at send time.</li>
-        <pre class="prettyprint">
-           <code>MessageProducer producer = session.createProducer(null);</code>
-        </pre>
-
-        <li>Instantiate some more topic objects corresponding to the individual topics
-         we're going to send messages to. You could look these up from JNDI if you wanted to.</li>
-        <pre class="prettyprint">
-           <code>
-         Topic topicNewsUsaWrestling = ActiveMQJMSClient.createActiveMQTopic("news.usa.wrestling");
-         
-         Topic topicNewsEuropeSport = ActiveMQJMSClient.createActiveMQTopic("news.europe.sport");
-         
-         Topic topicNewsEuropeEntertainment = ActiveMQJMSClient.createActiveMQTopic("news.europe.entertainment");</code>
-        </pre>
-
-        <li>Send a message destined for the usa wrestling topic.</li>
-          <pre class="prettyprint">
-           <code>
-         TextMessage messageWrestlingNews = session.createTextMessage("Hulk Hogan starts ballet classes");
-         
-         producer.send(topicNewsUsaWrestling, messageWrestlingNews);
-           </code>
-        </pre>
-
-        <li>Send a message destined for the europe sport topic.</li>
-        <pre class="prettyprint">
-           <code>
-         TextMessage messageEuropeSport = session.createTextMessage("Lewis Hamilton joins European synchronized swimming team");
-         
-         producer.send(topicNewsEuropeSport, messageEuropeSport);           
-           </code>
-        </pre>
-
-        <li>Send a message destined for the europe entertainment topic</li>
-        <pre class="prettyprint">
-           <code>
-         TextMessage messageEuropeEntertainment = session.createTextMessage("John Lennon resurrected from dead");
-         
-         producer.send(topicNewsEuropeEntertainment, messageEuropeEntertainment);
-           </code>
-        </pre>
-        
-        <li>Start the connection</li>
-        <pre class="prettyprint">
-           <code>
-        connection.start();
-           </code>
-        </pre>
-        
-        <li>We don't receive the usa wrestling message since we subscribed to news.europe.# and
-         that doesn't match news.usa.wrestling. However we do receive the Europe sport message, and the
-         europe entertainment message, since these match the wildcard.</li>
-        <pre class="prettyprint">
-           <code>
-        TextMessage messageReceived1 = (TextMessage)messageConsumer.receive(5000);
-         
-        System.out.println("Received message: " + messageReceived1.getText());
-         
-        TextMessage messageReceived2 = (TextMessage)messageConsumer.receive(5000);
-         
-        System.out.println("Received message: " + messageReceived2.getText());
-         
-        Message message = messageConsumer.receive(1000);
-         
-        if (message != null)
-        {
-           return false;
-        }
-         
-        System.out.println("Didn't received any more message: " + message);
-           </code>
-        </pre>
-        
-        <li>Be sure to close our resources!</li>
-
-        <pre class="prettyprint">
-           <code>finally
-           {
-              if (initialContext != null)
-              {
-                initialContext.close();
-              }
-              if (connection != null)
-              {
-                 connection.close();
-              }
-           }</code>
-        </pre>
-
-
-
-     </ol>
   </body>
 </html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 ac065f6..9ec66c6 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:./data}/bindings</bindings-directory>
+      <bindings-directory>./data/bindings</bindings-directory>
 
-      <journal-directory>${data.dir:./data}/journal</journal-directory>
+      <journal-directory>./data/journal</journal-directory>
 
-      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
+      <large-messages-directory>./data/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir:./data}/paging</paging-directory>
+      <paging-directory>./data/paging</paging-directory>
 
       <!-- Acceptors -->
       <acceptors>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 bbf95ee..01c528a 100644
--- a/examples/jms/topic-selector-example1/pom.xml
+++ b/examples/jms/topic-selector-example1/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-topic-selector-example1-example</artifactId>
+   <artifactId>topic-selector1</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS Topic Selector Example 1</name>
 
@@ -37,71 +38,81 @@ under the License.
 
    <dependencies>
       <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
       </dependency>
    </dependencies>
 
    <profiles>
       <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>create</id>
-                        <goals>
-                           <goal>create</goal>
-                        </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.TopicSelectorExample1</clientClass>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>cli</goal>
-                        </goals>
-                        <configuration>
-                           <args>
-                              <param>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-topic-selector-example1-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
+         <!-- specify -PnoServer if you don't want to start the server -->
+         <id>noServer</id>
+         <properties>
+            <noServer>true</noServer>
+         </properties>
       </profile>
    </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <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.TopicSelectorExample1</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>topic-selector1</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/topic-selector-example1/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/topic-selector-example1/readme.html b/examples/jms/topic-selector-example1/readme.html
index 630cd2b..5681852 100644
--- a/examples/jms/topic-selector-example1/readme.html
+++ b/examples/jms/topic-selector-example1/readme.html
@@ -27,153 +27,12 @@ under the License.
   <body onload="prettyPrint()">
      <h1>JMS Topic Selector Example 1</h1>
 
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
+
+
      <p>This example shows how messages can be consumed from a topic using Message Selectors.</p>
      <p>Consumers (or Subscribers) will only consume messages routed to a topic that match the provided selector</p>
      <p>Topics and selectors are a standard part of JMS, please consult the JMS 1.1 specification for full details.</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>
-
-     <ol>
-        <li>First we need to get an initial context so we can look-up the JMS connection factory and destination objects from JNDI. This initial context will get it's properties from the <code>client-jndi.properties</code> file in the directory <code>../common/config</code></li>
-        <pre class="prettyprint">
-           <code>initialContext = getContext();</code>
-        </pre>
-
-        <li>We look-up the JMS topic object from JNDI</li>
-        <pre class="prettyprint">
-           <code>Topic topic = (Topic) initialContext.lookup("/topic/exampleTopic");</code>
-        </pre>
-
-        <li>We look-up the JMS connection factory object from JNDI</li>
-        <pre class="prettyprint">
-           <code>ConnectionFactory cf = (ConnectionFactory) initialContext.lookup("/ConnectionFactory");</code>
-        </pre>
-
-        <li>We create a JMS connection</li>
-        <pre class="prettyprint">
-           <code>connection = cf.createConnection();</code>
-        </pre>
-
-        <li>We create a JMS session. The session is created as non transacted and will auto acknowledge messages.</li>
-        <pre class="prettyprint">
-           <code>Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);</code>
-        </pre>
-
-        <li>We create a JMS message producer on the session. This will be used to send the messages.</li>
-        <pre class="prettyprint">
-          <code>MessageProducer messageProducer = session.createProducer(topic);</code>
-        </pre>
-       
-        <li>Create one non-durable subscriber with a specific filter</li>
-        <pre class="prettyprint">
-         <code>MessageConsumer messageConsumer1 = session.createConsumer(topic, "someID=1", false);</code>
-        </pre>
-        
-        <li>Create a second non-durable subscriber with a specific filter</li>
-        <pre class="prettyprint">
-         <code>MessageConsumer messageConsumer2 = session.createConsumer(topic, "someID=2", false);</code>
-        </pre>
-        
-        <li>Create a third non-durable subscriber without any filters, and it should receive the complete set of messages</li>
-        <pre class="prettyprint">
-         <code>MessageConsumer messageConsumer3 = session.createConsumer(topic, "someID=2", false);</code>
-        </pre>
-
-        <li>Send 20 messages, 10 with someID=1, 10 with someID=2 </li>
-        <pre class="prettyprint"><code>
-         for (int i = 1; i < 10; i++)
-         {
-            for (int someID = 1; someID <= 2; someID++)
-            {
-               TextMessage message1 = session.createTextMessage("This is a text message " + i +
-                                                                " sent for someID=" +
-                                                                someID);
-
-               message1.setIntProperty("someID", someID);
-
-               producer.send(message1);
-
-               System.out.println("Sent message: " + message1.getText());
-            }
-         }</code></pre>
-
-        <li>We start the connection. In order for delivery to occur on any consumers or subscribers on a connection, the connection must be started</li>
-        <pre class="prettyprint">           <code>connection.start();</code>
-        </pre>
-
-
-        <li>Consume the messages from MessageConsumer1, filtering out someID=2</li>
-        <pre class="prettyprint"><code>
-         for (;;)
-         {
-            TextMessage messageReceivedA = (TextMessage)messageConsumer1.receive(1000);
-            if (messageReceivedA == null)
-            {
-               break;
-            }
-
-            System.out.println("messageConsumer1 received " + messageReceivedA.getText() +
-                               " someID = " +
-                               messageReceivedA.getIntProperty("someID"));
-         }</code></pre>
-           
-        <li>Consume the messages from MessageConsumer2, filtering out someID=1</li>
-        <pre class="prettyprint"><code>
-        for (;;)
-         {
-            TextMessage messageReceivedB = (TextMessage)messageConsumer2.receive(1000);
-            if (messageReceivedB == null)
-            {
-               break;
-            }
-
-            System.out.println("messageConsumer2 received " + messageReceivedB.getText() +
-                               " someID = " +
-                               messageReceivedB.getIntProperty("someID"));
-         }</code></pre>
-
-        <li>Consume the messages from MessageConsumer3, receiving the complete set of messages</li>
-        <pre class="prettyprint"><code>
-         for (;;)
-         {
-            TextMessage messageReceivedC = (TextMessage)messageConsumer3.receive(1000);
-            if (messageReceivedC == null)
-            {
-               break;
-            }
-            System.out.println("messageConsumer3 received " + messageReceivedC.getText() +
-                               " someID = " +
-                               messageReceivedC.getIntProperty("someID"));
-         }</code></pre>
-
-        <li>Close the consumers</li>
-        <pre class="prettyprint"><code>subscriberA.close();</code></pre>
-        <pre class="prettyprint"><code>subscriberB.close();</code></pre>
-        
-        <li>Delete the subscriptions when you're done</li>
-        <pre class="prettyprint"><code>session.unsubscribe("sub-a1");</code></pre>
-		<pre class="prettyprint"><code>session.unsubscribe("sub-a2");</code></pre>
-        
-         <li>And finally, <b>always</b> remember to close your JMS connections and resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
-
-        <pre class="prettyprint">
-           <code>finally
-           {
-              if (initialContext != null)
-              {
-                initialContext.close();
-              }
-              if (connection != null)
-              {
-                 connection.close();
-              }
-           }</code>
-        </pre>
-
-
-
-     </ol>
   </body>
 </html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 4a4b505..d45eb5d 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:./data}/bindings</bindings-directory>
+      <bindings-directory>./data/bindings</bindings-directory>
 
-      <journal-directory>${data.dir:./data}/journal</journal-directory>
+      <journal-directory>./data/journal</journal-directory>
 
-      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
+      <large-messages-directory>./data/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir:./data}/paging</paging-directory>
+      <paging-directory>./data/paging</paging-directory>
 
       <!-- Acceptors -->
       <acceptors>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 b9f5332..cd23209 100644
--- a/examples/jms/topic-selector-example2/pom.xml
+++ b/examples/jms/topic-selector-example2/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-topic-selector-example2-example</artifactId>
+   <artifactId>topic-selector2</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS Topic Selector Example 2</name>
 
@@ -37,71 +38,81 @@ under the License.
 
    <dependencies>
       <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
       </dependency>
    </dependencies>
 
    <profiles>
       <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>create</id>
-                        <goals>
-                           <goal>create</goal>
-                        </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.TopicSelectorExample2</clientClass>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>cli</goal>
-                        </goals>
-                        <configuration>
-                           <args>
-                              <param>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-topic-selector-example2-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
+         <!-- specify -PnoServer if you don't want to start the server -->
+         <id>noServer</id>
+         <properties>
+            <noServer>true</noServer>
+         </properties>
       </profile>
    </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <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.TopicSelectorExample2</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>topic-selector2</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/topic-selector-example2/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/topic-selector-example2/readme.html b/examples/jms/topic-selector-example2/readme.html
index 2962812..8cb82c2 100644
--- a/examples/jms/topic-selector-example2/readme.html
+++ b/examples/jms/topic-selector-example2/readme.html
@@ -27,131 +27,21 @@ under the License.
   <body onload="prettyPrint()">
      <h1>JMS Topic Selector Example 2</h1>
 
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
+
+
      <p>This example shows you how to selectively consume messages using message selectors with topic consumers.</p>
-     
+
      <p>Message selectors are strings with special syntax that can be used in creating consumers. Message consumers
      that are thus created only receive messages that match its selector. On message delivering, the ActiveMQ
      Server evaluates the corresponding message headers of the messages against each selector, if any, and then delivers
      the 'matched' messages to its consumer. Please consult the JMS 1.1 specification for full details.</p>
-     
+
      <p>In this example, three message consumers are created on a topic. The first consumer is created with selector
      <code>'color=red'</code>, it only receives messages that
-     have a 'color' string property of 'red' value; the second is created with selector <code>'color=green'</code>, it 
-     only receives messages who have a 'color' string property of 
-     'green' value; and the third without a selector, which means it receives all messages. To illustrate, three messages 
+     have a 'color' string property of 'red' value; the second is created with selector <code>'color=green'</code>, it
+     only receives messages who have a 'color' string property of
+     'green' value; and the third without a selector, which means it receives all messages. To illustrate, three messages
      with different 'color' property values are created and sent.</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>
-
-     <ol>
-        <li>First we need to get an initial context so we can look-up the JMS connection factory and destination objects from JNDI. This initial context will get it's properties from the <code>client-jndi.properties</code> file in the directory <code>../common/config</code></li>
-        <pre class="prettyprint">
-           <code>InitialContext initialContext = getContext();</code>
-        </pre>
-
-        <li>We look-up the JMS topic object from JNDI</li>
-        <pre class="prettyprint">
-           <code>Topic topic = (Topic) initialContext.lookup("/topic/exampleTopic");</code>
-        </pre>
-
-        <li>We look-up the JMS connection factory object from JNDI</li>
-        <pre class="prettyprint">
-           <code>ConnectionFactory cf = (ConnectionFactory) initialContext.lookup("/ConnectionFactory");</code>
-        </pre>
-
-        <li>We create a JMS connection</li>
-        <pre class="prettyprint">
-           <code>connection = cf.createConnection();</code>
-        </pre>
-
-        <li>We start the connection</li>
-        <pre class="prettyprint">
-           <code>connection.start();</code>
-        </pre>
-
-        <li>We create a JMS session. The session is created as non transacted and will auto acknowledge messages.</li>
-        <pre class="prettyprint">
-           <code>Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);</code>
-        </pre>
-
-        <li>We create a JMS message producer on the session. This will be used to send the messages.</li>
-        <pre class="prettyprint">
-          <code>MessageProducer messageProducer = session.createProducer(topic);</code>
-       </pre>
-
-        <li>We create two selectors.</li>
-         <pre class="prettyprint">
-           <code>
-           String redSelector = "color='red'";
-           String greenSelector = "color='green'";
-           </code>
-         </pre>
-
-        <li>We Create a JMS Message Consumer that receives 'red' messages.</li>
-        <pre class="prettyprint">
-          <code>
-          MessageConsumer redConsumer = session.createConsumer(topic, redSelector);
-          redConsumer.setMessageListener(new SimpleMessageListener("red"));
-         </code>
-        </pre>
-
-        <li>We Create a second JMS Message Consumer that receives 'green' messages.</li>
-        <pre class="prettyprint">
-          <code>
-          MessageConsumer greenConsumer = session.createConsumer(topic, greenSelector);
-          greenConsumer.setMessageListener(new SimpleMessageListener("green"));
-         </code>
-        </pre>
-
-        <li>We Create another JMS Message Consumer that receives all messages.</li>
-        <pre class="prettyprint">
-          <code>
-          MessageConsumer allConsumer = session.createConsumer(topic);
-          allConsumer.setMessageListener(new SimpleMessageListener("all"));
-         </code>
-        </pre>
-
-        <li>We Create three messages, each has a different color property.</li>
-        <pre class="prettyprint">
-           <code>
-           TextMessage redMessage = session.createTextMessage("Red");
-           redMessage.setStringProperty("color", "red");
-           TextMessage greenMessage = session.createTextMessage("Green");
-           greenMessage.setStringProperty("color", "green");
-           TextMessage blueMessage = session.createTextMessage("Blue");
-           blueMessage.setStringProperty("color", "blue");
-           </code>
-        </pre>
-
-        <li>We send the messages to the topic</li>
-        <pre class="prettyprint">
-           <code>
-           producer.send(redMessage);
-           System.out.println("Message sent: " + redMessage.getText());
-           producer.send(greenMessage);
-           System.out.println("Message sent: " + greenMessage.getText());
-           producer.send(blueMessage);
-           System.out.println("Message sent: " + blueMessage.getText());
-           </code>
-        </pre>
-        
-        <li>And finally, <b>always</b> remember to close your JMS connections and resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
-
-        <pre class="prettyprint">
-           <code>finally
-           {
-              if (initialContext != null)
-              {
-                initialContext.close();
-              }
-              if (connection != null)
-              {
-                 connection.close();
-              }
-           }</code>
-        </pre>
-
-     </ol>
   </body>
 </html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 4a4b505..d45eb5d 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:./data}/bindings</bindings-directory>
+      <bindings-directory>./data/bindings</bindings-directory>
 
-      <journal-directory>${data.dir:./data}/journal</journal-directory>
+      <journal-directory>./data/journal</journal-directory>
 
-      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
+      <large-messages-directory>./data/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir:./data}/paging</paging-directory>
+      <paging-directory>./data/paging</paging-directory>
 
       <!-- Acceptors -->
       <acceptors>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/topic/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/topic/pom.xml b/examples/jms/topic/pom.xml
index 2c6a91a..7e5005e 100644
--- a/examples/jms/topic/pom.xml
+++ b/examples/jms/topic/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-topic-example</artifactId>
+   <artifactId>topic</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS Topic Example</name>
 
@@ -37,69 +38,80 @@ under the License.
 
    <dependencies>
       <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
       </dependency>
    </dependencies>
+
    <profiles>
       <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>create</id>
-                        <goals>
-                           <goal>create</goal>
-                        </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.TopicExample</clientClass>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>cli</goal>
-                        </goals>
-                        <configuration>
-                           <args>
-                              <param>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-topic-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
+         <!-- specify -PnoServer if you don't want to start the server -->
+         <id>noServer</id>
+         <properties>
+            <noServer>true</noServer>
+         </properties>
       </profile>
    </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <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.TopicExample</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>topic</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/topic/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/topic/readme.html b/examples/jms/topic/readme.html
index 56b0a07..45358cb 100644
--- a/examples/jms/topic/readme.html
+++ b/examples/jms/topic/readme.html
@@ -27,97 +27,10 @@ under the License.
   <body onload="prettyPrint()">
      <h1>JMS Topic Example</h1>
 
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
+
      <p>This example shows you how to send and receive a message to a JMS Topic with ActiveMQ Artemis.</p>
      <p>Topics are a standard part of JMS, please consult the JMS 1.1 specification for full details.</p>
      <p>A Topic is used to send messages using the publish-subscribe model, from a producer to 1 or more consumers.</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>
-
-     <ol>
-        <li>First we need to get an initial context so we can look-up the JMS connection factory and destination objects from JNDI. This initial context will get it's properties from the <code>client-jndi.properties</code> file in the directory <code>../common/config</code></li>
-        <pre class="prettyprint">
-           <code>InitialContext initialContext = getContext();</code>
-        </pre>
-
-        <li>We look-up the JMS topic object from JNDI</li>
-        <pre class="prettyprint">
-           <code>Topic topic = (Topic) initialContext.lookup("/topic/exampleTopic");</code>
-        </pre>
-
-        <li>We look-up the JMS connection factory object from JNDI</li>
-        <pre class="prettyprint">
-           <code>ConnectionFactory cf = (ConnectionFactory) initialContext.lookup("/ConnectionFactory");</code>
-        </pre>
-
-        <li>We create a JMS connection</li>
-        <pre class="prettyprint">
-           <code>connection = cf.createConnection();</code>
-        </pre>
-
-        <li>We create a JMS session. The session is created as non transacted and will auto acknowledge messages.</li>
-        <pre class="prettyprint">
-           <code>Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);</code>
-        </pre>
-
-        <li>We create a JMS message producer on the session. This will be used to send the messages.</li>
-        <pre class="prettyprint">
-          <code>MessageProducer messageProducer = session.createProducer(topic);</code>
-       </pre>
-
-        <li>We create a JMS Message Consumer, messageConsumer1, to receive the message.</li>
-         <pre class="prettyprint">
-           <code>MessageConsumer messageConsumer = session.createConsumer(topic);</code>
-         </pre>
-
-        <li>We create a JMS Message Consumer, messageConsumer2, to also receive the message.</li>
-        <pre class="prettyprint">
-          <code>MessageConsumer messageConsumer2 = session.createConsumer(topic);</code>
-        </pre>
-
-        <li>We create a JMS text message that we are going to send.</li>
-        <pre class="prettyprint">
-           <code>TextMessage message = session.createTextMessage("This is a text message");</code>
-        </pre>
-
-        <li>We send message to the topic</li>
-        <pre class="prettyprint">
-           <code>messageProducer.send(message);</code>
-        </pre>
-
-        <li>We start the connection. In order for delivery to occur on any consumers or subscribers on a connection, the connection must be started</li>
-        <pre class="prettyprint">
-           <code>connection.start();</code>
-        </pre>
-
-        <li>The message arrives at the first consumer</li>
-        <pre class="prettyprint">
-           <code>TextMessage messageReceived = (TextMessage) messageConsumer1.receive();</code>
-        </pre>
-
-        <li>The message arrives at the second consumer</li>
-        <pre class="prettyprint">
-           <code>messageReceived = (TextMessage) messageConsumer2.receive();</code>
-        </pre>
-        
-        <li>And finally, <b>always</b> remember to close your JMS connections and resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
-
-        <pre class="prettyprint">
-           <code>finally
-           {
-              if (initialContext != null)
-              {
-                initialContext.close();
-              }
-              if (connection != null)
-              {
-                 connection.close();
-              }
-           }</code>
-        </pre>
-
-
-
-     </ol>
   </body>
 </html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 f379d55..fd6671c 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:./data}/bindings</bindings-directory>
+      <bindings-directory>./data/bindings</bindings-directory>
 
-      <journal-directory>${data.dir:./data}/journal</journal-directory>
+      <journal-directory>./data/journal</journal-directory>
 
-      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
+      <large-messages-directory>./data/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir:./data}/paging</paging-directory>
+      <paging-directory>./data/paging</paging-directory>
 
       <!-- Acceptors -->
       <acceptors>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/transaction-failover/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/transaction-failover/pom.xml b/examples/jms/transaction-failover/pom.xml
index 0fe0ec8..d5bc653 100644
--- a/examples/jms/transaction-failover/pom.xml
+++ b/examples/jms/transaction-failover/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-transaction-failover-example</artifactId>
+   <artifactId>transaction-failover</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS Transaction Failover Example</name>
 
@@ -47,62 +48,57 @@ under the License.
       </dependency>
    </dependencies>
 
-   <profiles>
-      <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <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>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <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>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>runClient</id>
-                        <goals>
-                           <goal>runClient</goal>
-                        </goals>
-                        <configuration>
-                           <clientClass>org.apache.activemq.artemis.jms.example.TransactionFailoverExample</clientClass>
-                           <args>
-                              <param>${basedir}/target/server0</param>
-                              <param>${basedir}/target/server1</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-transaction-failover-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
-      </profile>
-   </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <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>
+                  </configuration>
+               </execution>
+               <execution>
+                  <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>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>runClient</id>
+                  <goals>
+                     <goal>runClient</goal>
+                  </goals>
+                  <configuration>
+                     <clientClass>org.apache.activemq.artemis.jms.example.TransactionFailoverExample</clientClass>
+                     <args>
+                        <param>${basedir}/target/server0</param>
+                        <param>${basedir}/target/server1</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>transaction-failover</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/transaction-failover/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/transaction-failover/readme.html b/examples/jms/transaction-failover/readme.html
index f6b4c5d..5df44bd 100644
--- a/examples/jms/transaction-failover/readme.html
+++ b/examples/jms/transaction-failover/readme.html
@@ -26,123 +26,21 @@ under the License.
   </head>
   <body onload="prettyPrint()">
      <h1>JMS Failover With Transaction Example</h1>
-     
+
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory.</pre>
+
+
      <p>This example demonstrates two servers coupled as a live-backup pair for high availability (HA), and a client
      connection failing over from live to backup when the live server is crashed.</p>
      <p>Failover behavior differs whether the JMS session is transacter or not.</p>
      <p>When a <em>transacted</em> JMS session is used, once-and-only once delivery is guaranteed.</p>
      <ul>
-        <li>if the failover occurs while there is an in-flight transaction, the transaction will be flagged as <em>rollback only</em>. In that case, the JMS client 
+        <li>if the failover occurs while there is an in-flight transaction, the transaction will be flagged as <em>rollback only</em>. In that case, the JMS client
            will need to retry the transaction work.</li>
         <li>if the failover occurs while there is <em>no</em> in-flight transaction, the failover will be transparent to the user.</li>
      </ul>
      <p>ActiveMQ Artemis also provides an example for <a href="../non-transactional-failover/readme.html">non-transaction failover</a>.</p>
      <p>For more information on ActiveMQ Artemis failover and HA, and clustering in general, please see the clustering
      section of the user manual.</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>
-     <p>In this example, the live server is server 1, and the backup server is server 0</p>
-     <p>The connection will initially be created to server1, server 1 will crash, and the client will carry on
-     seamlessly on server 0, the backup server.</p>
-
-     <ol>
-        <li>Get an initial context for looking up JNDI from server #1.</li>
-        <pre class="prettyprint">
-           initialContext = getContext(1);
-        </pre>
-
-        <li>Look up the JMS resources from JNDI on server #1.</li>
-        <pre class="prettyprint">
-           Queue queue = (Queue)initialContext.lookup("/queue/exampleQueue");
-           ConnectionFactory connectionFactory = (ConnectionFactory)initialContext.lookup("/ConnectionFactory");
-        </pre>
-
-        <li>Create a JMS Connection</li>
-        <pre class="prettyprint">
-           connection = connectionFactory.createConnection();
-        </pre>
-        
-        <li>Create a JMS <em>transacted</em> Session</li>
-        <pre class="prettyprint">
-           Session session = connection.createSession(true, 0);
-        </pre>
-        
-        <li>Start the connection to ensure delivery occurs</li>
-        <pre class="prettyprint">
-           connection.start();
-        </pre>
-
-        <li>Create a JMS MessageProducer</li>
-        <pre class="prettyprint">
-           MessageProducer producer = session.createProducer(queue);
-        </pre>
-
-        <li>Create a JMS MessageConsumer</li>
-        <pre class="prettyprint">
-           MessageConsumer consumer = session.createConsumer(queue);
-        </pre>
-
-        <li>Send half of the messages, kill the live server and send the remaining messages</li>
-        <pre class="prettyprint">
-           sendMessages(session, producer, numMessages, true);
-        </pre>
-        
-        <p>When server #1 crashes, the client automatically detects the failure and automatically
-            fails over from server #1 to server #0 (in your real program you wouldn't need to sleep).
-        </p>
-        
-        <li>As failover occurred during transaction, the session has been marked for <em>rollback only</em> and commit will fail</li>
-        <pre class="prettyprint">
-           try
-           {
-              session.commit();
-           } catch (TransactionRolledBackException e)
-           {
-              System.err.println("transaction has been rolled back: " + e.getMessage());
-           }
-        </pre>
-        
-        <li>We resend all the messages</li>
-        <pre class="prettyprint">
-           sendMessages(session, producer, numMessages, false);
-        </pre>
-
-        <li>We commit the session successfully: the messages will be all delivered to the activated backup server</li>
-        <pre class="prettyprint">
-           session.commit();
-        </pre>
-        
-
-        <li>We are now transparently reconnected to server #0, the backup server.
-            We consume the messages sent before the crash of the live server, commit the session, and check there are no other message on the queue</li>
-        <pre class="prettyprint">
-        for (int i = 0; i &lt; numMessages; i++)
-        {
-           TextMessage message0 = (TextMessage)consumer.receive(5000);
-           System.out.println("Got message: " + message0.getText());
-        }
-        session.commit();
-        System.out.println("Other message on the server? " + consumer.receive(5000));
-        </pre>
-        
-        <li>And finally, <strong>always</strong> remember to close your resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
-
-        <pre class="prettyprint">
-           finally
-           {
-              if (connection != null)
-              {
-                 connection.close();
-              }
-
-              if (initialContext != null)
-              {
-                 initialContext.close();
-              }
-           }
-        </pre>
-
-     </ol>
   </body>
 </html>


[18/18] activemq-artemis git commit: This closes #113 removing example profile

Posted by cl...@apache.org.
This closes #113 removing example profile


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

Branch: refs/heads/master
Commit: 4ed21a44c55a8ba5aedfef92b800214208a57735
Parents: d4de650 dd82031
Author: Clebert Suconic <cl...@apache.org>
Authored: Fri Aug 7 15:30:55 2015 -0400
Committer: Clebert Suconic <cl...@apache.org>
Committed: Fri Aug 7 15:30:55 2015 -0400

----------------------------------------------------------------------
 .../artemis/cli/commands/ActionContext.java     |   6 +-
 .../activemq/artemis/cli/commands/Create.java   |  53 +-
 .../artemis/cli/commands/InputAbstract.java     |   2 +-
 .../cli/commands/tools/XmlDataExporter.java     |   2 +-
 .../artemis/cli/commands/etc/broker.xml         |   2 +-
 .../apache/activemq/cli/test/ArtemisTest.java   |  30 +-
 .../core/client/ActiveMQClientLogger.java       |   2 +-
 .../src/main/resources/README.html              |   2 +-
 .../artemis/maven/ActiveMQClientPlugin.java     |  65 ---
 .../artemis/maven/ActiveMQCreatePlugin.java     | 343 ------------
 .../artemis/maven/ArtemisAbstractPlugin.java    |  48 ++
 .../artemis/maven/ArtemisCLIPlugin.java         |  16 +-
 .../artemis/maven/ArtemisClientPlugin.java      |  65 +++
 .../artemis/maven/ArtemisCreatePlugin.java      | 364 +++++++++++++
 .../artemis/maven/LibInstallPlugin.java         | 147 -----
 .../server/impl/SharedStoreLiveActivation.java  |   3 -
 .../core/transaction/TransactionFactory.java    |   3 -
 docs/user-manual/en/using-server.md             |   4 +-
 examples/core/embedded/pom.xml                  |   5 -
 examples/core/embedded/readme.html              |   2 +-
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 examples/core/pom.xml                           |   3 +-
 examples/jms/README.md                          |  13 +-
 examples/jms/aerogear/pom.xml                   | 157 +++---
 examples/jms/aerogear/readme.html               |   3 +
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 examples/jms/application-layer-failover/pom.xml | 113 ++--
 .../jms/application-layer-failover/readme.html  |  15 +-
 .../ApplicationLayerFailoverExample.java        |  40 +-
 examples/jms/bridge/pom.xml                     | 227 ++++----
 examples/jms/bridge/readme.html                 | 162 +-----
 examples/jms/browser/pom.xml                    | 135 ++---
 examples/jms/browser/readme.html                | 113 +---
 .../jms/example/QueueBrowserExample.java        |   3 +
 examples/jms/client-kickoff/pom.xml             | 142 ++---
 examples/jms/client-kickoff/readme.html         | 106 +---
 .../jms/client-side-failoverlistener/pom.xml    | 126 ++---
 .../client-side-failoverlistener/readme.html    |  78 +--
 examples/jms/client-side-load-balancing/pom.xml | 302 ++++++-----
 .../jms/client-side-load-balancing/readme.html  | 127 +----
 .../jms/clustered-durable-subscription/pom.xml  | 227 ++++----
 .../clustered-durable-subscription/readme.html  | 155 +-----
 .../ClusteredDurableSubscriptionExample.java    |  62 +--
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 .../main/resources/activemq/server1/broker.xml  |   8 +-
 examples/jms/clustered-grouping/pom.xml         | 299 +++++-----
 examples/jms/clustered-grouping/readme.html     | 190 +------
 .../jms/example/ClusteredGroupingExample.java   |  91 +---
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 .../main/resources/activemq/server1/broker.xml  |   8 +-
 .../main/resources/activemq/server2/broker.xml  |   8 +-
 examples/jms/clustered-jgroups/pom.xml          | 235 ++++----
 examples/jms/clustered-jgroups/readme.html      | 150 +----
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 .../main/resources/activemq/server1/broker.xml  |   8 +-
 examples/jms/clustered-queue/pom.xml            | 220 ++++----
 examples/jms/clustered-queue/readme.html        | 144 +----
 .../jms/example/ClusteredQueueExample.java      |  43 +-
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 examples/jms/clustered-standalone/pom.xml       | 188 -------
 examples/jms/clustered-standalone/readme.html   |  70 ---
 .../jms/example/ClusteredStandaloneExample.java | 181 -------
 .../main/resources/activemq/server0/broker.xml  |  95 ----
 .../main/resources/activemq/server1/broker.xml  |  95 ----
 .../main/resources/activemq/server2/broker.xml  |  95 ----
 examples/jms/clustered-static-discovery/pom.xml | 376 +++++++------
 .../jms/clustered-static-discovery/readme.html  | 143 +----
 .../example/StaticClusteredQueueExample.java    |  30 +-
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 .../main/resources/activemq/server1/broker.xml  |   8 +-
 .../main/resources/activemq/server2/broker.xml  |   8 +-
 .../main/resources/activemq/server3/broker.xml  |   8 +-
 examples/jms/clustered-static-oneway/pom.xml    | 299 +++++-----
 .../jms/clustered-static-oneway/readme.html     | 186 +------
 .../jms/example/ClusterStaticOnewayExample.java |  28 +-
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 .../main/resources/activemq/server1/broker.xml  |   8 +-
 .../main/resources/activemq/server2/broker.xml  |   8 +-
 examples/jms/clustered-topic/pom.xml            | 223 ++++----
 examples/jms/clustered-topic/readme.html        | 140 +----
 .../jms/example/ClusteredTopicExample.java      |  46 +-
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 .../main/resources/activemq/server1/broker.xml  |   8 +-
 .../jms/colocated-failover-scale-down/pom.xml   | 115 ++--
 .../colocated-failover-scale-down/readme.html   | 130 +----
 examples/jms/colocated-failover/pom.xml         | 113 ++--
 examples/jms/colocated-failover/readme.html     | 139 +----
 examples/jms/consumer-rate-limit/pom.xml        | 133 ++---
 examples/jms/consumer-rate-limit/readme.html    | 127 +----
 examples/jms/dead-letter/pom.xml                | 134 ++---
 examples/jms/dead-letter/readme.html            | 168 +-----
 examples/jms/delayed-redelivery/pom.xml         | 134 ++---
 examples/jms/delayed-redelivery/readme.html     | 139 +----
 examples/jms/divert/pom.xml                     | 223 ++++----
 examples/jms/divert/readme.html                 | 321 +----------
 .../artemis/jms/example/DivertExample.java      |  46 +-
 examples/jms/durable-subscription/pom.xml       | 134 ++---
 examples/jms/durable-subscription/readme.html   | 124 +----
 examples/jms/embedded-simple/pom.xml            |  67 ++-
 examples/jms/embedded/pom.xml                   |  67 ++-
 examples/jms/embedded/readme.html               |  71 +--
 examples/jms/expiry/pom.xml                     | 134 ++---
 examples/jms/expiry/readme.html                 | 149 +----
 examples/jms/ha-policy-autobackup/pom.xml       | 113 ++--
 .../jms/example/HAPolicyAutoBackupExample.java  |  41 +-
 examples/jms/http-transport/pom.xml             | 134 ++---
 examples/jms/http-transport/readme.html         |  89 +--
 .../jms/example/HttpTransportExample.java       |  17 +-
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 .../src/main/resources/jndi.properties          |  20 -
 .../jms/instantiate-connection-factory/pom.xml  | 139 ++---
 .../instantiate-connection-factory/readme.html  |  96 +---
 .../InstantiateConnectionFactoryExample.java    |  20 +-
 examples/jms/interceptor/pom.xml                | 134 ++---
 examples/jms/interceptor/readme.html            | 110 +---
 examples/jms/jms-auto-closeable/pom.xml         | 130 ++---
 examples/jms/jms-auto-closeable/readme.html     |   3 +-
 .../jms/example/JMSAutoCloseableExample.java    |  58 +-
 examples/jms/jms-bridge/pom.xml                 | 222 ++++----
 examples/jms/jms-bridge/readme.html             |   3 +
 examples/jms/jms-completion-listener/pom.xml    | 134 ++---
 .../jms/jms-completion-listener/readme.html     |   3 +-
 .../example/JMSCompletionListenerExample.java   |  16 +-
 examples/jms/jms-context/pom.xml                | 133 ++---
 examples/jms/jms-context/readme.html            |  62 +--
 .../artemis/jms/example/JMSContextExample.java  |  47 +-
 .../src/main/resources/jndi.properties          |  20 -
 examples/jms/jms-shared-consumer/pom.xml        | 135 ++---
 examples/jms/jms-shared-consumer/readme.html    |   3 +-
 examples/jms/jmx/pom.xml                        | 140 ++---
 examples/jms/jmx/readme.html                    |  33 +-
 examples/jms/large-message/pom.xml              |  85 ++-
 examples/jms/large-message/readme.html          |  28 +-
 examples/jms/last-value-queue/pom.xml           | 133 ++---
 examples/jms/last-value-queue/readme.html       |  25 +-
 .../jms/example/LastValueQueueExample.java      |  26 +-
 examples/jms/management-notifications/pom.xml   | 133 ++---
 .../jms/management-notifications/readme.html    |  40 +-
 examples/jms/management/pom.xml                 | 132 ++---
 examples/jms/message-counters/pom.xml           | 142 ++---
 examples/jms/message-counters/readme.html       |  35 +-
 examples/jms/message-group/pom.xml              | 133 ++---
 examples/jms/message-group/readme.html          |  13 +-
 .../jms/example/MessageGroupExample.java        |  23 +-
 examples/jms/message-group2/pom.xml             | 133 ++---
 examples/jms/message-group2/readme.html         |  14 +-
 .../jms/example/MessageGroup2Example.java       |  22 +-
 .../src/main/resources/jndi.properties          |  20 -
 examples/jms/message-priority/pom.xml           | 133 ++---
 examples/jms/message-priority/readme.html       |  19 +-
 .../jms/example/MessagePriorityExample.java     |  14 +-
 .../src/main/resources/jndi.properties          |  20 -
 examples/jms/multiple-failover-failback/pom.xml | 148 +++--
 examples/jms/multiple-failover/pom.xml          | 148 +++--
 examples/jms/no-consumer-buffering/pom.xml      | 133 ++---
 examples/jms/no-consumer-buffering/readme.html  |  67 +--
 .../jms/example/NoConsumerBufferingExample.java |  18 +-
 examples/jms/non-transaction-failover/pom.xml   | 127 +++--
 .../jms/non-transaction-failover/readme.html    |  22 +-
 examples/jms/openwire/pom.xml                   | 110 ----
 examples/jms/openwire/readme.html               |  98 ----
 .../artemis/jms/example/OpenWireExample.java    |  91 ----
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |  71 ---
 examples/jms/paging/pom.xml                     | 133 ++---
 examples/jms/paging/readme.html                 |  40 +-
 examples/jms/perf/pom.xml                       |   4 +-
 examples/jms/pom.xml                            | 122 +----
 examples/jms/pre-acknowledge/pom.xml            | 132 ++---
 examples/jms/pre-acknowledge/readme.html        |  36 +-
 .../jms/example/PreacknowledgeExample.java      |  17 +-
 examples/jms/producer-rate-limit/pom.xml        | 133 ++---
 examples/jms/producer-rate-limit/readme.html    |  27 +-
 .../jms/example/ProducerRateLimitExample.java   |  16 +-
 examples/jms/proton-cpp/pom.xml                 | 128 +++--
 examples/jms/proton-j/pom.xml                   | 128 +++--
 examples/jms/proton-j/readme.html               |   3 +
 examples/jms/proton-ruby/pom.xml                |  64 +--
 examples/jms/proton-ruby/readme.html            |   2 +-
 .../jms/queue-message-redistribution/pom.xml    | 223 ++++----
 .../queue-message-redistribution/readme.html    | 195 +------
 .../QueueMessageRedistributionExample.java      |  36 +-
 examples/jms/queue-requestor/pom.xml            | 128 ++---
 examples/jms/queue-requestor/readme.html        |  99 +---
 examples/jms/queue-selector/pom.xml             | 133 ++---
 examples/jms/queue-selector/readme.html         | 127 +----
 examples/jms/queue/pom.xml                      | 133 ++---
 examples/jms/queue/readme.html                  |  82 +--
 examples/jms/reattach-node/pom.xml              | 138 ++---
 examples/jms/reattach-node/readme.html          | 102 +---
 .../artemis/jms/example/ReattachExample.java    |   9 +-
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 examples/jms/replicated-failback-static/pom.xml | 119 ++--
 .../jms/replicated-failback-static/readme.html  | 138 +----
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 .../main/resources/activemq/server1/broker.xml  |   8 +-
 examples/jms/replicated-failback/pom.xml        | 114 ++--
 examples/jms/replicated-failback/readme.html    | 138 +----
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 .../main/resources/activemq/server1/broker.xml  |   8 +-
 .../jms/replicated-multiple-failover/pom.xml    | 144 +++--
 .../replicated-multiple-failover/readme.html    | 133 +----
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 .../main/resources/activemq/server1/broker.xml  |   8 +-
 .../main/resources/activemq/server2/broker.xml  |   8 +-
 .../jms/replicated-transaction-failover/pom.xml | 121 ++---
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 .../main/resources/activemq/server1/broker.xml  |   8 +-
 examples/jms/request-reply/pom.xml              | 137 ++---
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |  67 ---
 examples/jms/rest/dup-send/pom.xml              |   2 +-
 examples/jms/rest/javascript-chat/pom.xml       |   2 +-
 examples/jms/rest/jms-to-rest/pom.xml           |   2 +-
 examples/jms/rest/pom.xml                       |   2 +-
 examples/jms/rest/push/pom.xml                  |   2 +-
 examples/jms/scale-down/pom.xml                 | 117 ++--
 examples/jms/scale-down/readme.html             | 126 +----
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 .../main/resources/activemq/server1/broker.xml  |   8 +-
 examples/jms/scheduled-message/pom.xml          | 133 ++---
 examples/jms/scheduled-message/readme.html      |  15 +-
 examples/jms/security/pom.xml                   | 137 ++---
 examples/jms/security/readme.html               |  49 +-
 examples/jms/send-acknowledgements/pom.xml      | 127 ++---
 examples/jms/send-acknowledgements/readme.html  |  29 +-
 examples/jms/spring-integration/pom.xml         |  62 +--
 examples/jms/spring-integration/readme.html     |   6 +-
 examples/jms/ssl-enabled/pom.xml                | 133 ++---
 examples/jms/ssl-enabled/readme.html            |  99 +---
 examples/jms/static-selector-jms/pom.xml        | 106 ----
 examples/jms/static-selector-jms/readme.html    | 158 ------
 .../jms/example/StaticSelectorJMSExample.java   | 147 -----
 .../activemq/server0/artemis-roles.properties   |  17 -
 .../activemq/server0/artemis-users.properties   |  17 -
 .../main/resources/activemq/server0/broker.xml  |  62 ---
 .../src/main/resources/jndi.properties          |  20 -
 examples/jms/static-selector/pom.xml            |  26 +-
 examples/jms/static-selector/readme.html        | 120 +---
 examples/jms/stomp-websockets/pom.xml           | 133 ++---
 examples/jms/stomp-websockets/readme.html       |   7 +-
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 examples/jms/stomp/pom.xml                      | 133 ++---
 examples/jms/stomp/readme.html                  | 100 +---
 examples/jms/stomp1.1/pom.xml                   | 135 ++---
 examples/jms/stomp1.1/readme.html               | 108 +---
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 examples/jms/stomp1.2/pom.xml                   | 133 ++---
 examples/jms/stomp1.2/readme.html               | 108 +---
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 examples/jms/stop-server-failover/pom.xml       | 234 ++++----
 examples/jms/stop-server-failover/readme.html   | 121 +----
 examples/jms/symmetric-cluster/pom.xml          | 541 ++++++++++---------
 examples/jms/symmetric-cluster/readme.html      | 208 +------
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 .../main/resources/activemq/server1/broker.xml  |   8 +-
 .../main/resources/activemq/server2/broker.xml  |   8 +-
 .../main/resources/activemq/server3/broker.xml  |   8 +-
 .../main/resources/activemq/server4/broker.xml  |   8 +-
 .../main/resources/activemq/server5/broker.xml  |   8 +-
 examples/jms/temp-queue/pom.xml                 | 133 ++---
 examples/jms/temp-queue/readme.html             | 128 +----
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 examples/jms/topic-hierarchies/pom.xml          | 132 ++---
 examples/jms/topic-hierarchies/readme.html      | 164 +-----
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 examples/jms/topic-selector-example1/pom.xml    | 133 ++---
 .../jms/topic-selector-example1/readme.html     | 147 +----
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 examples/jms/topic-selector-example2/pom.xml    | 133 ++---
 .../jms/topic-selector-example2/readme.html     | 126 +----
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 examples/jms/topic/pom.xml                      | 134 ++---
 examples/jms/topic/readme.html                  |  91 +---
 .../main/resources/activemq/server0/broker.xml  |   8 +-
 examples/jms/transaction-failover/pom.xml       | 114 ++--
 examples/jms/transaction-failover/readme.html   | 112 +---
 examples/jms/transactional/pom.xml              | 133 ++---
 examples/jms/transactional/readme.html          | 114 +---
 examples/jms/xa-heuristic/pom.xml               | 145 ++---
 examples/jms/xa-heuristic/readme.html           | 215 +-------
 examples/jms/xa-receive/pom.xml                 | 135 ++---
 examples/jms/xa-receive/readme.html             | 190 +------
 examples/jms/xa-send/pom.xml                    | 135 ++---
 examples/pom.xml                                |   1 +
 pom.xml                                         |   1 -
 .../MQTTNetworkOfBrokersFailoverTest.java       |   4 -
 289 files changed, 8206 insertions(+), 16147 deletions(-)
----------------------------------------------------------------------



[04/18] activemq-artemis git commit: ARTEMIS-180 removing -Pexample and some other improvements around the examples

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/stomp/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/stomp/readme.html b/examples/jms/stomp/readme.html
index 3935090..8f07f11 100644
--- a/examples/jms/stomp/readme.html
+++ b/examples/jms/stomp/readme.html
@@ -27,104 +27,12 @@ under the License.
   <body onload="prettyPrint()">
      <h1>Stomp Example</h1>
 
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
+
+
      <p>This example shows you how to configure ActiveMQ Artemis to send and receive Stomp messages.</p>
      <p>The example will start a ActiveMQ Artemis server configured with Stomp and JMS.</p>
-     <p>The client will open a socket to send one Stomp message (using TCP directly). 
+     <p>The client will open a socket to send one Stomp message (using TCP directly).
        The client will then consume a message from a JMS Queue and check it is the message sent with Stomp.</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>
-
-     <ol>
-        <li>We create a TCP socket to connect to the Stomp port
-        <pre class="prettyprint">
-          Socket socket = new Socket("localhost", 61613); 
-        </pre>
-
-        <li>We send a CONNECT frame to connect to the server</li>
-        <pre class="prettyprint">
-          String connectFrame = "CONNECT\n" +
-             "login: guest\n" + 
-             "passcode: guest\n" + 
-             "request-id: 1\n" + 
-             "\n" +
-             Stomp.NULL;
-          sendFrame(socket, connectFrame);
-        </pre>
-
-        <li>We send a SEND frame (a Stomp message) to the destination <code>jms.queue.exampleQueue</code> 
-          (which corresponds to the ActiveMQ Artemis address for the JMS Queue <code>exampleQueue</code>) with a text body</li>
-        <pre class="prettyprint">
-          String text = "Hello, world from Stomp!";
-          String message = "SEND\n" + 
-             "destination: jms.queue.exampleQueue\n" +
-             "\n" +
-             text +
-             Stomp.NULL;
-          sendFrame(socket, message);
-          System.out.println("Sent Stomp message: " + text);
-        </pre>
-
-        <li>We send a DISCONNECT frame to disconnect from the server</li>
-        <pre class="prettyprint">
-          String disconnectFrame = "DISCONNECT\n" +
-             "\n" +
-             Stomp.NULL;
-          sendFrame(socket, disconnectFrame);
-        </pre>
-
-        <li>We close the TCP socket</li>
-        <pre class="prettyprint">
-          socket.close();
-        </pre>
-
-        <li>We create an initial context to perform the JNDI lookup.</li>
-        <pre class="prettyprint">
-          initialContext = getContext(0);
-       </pre>
-
-        <li>We perform a lookup on the queue and the connection factory</li>
-        <pre class="prettyprint">
-          Queue queue = (Queue)initialContext.lookup("/queue/exampleQueue");
-          ConnectionFactory cf = (ConnectionFactory)initialContext.lookup("/ConnectionFactory");
-        </pre>
-
-        <li>We create a JMS Connection, Session and a MessageConsumer on the queue</li>
-        <pre class="prettyprint">
-          connection = cf.createConnection();
-          Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-          MessageConsumer consumer = session.createConsumer(queue);
-        </pre>
-
-        <li>We start the connection</li>
-        <pre class="prettyprint">
-           <code>connection.start();</code>
-        </pre>
-
-        <li>We receive the message. Stomp messages are mapped to JMS TextMessage.</li>
-        <pre class="prettyprint">
-          TextMessage messageReceived = (TextMessage)consumer.receive(5000);
-          System.out.println("Received JMS message: " + messageReceived.getText());
-        </pre>
-
-        <li>And finally, <b>always</b> remember to close your JMS connections and resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
-
-        <pre class="prettyprint">
-           <code>finally
-           {
-              if (initialContext != null)
-              {
-                initialContext.close();
-              }
-              if (connection != null)
-              {
-                 connection.close();
-              }
-           }</code>
-        </pre>
-
-
-
-     </ol>
   </body>
 </html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/stomp1.1/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/stomp1.1/pom.xml b/examples/jms/stomp1.1/pom.xml
index b17e9c0..68ed6cd 100644
--- a/examples/jms/stomp1.1/pom.xml
+++ b/examples/jms/stomp1.1/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,9 +28,9 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-stomp1.1-example</artifactId>
+   <artifactId>stomp1.1</artifactId>
    <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS Stomp 1.1 Example</name>
+   <name>ActiveMQ Artemis JMS Stomp Example</name>
 
    <properties>
       <activemq.basedir>${project.basedir}/../../..</activemq.basedir>
@@ -37,71 +38,81 @@ under the License.
 
    <dependencies>
       <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
       </dependency>
    </dependencies>
 
    <profiles>
       <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>create</id>
-                        <goals>
-                           <goal>create</goal>
-                        </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.StompExample</clientClass>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>cli</goal>
-                        </goals>
-                        <configuration>
-                           <args>
-                              <param>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-stomp1.1-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
+         <!-- specify -PnoServer if you don't want to start the server -->
+         <id>noServer</id>
+         <properties>
+            <noServer>true</noServer>
+         </properties>
       </profile>
    </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <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.StompExample</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>stomp1.1</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/stomp1.1/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/stomp1.1/readme.html b/examples/jms/stomp1.1/readme.html
index afa0d06..5c3fe61 100644
--- a/examples/jms/stomp1.1/readme.html
+++ b/examples/jms/stomp1.1/readme.html
@@ -27,112 +27,12 @@ under the License.
   <body onload="prettyPrint()">
      <h1>Stomp 1.1 Example</h1>
 
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
+
+
      <p>This example shows you how to configure ActiveMQ Artemis to send and receive Stomp messages using Stomp 1.1 protocol.</p>
      <p>The example will start a ActiveMQ Artemis server configured with Stomp and JMS.</p>
-     <p>The client will open a socket to initiate a Stomp 1.1 connection and then send one Stomp message (using TCP directly). 
+     <p>The client will open a socket to initiate a Stomp 1.1 connection and then send one Stomp message (using TCP directly).
        The client will then consume a message from a JMS Queue and check it is the message sent with Stomp.</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>
-
-     <ol>
-        <li>We create a TCP socket to connect to the Stomp port
-        <pre class="prettyprint">
-          Socket socket = new Socket("localhost", 61613); 
-        </pre>
-
-        <li>We negotiate a Stomp 1.1 connection to the server</li>
-        <pre class="prettyprint">
-         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;
-          sendFrame(socket, connectFrame);
-        </pre>
-        
-        <li>We receive a response showing that the connection version</li>
-        <pre>
-         String response = receiveFrame(socket);
-         System.out.println("response: " + response);
-        </pre>
-
-        <li>We send a SEND frame (a Stomp message) to the destination <code>jms.queue.exampleQueue</code> 
-          (which corresponds to the ActiveMQ Artemis address for the JMS Queue <code>exampleQueue</code>) with a text body</li>
-        <pre class="prettyprint">
-          String text = "Hello World from Stomp 1.1 !";
-          String message = "SEND\n" + 
-             "destination:jms.queue.exampleQueue\n" +
-             "\n" +
-             text +
-             END_OF_FRAME;
-          sendFrame(socket, message);
-          System.out.println("Sent Stomp message: " + text);
-        </pre>
-
-        <li>We send a DISCONNECT frame to disconnect from the server</li>
-        <pre class="prettyprint">
-          String disconnectFrame = "DISCONNECT\n" +
-             "\n" +
-             Stomp.NULL;
-          sendFrame(socket, disconnectFrame);
-        </pre>
-
-        <li>We close the TCP socket</li>
-        <pre class="prettyprint">
-          socket.close();
-        </pre>
-
-        <li>We create an initial context to perform the JNDI lookup.</li>
-        <pre class="prettyprint">
-          initialContext = getContext(0);
-       </pre>
-
-        <li>We perform a lookup on the queue and the connection factory</li>
-        <pre class="prettyprint">
-          Queue queue = (Queue)initialContext.lookup("/queue/exampleQueue");
-          ConnectionFactory cf = (ConnectionFactory)initialContext.lookup("/ConnectionFactory");
-        </pre>
-
-        <li>We create a JMS Connection, Session and a MessageConsumer on the queue</li>
-        <pre class="prettyprint">
-          connection = cf.createConnection();
-          Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-          MessageConsumer consumer = session.createConsumer(queue);
-        </pre>
-
-        <li>We start the connection</li>
-        <pre class="prettyprint">
-           <code>connection.start();</code>
-        </pre>
-
-        <li>We receive the message. Stomp messages are mapped to JMS TextMessage.</li>
-        <pre class="prettyprint">
-          TextMessage messageReceived = (TextMessage)consumer.receive(5000);
-          System.out.println("Received JMS message: " + messageReceived.getText());
-        </pre>
-
-        <li>And finally, <b>always</b> remember to close your JMS connections and resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
-
-        <pre class="prettyprint">
-           <code>finally
-           {
-              if (initialContext != null)
-              {
-                initialContext.close();
-              }
-              if (connection != null)
-              {
-                 connection.close();
-              }
-           }</code>
-        </pre>
-
-
-
-     </ol>
   </body>
 </html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 9688ae9..fea1cca 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:./data}/bindings</bindings-directory>
+      <bindings-directory>./data/bindings</bindings-directory>
 
-      <journal-directory>${data.dir:./data}/journal</journal-directory>
+      <journal-directory>./data/journal</journal-directory>
 
-      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
+      <large-messages-directory>./data/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir:./data}/paging</paging-directory>
+      <paging-directory>./data/paging</paging-directory>
 
       <!-- Acceptors -->
       <acceptors>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/stomp1.2/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/stomp1.2/pom.xml b/examples/jms/stomp1.2/pom.xml
index e673181..3cee1db 100644
--- a/examples/jms/stomp1.2/pom.xml
+++ b/examples/jms/stomp1.2/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-stomp1.2-example</artifactId>
+   <artifactId>stomp1.2</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS Stomp 1.2 Example</name>
 
@@ -37,71 +38,81 @@ under the License.
 
    <dependencies>
       <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
       </dependency>
    </dependencies>
 
    <profiles>
       <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>create</id>
-                        <goals>
-                           <goal>create</goal>
-                        </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.StompExample</clientClass>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>cli</goal>
-                        </goals>
-                        <configuration>
-                           <args>
-                              <param>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-stomp1.2-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
+         <!-- specify -PnoServer if you don't want to start the server -->
+         <id>noServer</id>
+         <properties>
+            <noServer>true</noServer>
+         </properties>
       </profile>
    </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <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.StompExample</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>stomp1.2</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/stomp1.2/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/stomp1.2/readme.html b/examples/jms/stomp1.2/readme.html
index f8d94ee..3661f04 100644
--- a/examples/jms/stomp1.2/readme.html
+++ b/examples/jms/stomp1.2/readme.html
@@ -27,112 +27,12 @@ under the License.
   <body onload="prettyPrint()">
      <h1>Stomp 1.2 Example</h1>
 
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
+
+
      <p>This example shows you how to configure ActiveMQ Artemis to send and receive Stomp messages using Stomp 1.2 protocol.</p>
      <p>The example will start a ActiveMQ Artemis server configured with Stomp and JMS.</p>
-     <p>The client will open a socket to initiate a Stomp 1.2 connection and then send one Stomp message (using TCP directly). 
+     <p>The client will open a socket to initiate a Stomp 1.2 connection and then send one Stomp message (using TCP directly).
        The client will then consume a message from a JMS Queue and check it is the message sent with Stomp.</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>
-
-     <ol>
-        <li>We create a TCP socket to connect to the Stomp port
-        <pre class="prettyprint">
-          Socket socket = new Socket("localhost", 61613); 
-        </pre>
-
-        <li>We negotiate a Stomp 1.2 connection to the server</li>
-        <pre class="prettyprint">
-         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;
-          sendFrame(socket, connectFrame);
-        </pre>
-        
-        <li>We receive a response showing that the connection version</li>
-        <pre>
-         String response = receiveFrame(socket);
-         System.out.println("response: " + response);
-        </pre>
-
-        <li>We send a SEND frame (a Stomp message) to the destination <code>jms.queue.exampleQueue</code> 
-          (which corresponds to the ActiveMQ Artemis address for the JMS Queue <code>exampleQueue</code>) with a text body</li>
-        <pre class="prettyprint">
-          String text = "Hello World from Stomp 1.2 !";
-          String message = "SEND\n" + 
-             "destination:jms.queue.exampleQueue\n" +
-             "\n" +
-             text +
-             END_OF_FRAME;
-          sendFrame(socket, message);
-          System.out.println("Sent Stomp message: " + text);
-        </pre>
-
-        <li>We send a DISCONNECT frame to disconnect from the server</li>
-        <pre class="prettyprint">
-          String disconnectFrame = "DISCONNECT\n" +
-             "\n" +
-             Stomp.NULL;
-          sendFrame(socket, disconnectFrame);
-        </pre>
-
-        <li>We close the TCP socket</li>
-        <pre class="prettyprint">
-          socket.close();
-        </pre>
-
-        <li>We create an initial context to perform the JNDI lookup.</li>
-        <pre class="prettyprint">
-          initialContext = getContext(0);
-       </pre>
-
-        <li>We perform a lookup on the queue and the connection factory</li>
-        <pre class="prettyprint">
-          Queue queue = (Queue)initialContext.lookup("/queue/exampleQueue");
-          ConnectionFactory cf = (ConnectionFactory)initialContext.lookup("/ConnectionFactory");
-        </pre>
-
-        <li>We create a JMS Connection, Session and a MessageConsumer on the queue</li>
-        <pre class="prettyprint">
-          connection = cf.createConnection();
-          Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-          MessageConsumer consumer = session.createConsumer(queue);
-        </pre>
-
-        <li>We start the connection</li>
-        <pre class="prettyprint">
-           <code>connection.start();</code>
-        </pre>
-
-        <li>We receive the message. Stomp messages are mapped to JMS TextMessage.</li>
-        <pre class="prettyprint">
-          TextMessage messageReceived = (TextMessage)consumer.receive(5000);
-          System.out.println("Received JMS message: " + messageReceived.getText());
-        </pre>
-
-        <li>And finally, <b>always</b> remember to close your JMS connections and resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
-
-        <pre class="prettyprint">
-           <code>finally
-           {
-              if (initialContext != null)
-              {
-                initialContext.close();
-              }
-              if (connection != null)
-              {
-                 connection.close();
-              }
-           }</code>
-        </pre>
-
-
-
-     </ol>
   </body>
 </html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 9688ae9..fea1cca 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:./data}/bindings</bindings-directory>
+      <bindings-directory>./data/bindings</bindings-directory>
 
-      <journal-directory>${data.dir:./data}/journal</journal-directory>
+      <journal-directory>./data/journal</journal-directory>
 
-      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
+      <large-messages-directory>./data/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir:./data}/paging</paging-directory>
+      <paging-directory>./data/paging</paging-directory>
 
       <!-- Acceptors -->
       <acceptors>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 2ba5e69..0a1a9fa 100644
--- a/examples/jms/stop-server-failover/pom.xml
+++ b/examples/jms/stop-server-failover/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-stop-server-failover-example</artifactId>
+   <artifactId>stop-server-failover</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS Stop Server Failover Example</name>
 
@@ -37,121 +38,132 @@ under the License.
 
    <dependencies>
       <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
       </dependency>
    </dependencies>
 
    <profiles>
       <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>create0</id>
-                        <goals>
-                           <goal>create</goal>
-                        </goals>
-                        <configuration>
-                           <instance>${basedir}/target/server0</instance>
-                           <sharedStore>true</sharedStore>
-                           <slave>false</slave>
-                           <dataFolder>../data</dataFolder>
-                           <failoverOnShutdown>true</failoverOnShutdown>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>create1</id>
-                        <goals>
-                           <goal>create</goal>
-                        </goals>
-                        <configuration>
-                           <instance>${basedir}/target/server1</instance>
-                           <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>
-                        <id>runClient</id>
-                        <goals>
-                           <goal>runClient</goal>
-                        </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>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-stop-server-failover-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
+         <!-- specify -PnoServer if you don't want to start the server -->
+         <id>noServer</id>
+         <properties>
+            <noServer>true</noServer>
+         </properties>
       </profile>
    </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create0</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <instance>${basedir}/target/server0</instance>
+                     <sharedStore>true</sharedStore>
+                     <slave>false</slave>
+                     <dataFolder>../data</dataFolder>
+                     <failoverOnShutdown>true</failoverOnShutdown>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create1</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <instance>${basedir}/target/server1</instance>
+                     <sharedStore>true</sharedStore>
+                     <slave>true</slave>
+                     <dataFolder>../data</dataFolder>
+                     <failoverOnShutdown>true</failoverOnShutdown>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start0</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <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>
+                     <ignore>${noServer}</ignore>
+                     <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.StopServerFailoverExample</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop0</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <location>${basedir}/target/server0</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop1</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <location>${basedir}/target/server1</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>stop-server-failover</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/stop-server-failover/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/stop-server-failover/readme.html b/examples/jms/stop-server-failover/readme.html
index 0e83d37..bea5755 100644
--- a/examples/jms/stop-server-failover/readme.html
+++ b/examples/jms/stop-server-failover/readme.html
@@ -26,130 +26,19 @@ under the License.
   </head>
   <body onload="prettyPrint()">
      <h1>JMS Failover Without Transactions Example</h1>
-     
+
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
+
+
      <p>This example demonstrates two servers coupled as a live-backup pair for high availability (HA), and a client
      connection failing over from live to backup when the live server is crashed.</p>
      <p>Failover behavior differs whether the JMS session is transacted or not.</p>
-     <p>When a <em>non-transacted</em> JMS session is used, once and only once delivery is not guaranteed 
+     <p>When a <em>non-transacted</em> JMS session is used, once and only once delivery is not guaranteed
         and it is possible some messages will be lost or delivered twice, depending when the failover to the backup server occurs.</p>
      <p>It is up to the client to deal with such cases. To ensure once and only once delivery, the client must
         use transacted JMS sessions (as shown in the example for <a href="../transaction-failover/readme.html">failover with transactions</a>).</p>
      <p>For more information on ActiveMQ Artemis failover and HA, and clustering in general, please see the clustering
      section of the user manual.</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>
-     <p>In this example, the live server is server 1, and the backup server is server 0</p>
-     <p>The connection will initially be created to server1, server 1 will crash, and the client will carry on
-     seamlessly on server 0, the backup server.</p>
-     <ol>
-        <li>Get an initial context for looking up JNDI from server #1.</li>
-        <pre class="prettyprint">
-           initialContext = getContext(1);
-        </pre>
-
-        <li>Look up the JMS resources from JNDI on server #1.</li>
-        <pre class="prettyprint">
-           Queue queue = (Queue)initialContext.lookup("/queue/exampleQueue");
-           ConnectionFactory connectionFactory = (ConnectionFactory)initialContext.lookup("/ConnectionFactory");
-        </pre>
-
-        <li>Create a JMS Connection</li>
-        <pre class="prettyprint">
-           connection = connectionFactory.createConnection();
-        </pre>
-        
-        <li>Create a JMS <em>non-transacted</em> Session with client acknowledgement</li>
-        <pre class="prettyprint">
-           Session session = connection.createSession(false, Session.CLIENT_ACKNOWLEDGE);
-        </pre>
-        
-        <li>Start the connection to ensure delivery occurs</li>
-        <pre class="prettyprint">
-           connection.start();
-        </pre>
-
-        <li>Create a JMS MessageProducer and MessageConsumer</li>
-        <pre class="prettyprint">
-           MessageProducer producer = session.createProducer(queue);
-           MessageConsumer consumer = session.createConsumer(queue);
-        </pre>
-
-        <li>Send some messages to server #1</li>
-        <pre class="prettyprint">
-           for (int i = 0; i &lt; numMessages; i++)
-           {
-              TextMessage message = session.createTextMessage("This is text message " + i);
-              producer.send(message);
-              System.out.println("Sent message: " + message.getText());
-           }
-        </pre>
-        
-        <li>Receive and acknowledge half of the sent messages</li>
-        <pre class="prettyprint">
-           TextMessage message0 = null;
-           for (int i = 0; i &lt; numMessages / 2; i++)
-           {
-              message0 = (TextMessage)consumer.receive(5000);
-              System.out.println("Got message: " + message0.getText());
-           }
-           message0.acknowledge();
-        </pre>
-        
-        <li>Receive the second half of the sent messages but <em>do not acknowledge them yet</em></li>
-        <pre class="prettyprint">
-           for (int i = numMessages / 2; i &lt; numMessages; i++)
-           {
-              message0 = (TextMessage)consumer.receive(5000);
-              System.out.println("Got message: " + message0.getText());
-           }
-        </pre>
-              
-        <li>Crash server #1, the live server, and wait a little while to make sure it has really crashed.</li>
-        <pre class="prettyprint">
-           killServer(1);
-           Thread.sleep(2000);
-        </pre>
-
-        <li>Acknowledging the second half of the sent messages will fail as failover to the backup server has occurred</li>
-        <pre class="prettyprint">
-           try
-           {
-              message0.acknowledge();
-           }
-           catch (JMSException e)
-           {
-              System.err.println("Got exception while acknowledging message: " + e.getMessage());
-           }
-        </pre>
-           
-         <li>Consume again the second half of the messages againg. Note that they are not considered as redelivered</li>
-        <pre class="prettyprint">
-           for (int i = numMessages / 2; i &lt; numMessages; i++)
-           {
-              message0 = (TextMessage)consumer.receive(5000);
-              System.out.printf("Got message: %s (redelivered?: %s)\n", message0.getText(), message0.getJMSRedelivered());
-           }
-           message0.acknowledge();
-        </pre>
-        
-        <li>And finally, <strong>always</strong> remember to close your resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
-
-        <pre class="prettyprint">
-           finally
-           {
-              if (connection != null)
-              {
-                 connection.close();
-              }
-
-              if (initialContext != null)
-              {
-                 initialContext.close();
-              }
-           }
-        </pre>
-
-     </ol>
   </body>
 </html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/symmetric-cluster/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/symmetric-cluster/pom.xml b/examples/jms/symmetric-cluster/pom.xml
index d6ed189..f471314 100644
--- a/examples/jms/symmetric-cluster/pom.xml
+++ b/examples/jms/symmetric-cluster/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-symmetric-cluster-example</artifactId>
+   <artifactId>symmetric-cluster</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS Symmetric Cluster Example</name>
 
@@ -41,270 +42,288 @@ under the License.
          <artifactId>artemis-jms-client</artifactId>
          <version>${project.version}</version>
       </dependency>
-      <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
-      </dependency>
    </dependencies>
 
    <profiles>
       <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <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>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <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>
-                        </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>create3</id>
-                        <goals>
-                           <goal>create</goal>
-                        </goals>
-                        <configuration>
-                           <instance>${basedir}/target/server3</instance>
-                           <configuration>${basedir}/target/classes/activemq/server3</configuration>
-                           <javaOptions>-Dudp-address=${udp-address}</javaOptions>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>create4</id>
-                        <goals>
-                           <goal>create</goal>
-                        </goals>
-                        <configuration>
-                           <instance>${basedir}/target/server4</instance>
-                           <configuration>${basedir}/target/classes/activemq/server4</configuration>
-                           <javaOptions>-Dudp-address=${udp-address}</javaOptions>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>create5</id>
-                        <goals>
-                           <goal>create</goal>
-                        </goals>
-                        <configuration>
-                           <instance>${basedir}/target/server5</instance>
-                           <configuration>${basedir}/target/classes/activemq/server5</configuration>
-                           <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>
-                           <goal>runClient</goal>
-                        </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>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-symmetric-cluster-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
+         <!-- specify -PnoServer if you don't want to start the server -->
+         <id>noServer</id>
+         <properties>
+            <noServer>true</noServer>
+         </properties>
       </profile>
    </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create0</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noSever}</ignore>
+                     <instance>${basedir}/target/server0</instance>
+                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                     <javaOptions>-Dudp-address=${udp-address}</javaOptions>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create1</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noSever}</ignore>
+                     <instance>${basedir}/target/server1</instance>
+                     <configuration>${basedir}/target/classes/activemq/server1</configuration>
+                     <javaOptions>-Dudp-address=${udp-address}</javaOptions>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create2</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noSever}</ignore>
+                     <instance>${basedir}/target/server2</instance>
+                     <configuration>${basedir}/target/classes/activemq/server2</configuration>
+                     <javaOptions>-Dudp-address=${udp-address}</javaOptions>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create3</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noSever}</ignore>
+                     <instance>${basedir}/target/server3</instance>
+                     <configuration>${basedir}/target/classes/activemq/server3</configuration>
+                     <javaOptions>-Dudp-address=${udp-address}</javaOptions>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create4</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noSever}</ignore>
+                     <instance>${basedir}/target/server4</instance>
+                     <configuration>${basedir}/target/classes/activemq/server4</configuration>
+                     <javaOptions>-Dudp-address=${udp-address}</javaOptions>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create5</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noSever}</ignore>
+                     <instance>${basedir}/target/server5</instance>
+                     <configuration>${basedir}/target/classes/activemq/server5</configuration>
+                     <javaOptions>-Dudp-address=${udp-address}</javaOptions>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start0</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noSever}</ignore>
+                     <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>
+                     <ignore>${noSever}</ignore>
+                     <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>
+                     <ignore>${noSever}</ignore>
+                     <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>
+                     <ignore>${noSever}</ignore>
+                     <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>
+                     <ignore>${noSever}</ignore>
+                     <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>
+                     <ignore>${noSever}</ignore>
+                     <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>
+                     <goal>runClient</goal>
+                  </goals>
+                  <configuration>
+                     <clientClass>org.apache.activemq.artemis.jms.example.SymmetricClusterExample</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop0</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noSever}</ignore>
+                     <location>${basedir}/target/server0</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop1</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noSever}</ignore>
+                     <location>${basedir}/target/server1</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop2</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noSever}</ignore>
+                     <location>${basedir}/target/server2</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop3</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noSever}</ignore>
+                     <location>${basedir}/target/server3</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop4</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noSever}</ignore>
+                     <location>${basedir}/target/server4</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop5</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noSever}</ignore>
+                     <location>${basedir}/target/server5</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>symmetric-cluster</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/symmetric-cluster/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/symmetric-cluster/readme.html b/examples/jms/symmetric-cluster/readme.html
index 8be9587..dc8ebc2 100644
--- a/examples/jms/symmetric-cluster/readme.html
+++ b/examples/jms/symmetric-cluster/readme.html
@@ -27,6 +27,9 @@ under the License.
   <body onload="prettyPrint()">
      <h1>JMS Symmetric Cluster Example</h1>
 
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
+
+
      <p>This examples demonstrates a <b>symmetric cluster</b> set-up with ActiveMQ Artemis.</p>
      <p>ActiveMQ Artemis has extremely flexible clustering which allows you to set-up servers in
      many different topologies.</p>
@@ -67,210 +70,5 @@ under the License.
      by consumers on different nodes.</p>
     <p>For more information on configuring ActiveMQ Artemis clustering in general, please see the clustering
      section of the user manual.</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>
-
-     <ol>
-        <li>We instantiate a connection factory directly, specifying the UDP address and port for discovering
-         the list of servers in the cluster.
-         We could use JNDI to look-up a connection factory, but we'd need to know the JNDI server host and port for the
-         specific server to do that, and that server might not be available at the time. By creating the
-         connection factory directly we avoid having to worry about a JNDI look-up.
-         In an app server environment you could use HA-JNDI to lookup from the clustered JNDI servers without
-         having to know about a specific one.
-        </li>
-
-        <pre class="prettyprint">
-           <code>
-   ConnectionFactory cf = ActiveMQJMSClient.createConnectionFactoryWithHA("231.7.7.7", 9876);
-   </code>
-        </pre>
-
-        <li>Directly instantiate JMS Queue and Topic objects</li>
-        <pre class="prettyprint">
-           <code>
-   Queue queue = new ActiveMQQueue("exampleQueue");
-
-   Topic topic = ActiveMQJMSClient.createActiveMQTopic("exampleTopic");
-           </code>
-        </pre>
-
-        <li>We create six connections, they should be to different nodes of the cluster in a round-robin fashion
-         and start them.</li>
-        <pre class="prettyprint">
-           <code>
-   connection0 = cf.createConnection();
-
-     connection1 = cf.createConnection();
-
-     connection2 = cf.createConnection();
-
-     connection3 = cf.createConnection();
-
-     connection4 = cf.createConnection();
-
-     connection5 = cf.createConnection();
-
-     connection0.start();
-
-     connection1.start();
-
-     connection2.start();
-
-     connection3.start();
-
-     connection4.start();
-
-     connection5.start();
-           </code>
-        </pre>
-
-        <li>We create a session on each connection.</li>
-        <pre class="prettyprint">
-           <code>
-     Session session0 = connection0.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-     Session session1 = connection1.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-     Session session2 = connection2.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-     Session session3 = connection0.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-     Session session4 = connection1.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-     Session session5 = connection2.createSession(false, Session.AUTO_ACKNOWLEDGE);
-           </code>
-        </pre>
-
-        <li>We create a topic subscriber on each server.</li>
-        <pre class="prettyprint">
-           <code>
-         MessageConsumer subscriber0 = session0.createConsumer(topic);
-
-         MessageConsumer subscriber1 = session1.createConsumer(topic);
-
-         MessageConsumer subscriber2 = session2.createConsumer(topic);
-
-         MessageConsumer subscriber3 = session3.createConsumer(topic);
-
-         MessageConsumer subscriber4 = session4.createConsumer(topic);
-
-         MessageConsumer subscriber5 = session5.createConsumer(topic);
-           </code>
-        </pre>
-
-        <li>We create a queue consumer on server 0.</li>
-        <pre class="prettyprint">
-          <code>
-   MessageConsumer consumer0 = session0.createConsumer(queue);
-          </code>
-        </pre>
-
-        <li>We create an anonymous message producer on server 2.</li>
-        <pre class="prettyprint">
-          <code>
-   MessageProducer producer2 = session2.createProducer(null);
-          </code>
-        </pre>
-
-        <li>We send 500 messages each to the queue and topic.</li>
-        <pre class="prettyprint">
-           <code>
-   final int numMessages = 500;
-
-   for (int i = 0; i < numMessages; i++)
-   {
-      TextMessage message1 = session2.createTextMessage("Topic message 1");
-
-      producer2.send(topic, message1);
-
-      TextMessage message2 = session2.createTextMessage("Queue message 1");
-
-      producer2.send(queue, message2);
-   }
-           </code>
-       </pre>
-        <li>Verify all subscribers and consumer receive the messages.</li>
-        <pre class="prettyprint">
-           <code>
-   for (int i = 0; i < numMessages; i++)
-     {
-        TextMessage received0 = (TextMessage)subscriber0.receive(5000);
-
-        if (received0 == null)
-        {
-           return false;
-        }
-
-        TextMessage received1 = (TextMessage)subscriber1.receive(5000);
-
-        if (received1 == null)
-        {
-           return false;
-        }
-
-        TextMessage received2 = (TextMessage)subscriber2.receive(5000);
-
-        if (received2 == null)
-        {
-           return false;
-        }
-
-        TextMessage received3 = (TextMessage)subscriber3.receive(5000);
-
-        if (received3 == null)
-        {
-           return false;
-        }
-
-        TextMessage received4 = (TextMessage)subscriber4.receive(5000);
-
-        if (received4 == null)
-        {
-           return false;
-        }
-
-        TextMessage received5 = (TextMessage)subscriber5.receive(5000);
-
-        if (received5 == null)
-        {
-           return false;
-        }
-
-        TextMessage received6 = (TextMessage)consumer0.receive(5000);
-
-        if (received6 == null)
-        {
-           return false;
-        }
-     }
-           </code>
-        </pre>
-
-        <li>Be sure to close our resources!</li>
-
-        <pre class="prettyprint">
-           <code>
-   finally
-   {
-      if (connection0 != null)
-      {
-         connection0.close();
-      }
-
-      if (connection1 != null)
-      {
-         connection1.close();
-      }
-
-      if (connection2 != null)
-      {
-         connection2.close();
-      }
-   }
-           </code>
-        </pre>
-
-     </ol>
   </body>
 </html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 9c672d7..cd89de7 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,13 +30,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>${data.dir:./data}/bindings</bindings-directory>
+      <bindings-directory>./data/bindings</bindings-directory>
 
-      <journal-directory>${data.dir:./data}/journal</journal-directory>
+      <journal-directory>./data/journal</journal-directory>
 
-      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
+      <large-messages-directory>./data/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir:./data}/paging</paging-directory>
+      <paging-directory>./data/paging</paging-directory>
 
 
       <!-- Connectors -->

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 f02759b..d95a1cd 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,13 +30,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>${data.dir:./data}/bindings</bindings-directory>
+      <bindings-directory>./data/bindings</bindings-directory>
 
-      <journal-directory>${data.dir:./data}/journal</journal-directory>
+      <journal-directory>./data/journal</journal-directory>
 
-      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
+      <large-messages-directory>./data/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir:./data}/paging</paging-directory>
+      <paging-directory>./data/paging</paging-directory>
 
       <!-- Connectors -->
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 a188e71..ef006fd 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,13 +30,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>${data.dir:./data}/bindings</bindings-directory>
+      <bindings-directory>./data/bindings</bindings-directory>
 
-      <journal-directory>${data.dir:./data}/journal</journal-directory>
+      <journal-directory>./data/journal</journal-directory>
 
-      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
+      <large-messages-directory>./data/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir:./data}/paging</paging-directory>
+      <paging-directory>./data/paging</paging-directory>
 
       <!-- Connectors -->
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 43ab47c..a780ace 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,13 +30,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>${data.dir:./data}/bindings</bindings-directory>
+      <bindings-directory>./data/bindings</bindings-directory>
 
-      <journal-directory>${data.dir:./data}/journal</journal-directory>
+      <journal-directory>./data/journal</journal-directory>
 
-      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
+      <large-messages-directory>./data/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir:./data}/paging</paging-directory>
+      <paging-directory>./data/paging</paging-directory>
 
       <!-- Connectors -->
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 ce4afab..20b622e 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,13 +30,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>${data.dir:./data}/bindings</bindings-directory>
+      <bindings-directory>./data/bindings</bindings-directory>
 
-      <journal-directory>${data.dir:./data}/journal</journal-directory>
+      <journal-directory>./data/journal</journal-directory>
 
-      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
+      <large-messages-directory>./data/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir:./data}/paging</paging-directory>
+      <paging-directory>./data/paging</paging-directory>
 
       <!-- Connectors -->
       <connectors>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 d23612a..033af43 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,13 +30,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>${data.dir:./data}/bindings</bindings-directory>
+      <bindings-directory>./data/bindings</bindings-directory>
 
-      <journal-directory>${data.dir:./data}/journal</journal-directory>
+      <journal-directory>./data/journal</journal-directory>
 
-      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
+      <large-messages-directory>./data/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir:./data}/paging</paging-directory>
+      <paging-directory>./data/paging</paging-directory>
 
       <!-- Connectors -->
       <connectors>


[08/18] activemq-artemis git commit: ARTEMIS-180 removing -Pexample and some other improvements around the examples

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/non-transaction-failover/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/non-transaction-failover/readme.html b/examples/jms/non-transaction-failover/readme.html
index 0e83d37..3667284 100644
--- a/examples/jms/non-transaction-failover/readme.html
+++ b/examples/jms/non-transaction-failover/readme.html
@@ -26,11 +26,14 @@ under the License.
   </head>
   <body onload="prettyPrint()">
      <h1>JMS Failover Without Transactions Example</h1>
-     
+
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory.</pre>
+
+
      <p>This example demonstrates two servers coupled as a live-backup pair for high availability (HA), and a client
      connection failing over from live to backup when the live server is crashed.</p>
      <p>Failover behavior differs whether the JMS session is transacted or not.</p>
-     <p>When a <em>non-transacted</em> JMS session is used, once and only once delivery is not guaranteed 
+     <p>When a <em>non-transacted</em> JMS session is used, once and only once delivery is not guaranteed
         and it is possible some messages will be lost or delivered twice, depending when the failover to the backup server occurs.</p>
      <p>It is up to the client to deal with such cases. To ensure once and only once delivery, the client must
         use transacted JMS sessions (as shown in the example for <a href="../transaction-failover/readme.html">failover with transactions</a>).</p>
@@ -38,7 +41,6 @@ under the License.
      section of the user manual.</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>
      <p>In this example, the live server is server 1, and the backup server is server 0</p>
      <p>The connection will initially be created to server1, server 1 will crash, and the client will carry on
      seamlessly on server 0, the backup server.</p>
@@ -58,12 +60,12 @@ under the License.
         <pre class="prettyprint">
            connection = connectionFactory.createConnection();
         </pre>
-        
+
         <li>Create a JMS <em>non-transacted</em> Session with client acknowledgement</li>
         <pre class="prettyprint">
            Session session = connection.createSession(false, Session.CLIENT_ACKNOWLEDGE);
         </pre>
-        
+
         <li>Start the connection to ensure delivery occurs</li>
         <pre class="prettyprint">
            connection.start();
@@ -84,7 +86,7 @@ under the License.
               System.out.println("Sent message: " + message.getText());
            }
         </pre>
-        
+
         <li>Receive and acknowledge half of the sent messages</li>
         <pre class="prettyprint">
            TextMessage message0 = null;
@@ -95,7 +97,7 @@ under the License.
            }
            message0.acknowledge();
         </pre>
-        
+
         <li>Receive the second half of the sent messages but <em>do not acknowledge them yet</em></li>
         <pre class="prettyprint">
            for (int i = numMessages / 2; i &lt; numMessages; i++)
@@ -104,7 +106,7 @@ under the License.
               System.out.println("Got message: " + message0.getText());
            }
         </pre>
-              
+
         <li>Crash server #1, the live server, and wait a little while to make sure it has really crashed.</li>
         <pre class="prettyprint">
            killServer(1);
@@ -122,7 +124,7 @@ under the License.
               System.err.println("Got exception while acknowledging message: " + e.getMessage());
            }
         </pre>
-           
+
          <li>Consume again the second half of the messages againg. Note that they are not considered as redelivered</li>
         <pre class="prettyprint">
            for (int i = numMessages / 2; i &lt; numMessages; i++)
@@ -132,7 +134,7 @@ under the License.
            }
            message0.acknowledge();
         </pre>
-        
+
         <li>And finally, <strong>always</strong> remember to close your resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
 
         <pre class="prettyprint">

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/openwire/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/openwire/pom.xml b/examples/jms/openwire/pom.xml
deleted file mode 100644
index 3888f12..0000000
--- a/examples/jms/openwire/pom.xml
+++ /dev/null
@@ -1,110 +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>artemis-jms-openwire-example</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS Openwire Example</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>activemq-client</artifactId>
-      </dependency>
-   </dependencies>
-
-   <profiles>
-      <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>create</id>
-                        <goals>
-                           <goal>create</goal>
-                        </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.OpenWireExample</clientClass>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>cli</goal>
-                        </goals>
-                        <configuration>
-                           <args>
-                              <param>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-openwire-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
-      </profile>
-   </profiles>
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/openwire/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/openwire/readme.html b/examples/jms/openwire/readme.html
deleted file mode 100644
index df1e272..0000000
--- a/examples/jms/openwire/readme.html
+++ /dev/null
@@ -1,98 +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.
--->
-
-<html>
-  <head>
-    <title>ActiveMQ Artemis OpenWire Example</title>
-    <link rel="stylesheet" type="text/css" href="../common/common.css" />
-    <link rel="stylesheet" type="text/css" href="../common/prettify.css" />
-    <script type="text/javascript" src="../common/prettify.js"></script>
-  </head>
-  <body onload="prettyPrint()">
-     <h1>JMS OpenWire Example</h1>
-
-     <p>This example shows you how to configure ActiveMQ Artemis server to communicate with an ActiveMQ Artemis JMS client using ActiveMQ's native openwire protocol.</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>
-
-     <ol>
-        <li>First we need to create an ActiveMQ Artemis connection factory.</code></li>
-        <pre class="prettyprint">
-           <code>ConnectionFactory factory = new ActiveMQConnectionFactory(urlString);</code>
-        </pre>
-
-        <li>Create the target queue</li>
-        <pre class="prettyprint">
-           <code>Queue queue = new ActiveMQQueue("exampleQueue");</code>
-        </pre>
-
-        <li>We create a JMS connection and start it</li>
-        <pre class="prettyprint">
-           <code>connection = cf.createConnection();</code>
-           <code>connection.start()</code>
-        </pre>
-
-        <li>We create a JMS session. The session is created as non transacted and will auto acknowledge messages.</li>
-        <pre class="prettyprint">
-           <code>Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);</code>
-        </pre>
-
-        <li>We create a JMS message producer on the session. This will be used to send the messages.</li>
-        <pre class="prettyprint">
-          <code>MessageProducer messageProducer = session.createProducer(topic);</code>
-       </pre>
-
-        <li>We create a JMS text message that we are going to send.</li>
-        <pre class="prettyprint">
-           <code>TextMessage message = session.createTextMessage("This is a text message");</code>
-        </pre>
-
-        <li>We send message to the queue</li>
-        <pre class="prettyprint">
-           <code>messageProducer.send(message);</code>
-        </pre>
-
-        <li>We create a JMS Message Consumer to receive the message.</li>
-          <pre class="prettyprint">
-           <code>MessageConsumer messageConsumer = session.createConsumer(queue);</code>
-        </pre>
-
-        <li>The message arrives at the consumer. In this case we use a timeout of 5000 milliseconds but we could use a blocking 'receive()'</li>
-        <pre class="prettyprint">
-           <code>TextMessage messageReceived = (TextMessage) messageConsumer.receive(5000);</code>
-        </pre>
-
-        <li>And finally, <b>always</b> remember to close your JMS connections and resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
-
-        <pre class="prettyprint">
-           <code>finally
-           {
-              if (connection != null)
-              {
-                 connection.close();
-              }
-           }</code>
-        </pre>
-
-
-
-     </ol>
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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
deleted file mode 100644
index 202e1b0..0000000
--- a/examples/jms/openwire/src/main/java/org/apache/activemq/artemis/jms/example/OpenWireExample.java
+++ /dev/null
@@ -1,91 +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.jms.example;
-
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-
-import org.apache.activemq.ActiveMQConnectionFactory;
-import org.apache.activemq.command.ActiveMQQueue;
-
-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
-{
-   public static final String OWHOST = "localhost";
-   public static final int OWPORT = 61616;
-
-   public static void main(final String[] args) throws Exception
-   {
-      Connection connection = null;
-
-      try
-      {
-         String urlString = "tcp://" + OWHOST + ":" + OWPORT;
-
-         // Step 1. Create an ActiveMQ Artemis Connection Factory
-         ConnectionFactory factory = new ActiveMQConnectionFactory(urlString);
-
-         // Step 2. Create the target queue
-         Queue queue = new ActiveMQQueue("exampleQueue");
-
-         // Step 3. Create a JMS Connection
-         connection = factory.createConnection();
-
-         // Step 4. Start the Connection
-         connection.start();
-
-         // Step 5. Create a JMS Session
-         Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-         // Step 6. Create a JMS Message Producer
-         MessageProducer producer = session.createProducer(queue);
-
-         // Step 7. Create a Text Message
-         TextMessage message = session.createTextMessage("This is a text message");
-
-         // Step 8. Send the Message
-         producer.send(message);
-
-         System.out.println("Sent message: " + message.getText());
-
-         // Step 9. Create a JMS Message Consumer
-         MessageConsumer messageConsumer = session.createConsumer(queue);
-
-         // Step 10. Receive the message
-         TextMessage messageReceived = (TextMessage) messageConsumer.receive(5000);
-
-         System.out.println("Received message: " + messageReceived.getText());
-      }
-      finally
-      {
-         if (connection != null)
-         {
-            connection.close();
-         }
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/openwire/src/main/resources/activemq/server0/artemis-roles.properties
----------------------------------------------------------------------
diff --git a/examples/jms/openwire/src/main/resources/activemq/server0/artemis-roles.properties b/examples/jms/openwire/src/main/resources/activemq/server0/artemis-roles.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/openwire/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/dd820318/examples/jms/openwire/src/main/resources/activemq/server0/artemis-users.properties
----------------------------------------------------------------------
diff --git a/examples/jms/openwire/src/main/resources/activemq/server0/artemis-users.properties b/examples/jms/openwire/src/main/resources/activemq/server0/artemis-users.properties
deleted file mode 100644
index 4e2d44c..0000000
--- a/examples/jms/openwire/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/dd820318/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
deleted file mode 100644
index c281c60..0000000
--- a/examples/jms/openwire/src/main/resources/activemq/server0/broker.xml
+++ /dev/null
@@ -1,71 +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>
-         <connector name="netty-connector">tcp://localhost:61616</connector>
-      </connectors>
-
-      <!-- Acceptors -->
-      <acceptors>
-         <!-- 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 -->
-
-      <security-settings>
-         <security-setting match="jms.topic.ActiveMQ Artemis.Advisory.#">
-            <permission type="createNonDurableQueue" roles="guest"/>
-            <permission type="consume" roles="guest"/>
-            <permission type="send" roles="guest"/>
-         </security-setting>
-         <!--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/dd820318/examples/jms/paging/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/paging/pom.xml b/examples/jms/paging/pom.xml
index 954aad9..22c0c60 100644
--- a/examples/jms/paging/pom.xml
+++ b/examples/jms/paging/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-paging-example</artifactId>
+   <artifactId>paging</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS Paging Example</name>
 
@@ -37,71 +38,81 @@ under the License.
 
    <dependencies>
       <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
       </dependency>
    </dependencies>
 
    <profiles>
       <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>create</id>
-                        <goals>
-                           <goal>create</goal>
-                        </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.PagingExample</clientClass>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>cli</goal>
-                        </goals>
-                        <configuration>
-                           <args>
-                              <param>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-paging-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
+         <!-- specify -PnoServer if you don't want to start the server -->
+         <id>noServer</id>
+         <properties>
+            <noServer>true</noServer>
+         </properties>
       </profile>
    </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <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.PagingExample</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>paging</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/paging/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/paging/readme.html b/examples/jms/paging/readme.html
index 938d087..1f9afd3 100644
--- a/examples/jms/paging/readme.html
+++ b/examples/jms/paging/readme.html
@@ -27,17 +27,19 @@ under the License.
   <body onload="prettyPrint()">
      <h1>Paging Example</h1>
 
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
+
+
      <p>This example shows how ActiveMQ Artemis would avoid running out of memory resources by paging messages.</p>
      <p>A maxSize can be specified per Destination via the destinations settings configuration file (broker.xml).</p>
      <p>When messages routed to an address exceed the specified maxSize the server will begin to write messages to the file
      system, this is called paging. This will continue to occur until messages have been delivered to consumers and subsequently
      acknowledged freeing up memory. Messages will then be read from the file system , i.e. depaged, and routed as normal. </p>
      <p>Acknowledgement plays an important factor on paging as messages will stay on the file system until the memory is released
-     so it is important to make sure that the client acknowledges its messages.</p> 
+     so it is important to make sure that the client acknowledges its messages.</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>
 
      <ol>
         <li>First we need to get an initial context so we can look-up the JMS connection factory and destination objects from JNDI. This initial context will get it's properties from the <code>client-jndi.properties</code> file in the directory <code>../common/config</code></li>
@@ -75,32 +77,32 @@ under the License.
          <pre class="prettyprint"><code>
          MessageProducer pageMessageProducer = session.createProducer(pageQueue);
          </pre></code>
-         
+
          <li>We don't need persistent messages in order to use paging. (This step is optional)</li>
          <pre class="prettyprint"><code>
          pageMessageProducer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
          </pre></code>
-         
+
          <li>Create a Binary Bytes Message with 10K arbitrary bytes</li>
          <pre class="prettyprint"><code>
          BytesMessage message = session.createBytesMessage();
          message.writeBytes(new byte[10 * 1024]);
          </pre></code>
-         
+
 
          <li>Send only 20 messages to the Queue. This will be already enough for pagingQueue. Look at ./paging/config/activemq-queues.xml for the config.</li>
          <pre class="prettyprint"><code>
          for (int i = 0; i < 20; i++)
          {
             pageMessageProducer.send(message);
-         }         
+         }
          </pre></code>
-         
+
          <li>Create a JMS Message Producer</li>
          <pre class="prettyprint"><code>
          MessageProducer messageProducer = session.createProducer(queue);
          </pre></code>
-         
+
          <li>We don't need persistent messages in order to use paging. (This step is optional)</li>
          <pre class="prettyprint"><code>
          messageProducer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
@@ -115,26 +117,26 @@ under the License.
          </pre></code>
 
          <li>if you pause the example here, you will several files under ./build/data/paging</li>
-         
+
          <pre class="prettyprint"><code>
-         // Thread.sleep(30000); // if you want to just our of curiosity, you can sleep here and inspect the created files just for 
+         // Thread.sleep(30000); // if you want to just our of curiosity, you can sleep here and inspect the created files just for
          </pre></code>
-         
-         
+
+
          <li>Create a JMS Message Consumer</li>
          <pre class="prettyprint"><code>
          MessageConsumer messageConsumer = session.createConsumer(queue);
          </pre></code>
-         
+
 
          <li>Start the JMS Connection. This step will activate the subscribers to receive messages.</li>
          <pre class="prettyprint"><code>
          connection.start();
          </pre></code>
-         
-         
+
+
          <li>Receive the messages. It's important to ACK for messages as ActiveMQ Artemis will not read messages from paging until messages are ACKed</li>
-         
+
          <pre class="prettyprint"><code>
          for (int i = 0; i < 30000; i++)
          {
@@ -143,12 +145,12 @@ under the License.
             if (i % 1000 == 0)
             {
                System.out.println("Received " + i + " messages");
-               
+
                message.acknowledge();
             }
          }
          </pre></code>
-         
+
          <li>Receive the messages from the Queue names pageQueue. Create the proper consumer for that.</li>
          <pre class="prettyprint"><code>
          messageConsumer.close();
@@ -157,7 +159,7 @@ under the License.
          for (int i = 0; i < 20; i++)
          {
             message = (BytesMessage)messageConsumer.receive(1000);
-            
+
             System.out.println("Received message " + i + " from pageQueue");
 
             message.acknowledge();

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/perf/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/perf/pom.xml b/examples/jms/perf/pom.xml
index b348a70..a1eb6ef 100644
--- a/examples/jms/perf/pom.xml
+++ b/examples/jms/perf/pom.xml
@@ -27,7 +27,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-perf-example</artifactId>
+   <artifactId>perf</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS PerfExample Example</name>
 
@@ -95,7 +95,7 @@ under the License.
                      <dependencies>
                         <dependency>
                            <groupId>org.apache.activemq.examples.jms</groupId>
-                           <artifactId>artemis-jms-perf-example</artifactId>
+                           <artifactId>perf</artifactId>
                            <version>${project.version}</version>
                         </dependency>
                         <dependency>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/pom.xml b/examples/jms/pom.xml
index 4c8db04..3b59d1a 100644
--- a/examples/jms/pom.xml
+++ b/examples/jms/pom.xml
@@ -39,11 +39,10 @@ under the License.
 
    <profiles>
       <profile>
-         <id>release</id>
+         <!-- You need to activate -Pexamples to run all the examples -->
+         <id>examples</id>
          <modules>
-            <module>aerogear</module>
             <module>application-layer-failover</module>
-            <module>artemis-ra-rar</module>
             <module>bridge</module>
             <module>browser</module>
             <module>client-kickoff</module>
@@ -53,109 +52,14 @@ under the License.
             <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>
-            <module>divert</module>
-            <module>durable-subscription</module>
-            <module>embedded</module>
-            <module>embedded-simple</module>
-            <module>expiry</module>
-            <module>http-transport</module>
-            <module>interceptor</module>
-            <module>instantiate-connection-factory</module>
-            <module>ha-policy-autobackup</module>
-            <module>jms-auto-closeable</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>
-            <module>management</module>
-            <module>management-notifications</module>
-            <module>message-counters</module>
-            <module>message-group</module>
-            <module>message-group2</module>
-            <module>message-priority</module>
-            <module>multiple-failover</module>
-            <module>multiple-failover-failback</module>
-            <module>no-consumer-buffering</module>
-            <module>non-transaction-failover</module>
-            <module>openwire</module>
-            <module>paging</module>
-            <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>rest</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>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>
-            <module>stomp-websockets</module>
-            <module>stomp1.1</module>
-            <module>stomp1.2</module>
-            <module>stop-server-failover</module>
-            <module>symmetric-cluster</module>
-            <module>temp-queue</module>
-            <module>topic</module>
-            <module>topic-hierarchies</module>
-            <module>topic-selector-example1</module>
-            <module>topic-selector-example2</module>
-            <module>transactional</module>
-            <module>transaction-failover</module>
-            <module>xa-heuristic</module>
-            <module>xa-receive</module>
-            <module>xa-send</module>
-         </modules>
-      </profile>
-      <profile>
-         <id>example</id>
-         <activation>
-            <activeByDefault>true</activeByDefault>
-         </activation>
-         <modules>
-            <module>application-layer-failover</module>
-            <module>bridge</module>
-            <module>browser</module>
-            <module>client-kickoff</module>
-            <module>client-side-load-balancing</module>
-            <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>
+
+            <!-- ARTEMIS-197 FIX ME:
             <module>colocated-failover</module>
-            <module>colocated-failover-scale-down</module>
+            <module>colocated-failover-scale-down</module> -->
+
             <module>consumer-rate-limit</module>
             <module>dead-letter</module>
             <module>delayed-redelivery</module>
@@ -186,7 +90,6 @@ 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>-->
@@ -200,8 +103,11 @@ under the License.
             <module>queue-requestor</module>
             <module>queue-selector</module>
             <module>reattach-node</module>
+
+            <!-- ARTEMIS-197 FIX ME:
             <module>replicated-failback</module>
-            <module>replicated-failback-static</module>
+            <module>replicated-failback-static</module> -->
+
             <module>replicated-multiple-failover</module>
             <module>replicated-transaction-failover</module>
             <module>request-reply</module>
@@ -211,9 +117,13 @@ under the License.
             <module>security</module>
             <module>send-acknowledgements</module>
             <module>spring-integration</module>
-            <module>ssl-enabled</module>
+
+            <!-- ARTEMIS-197 FIX ME
+                 this one could be the case of leaving it out for good
+                 as it may require to be run manually
+            <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>-->

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/pre-acknowledge/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/pre-acknowledge/pom.xml b/examples/jms/pre-acknowledge/pom.xml
index b181706..e3ee5ef 100644
--- a/examples/jms/pre-acknowledge/pom.xml
+++ b/examples/jms/pre-acknowledge/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-pre-acknowledge-example</artifactId>
+   <artifactId>pre-acknowledge</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS Pre Acknowledge Example</name>
 
@@ -41,72 +42,77 @@ under the License.
          <artifactId>artemis-jms-client</artifactId>
          <version>${project.version}</version>
       </dependency>
-      <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
-      </dependency>
    </dependencies>
 
    <profiles>
       <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>create</id>
-                        <goals>
-                           <goal>create</goal>
-                        </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.PreacknowledgeExample</clientClass>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>cli</goal>
-                        </goals>
-                        <configuration>
-                           <args>
-                              <param>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-pre-acknowledge-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
+         <!-- specify -PnoServer if you don't want to start the server -->
+         <id>noServer</id>
+         <properties>
+            <noServer>true</noServer>
+         </properties>
       </profile>
    </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <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.PreacknowledgeExample</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>pre-acknowledge</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/pre-acknowledge/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/pre-acknowledge/readme.html b/examples/jms/pre-acknowledge/readme.html
index 893423c..cadea23 100644
--- a/examples/jms/pre-acknowledge/readme.html
+++ b/examples/jms/pre-acknowledge/readme.html
@@ -27,6 +27,9 @@ under the License.
   <body onload="prettyPrint()">
      <h1>JMS Pre-Acknowledge Example</h1>
 
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
+
+
      <p>Standard JMS supports three acknowledgement modes: AUTO_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, and
      DUPS_OK_ACKNOWLEDGE. For a full description on these modes please consult the JMS specification, or any
      JMS tutorial.</p>
@@ -44,9 +47,8 @@ under the License.
      update message will arrive soon, overriding the previous price.</p>
      <p>In order to use pre-acknowledge functionality with ActiveMQ Artemis the session has to be created with
      a special, ActiveMQ Artemis specific acknowledgement mode, given by the value of
-     <code>ActiveMQJMSConstants.PRE_ACKNOWLEDGE</code>.     
+     <code>ActiveMQJMSConstants.PRE_ACKNOWLEDGE</code>.
      <h2>Example step-by-step</h2>
-     <p><i>To run the example, simply type <code>mvn verify -Pexample</code> from this directory</i></p>
 
      <ol>
         <li>Create an initial context to perform the JNDI lookup.</li>
@@ -61,7 +63,7 @@ under the License.
            <code>
      Queue queue = (Queue)initialContext.lookup("/queue/exampleQueue");
 
-     ConnectionFactory cf = (ConnectionFactory)initialContext.lookup("/ConnectionFactory");                      
+     ConnectionFactory cf = (ConnectionFactory)initialContext.lookup("/ConnectionFactory");
            </code>
         </pre>
 
@@ -73,8 +75,8 @@ under the License.
      Session session = connection.createSession(false, ActiveMQSession.PRE_ACKNOWLEDGE);
 
      MessageProducer producer = session.createProducer(queue);
-         
-     MessageConsumer messageConsumer = session.createConsumer(queue);           
+
+     MessageConsumer messageConsumer = session.createConsumer(queue);
            </code>
         </pre>
 
@@ -85,7 +87,7 @@ under the License.
 
      producer.send(message1);
 
-     System.out.println("Sent message: " + message1.getText());           
+     System.out.println("Sent message: " + message1.getText());
            </code>
         </pre>
 
@@ -94,8 +96,8 @@ under the License.
         <pre class="prettyprint">
            <code>
      int count = getMessageCount(connection);
-       
-     System.out.println("Queue message count is " + count);           
+
+     System.out.println("Queue message count is " + count);
            </code>
         </pre>
 
@@ -104,16 +106,16 @@ under the License.
           <code>
      connection.start();
 
-     Thread.sleep(1000);          
+     Thread.sleep(1000);
           </code>
        </pre>
 
         <li>Print out the message count of the queue. It should now be zero, since the message has
-         already been acknowledged even before the consumer has received it.</li>         
+         already been acknowledged even before the consumer has received it.</li>
         <pre class="prettyprint">
            <code>
-     count = getMessageCount(connection);         
-     
+     count = getMessageCount(connection);
+
      System.out.println("Queue message count is now " + count);
            </code>
         </pre>
@@ -123,7 +125,7 @@ under the License.
            <code>
      TextMessage messageReceived = (TextMessage)messageConsumer.receive(5000);
 
-     System.out.println("Received message: " + messageReceived.getText());           
+     System.out.println("Received message: " + messageReceived.getText());
            </code>
         </pre>
 
@@ -137,16 +139,16 @@ under the License.
      if (connection != null)
      {
         connection.close();
-     }           
+     }
            </code>
         </pre>
      </ol>
-     
+
      <h2>More information</h2>
-     
+
      <ul>
          <li>User Manual's <a href="../../../docs/user-manual/en/html_single/index.html#pre-acknowledge">Pre-acknowledgement Mode chapter</a></li>
      </ul>
-     
+
   </body>
 </html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 446cec0..5191f85 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
@@ -27,11 +27,11 @@ 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.jms.client.ActiveMQConnectionFactory;
 
 /**
  * This example demonstrates the use of ActiveMQ Artemis "pre-acknowledge" functionality where
@@ -44,17 +44,14 @@ public class PreacknowledgeExample
    public static void main(final String[] args) throws Exception
    {
       Connection connection = null;
-
-      InitialContext initialContext = null;
       try
       {
-         // Step 1. Create an initial context to perform the JNDI lookup.
-         initialContext = new InitialContext();
 
-         // Step 2. Perform the look-ups
-         Queue queue = (Queue)initialContext.lookup("queue/exampleQueue");
+         // Step 2. instantiate the queue object
+         Queue queue = ActiveMQJMSClient.createQueue("exampleQueue");
 
-         ConnectionFactory cf = (ConnectionFactory)initialContext.lookup("ConnectionFactory");
+         // new connection factory
+         ConnectionFactory cf = new ActiveMQConnectionFactory();
 
          // Step 3. Create a the JMS objects
          connection = cf.createConnection();
@@ -102,10 +99,6 @@ public class PreacknowledgeExample
       finally
       {
          // Step 9. Be sure to close our resources!
-         if (initialContext != null)
-         {
-            initialContext.close();
-         }
          if (connection != null)
          {
             connection.close();

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 d407ea3..c514526 100644
--- a/examples/jms/producer-rate-limit/pom.xml
+++ b/examples/jms/producer-rate-limit/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-producer-rate-limit-example</artifactId>
+   <artifactId>producer-rate-limit</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS Producer Rate Limit Example</name>
 
@@ -37,71 +38,81 @@ under the License.
 
    <dependencies>
       <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
       </dependency>
    </dependencies>
 
    <profiles>
       <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>create</id>
-                        <goals>
-                           <goal>create</goal>
-                        </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.ProducerRateLimitExample</clientClass>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>cli</goal>
-                        </goals>
-                        <configuration>
-                           <args>
-                              <param>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-producer-rate-limit-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
+         <!-- specify -PnoServer if you don't want to start the server -->
+         <id>noServer</id>
+         <properties>
+            <noServer>true</noServer>
+         </properties>
       </profile>
    </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <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.ProducerRateLimitExample</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>producer-rate-limit</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/producer-rate-limit/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/producer-rate-limit/readme.html b/examples/jms/producer-rate-limit/readme.html
index a2615ea..fa8d086 100644
--- a/examples/jms/producer-rate-limit/readme.html
+++ b/examples/jms/producer-rate-limit/readme.html
@@ -27,10 +27,13 @@ under the License.
   <body onload="prettyPrint()">
      <h1>JMS Message Producer Rate Limiting</h1>
 
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
+
+
      <p>With ActiveMQ Artemis you can specify a maximum send rate at which a JMS MessageProducer will send messages.
      This can be specified when creating or deploying the connection factory. See <code>activemq-jms.xml</code></p>
      <p>If this value is specified then ActiveMQ Artemis will ensure that messages are never produced at a rate higher than
-     specified. This is a form of producer <i>throttling</i>.</p>     
+     specified. This is a form of producer <i>throttling</i>.</p>
      <h2>Example step-by-step</h2>
      <p>In this example we specify a <code>producer-max-rate</code> of <code>50</code> messages per second in the <code>activemq-jms.xml</code>
      file when deploying the connection factory:</p>
@@ -39,21 +42,19 @@ under the License.
    &lt;connection-factory name="ConnectionFactory"&gt;
       &lt;connector-ref connector-name="netty-connector"/&gt;
       &lt;entries&gt;
-         &lt;entry name="ConnectionFactory"/&gt;       
+         &lt;entry name="ConnectionFactory"/&gt;
       &lt;/entries&gt;
-      
+
       &lt;!-- We limit producers created on this connection factory to produce messages at a maximum rate
       of 50 messages per sec --&gt;
       &lt;producer-max-rate&gt;50&lt;/producer-max-rate&gt;
-      
+
    &lt;/connection-factory&gt;
      </code>
      </pre>
      <p>We then simply send as many messages as we can in 10 seconds and note how many messages are actually sent.</p>
      <p>We note that the number of messages sent per second never exceeds the specified value of <code>50</code> messages per second.</p>
 
-     <p><i>To run the example, simply type <code>mvn verify -Pexample</code> from this directory</i></p>
-
      <ol>
         <li>Create an initial context to perform the JNDI lookup.</li>
         <pre class="prettyprint">
@@ -107,13 +108,13 @@ under the License.
 
         System.out.println("We sent " + i + " messages in " + (end - start) + " milliseconds");
 
-        System.out.println("Actual send rate was " + rate + " messages per second");                      
+        System.out.println("Actual send rate was " + rate + " messages per second");
            </code>
         </pre>
-        
+
         <li>We note that the sending rate doesn't exceed 50 messages per second. Here's some example output from a real
         run</li>
-        
+
         <pre class="prettyprint">
            <code>
      [java] Will now send as many messages as we can in 10 seconds...
@@ -121,7 +122,7 @@ under the License.
      [java] Actual send rate was 49.64257347100874 messages per second
            </code>
         </pre>
-           
+
 
         <li>For good measure we consumer the messages we produced.</li>
         <pre class="prettyprint">
@@ -145,8 +146,8 @@ under the License.
            i++;
         }
 
-        System.out.println("Received " + i + " messages");           
-           
+        System.out.println("Received " + i + " messages");
+
            </code>
         </pre>
 
@@ -160,7 +161,7 @@ under the License.
               {
                 initialContext.close();
               }
-              
+
               if (connection != null)
               {
                  connection.close();

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 c949122..cfae82e 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
@@ -23,7 +23,9 @@ 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.api.jms.ActiveMQJMSClient;
+import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
 
 /**
  * This example demonstrates how a message producer can be limited to produce messages at a maximum rate
@@ -34,17 +36,13 @@ public class ProducerRateLimitExample
    public static void main(final String[] args) throws Exception
    {
       Connection connection = null;
-      InitialContext initialContext = null;
       try
       {
-         // Step 1. Create an initial context to perform the JNDI lookup.
-         initialContext = new InitialContext();
-
          // Step 2. Perfom a lookup on the queue
-         Queue queue = (Queue)initialContext.lookup("queue/exampleQueue");
+         Queue queue = ActiveMQJMSClient.createQueue("exampleQueue");
 
          // Step 3. Perform a lookup on the Connection Factory
-         ConnectionFactory cf = (ConnectionFactory)initialContext.lookup("ConnectionFactory");
+         ConnectionFactory cf = new ActiveMQConnectionFactory("tcp://localhost:61616?producerMaxRate=50");
 
          // Step 4. Create a JMS Connection
          connection = cf.createConnection();
@@ -106,10 +104,6 @@ public class ProducerRateLimitExample
       finally
       {
          // Step 9. Be sure to close our resources!
-         if (initialContext != null)
-         {
-            initialContext.close();
-         }
          if (connection != null)
          {
             connection.close();

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/proton-cpp/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/proton-cpp/pom.xml b/examples/jms/proton-cpp/pom.xml
index 240667d..32d2185 100644
--- a/examples/jms/proton-cpp/pom.xml
+++ b/examples/jms/proton-cpp/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-protoncpp</artifactId>
+   <artifactId>protoncpp</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis AMQP CPP Example</name>
 
@@ -49,64 +50,73 @@ under the License.
 
    <profiles>
       <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>create</id>
-                        <goals>
-                           <goal>create</goal>
-                        </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.ProtonCPPExample</clientClass>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>cli</goal>
-                        </goals>
-                        <configuration>
-                           <args>
-                              <param>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-protoncpp</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
+         <!-- specify -PnoServer if you don't want to start the server -->
+         <id>noServer</id>
+         <properties>
+            <noServer>true</noServer>
+         </properties>
       </profile>
    </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <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.ProtonCPPExample</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>protoncpp</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/proton-j/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/proton-j/pom.xml b/examples/jms/proton-j/pom.xml
index 2cdf0c8..ebd92c4 100644
--- a/examples/jms/proton-j/pom.xml
+++ b/examples/jms/proton-j/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-proton-j-example</artifactId>
+   <artifactId>artemis-proton-j</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis Proton-J Example</name>
 
@@ -45,64 +46,73 @@ under the License.
 
    <profiles>
       <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>create</id>
-                        <goals>
-                           <goal>create</goal>
-                        </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.ProtonJExample</clientClass>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>cli</goal>
-                        </goals>
-                        <configuration>
-                           <args>
-                              <param>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-proton-j-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
+         <!-- specify -PnoServer if you don't want to start the server -->
+         <id>noServer</id>
+         <properties>
+            <noServer>true</noServer>
+         </properties>
       </profile>
    </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <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.ProtonJExample</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>artemis-proton-j</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/proton-j/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/proton-j/readme.html b/examples/jms/proton-j/readme.html
index 7a5c88a..fd77ffc 100644
--- a/examples/jms/proton-j/readme.html
+++ b/examples/jms/proton-j/readme.html
@@ -27,6 +27,9 @@ under the License.
 <body onload="prettyPrint()">
 <h1>Proton qpid java example</h1>
 
+<pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
+
+
 <<p>ActiveMQ Artemis is a multi protocol broker. It will inspect the initial handshake of clients to determine what protocol to use.</p>
 <p>All you need to do is to connect a client into activemq's configured port and you should be able connect.</p>
 <p>To run this example simply run the command <literal>mvn verify -Pexample</literal>, execute the compile.sh script and start the executable called ./hello</p>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/proton-ruby/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/proton-ruby/pom.xml b/examples/jms/proton-ruby/pom.xml
index 54f2269..6a90b8d 100644
--- a/examples/jms/proton-ruby/pom.xml
+++ b/examples/jms/proton-ruby/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-proton-ruby-example</artifactId>
+   <artifactId>proton-ruby</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis Proton Ruby Example</name>
 
@@ -35,37 +36,32 @@ under the License.
       <activemq.basedir>${project.basedir}/../../..</activemq.basedir>
    </properties>
 
-   <profiles>
-      <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <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>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-proton-ruby-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
-      </profile>
-   </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <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>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>proton-ruby</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/proton-ruby/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/proton-ruby/readme.html b/examples/jms/proton-ruby/readme.html
index 951a654..95c15b0 100644
--- a/examples/jms/proton-ruby/readme.html
+++ b/examples/jms/proton-ruby/readme.html
@@ -42,7 +42,7 @@ under the License.
      </code>
      </pre>
      <h2>Example step-by-step</h2>
-     <p>Firstly create the server by running the command <literal>mvn verify -Pexample</literal></p>
+     <p>Firstly create the server by running the command <literal>mvn verify</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>


[15/18] activemq-artemis git commit: ARTEMIS-180 removing -Pexample and some other improvements around the examples

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 041fbe3..5b678d2 100644
--- a/examples/jms/clustered-durable-subscription/pom.xml
+++ b/examples/jms/clustered-durable-subscription/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-clustered-durable-subscription-example</artifactId>
+   <artifactId>clustered-durable-subscription</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS Clustered Durable Subscription Example</name>
 
@@ -37,116 +38,130 @@ under the License.
 
    <dependencies>
       <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
       </dependency>
    </dependencies>
 
    <profiles>
       <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <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>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>
-                        <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>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-clustered-durable-subscription-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
+         <!-- specify -PnoServer if you don't want to start the server -->
+         <id>noServer</id>
+         <properties>
+            <noServer>true</noServer>
+         </properties>
       </profile>
    </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create0</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <clustered>true</clustered>
+                     <instance>${basedir}/target/server0</instance>
+                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create1</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <clustered>true</clustered>
+                     <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>
+                     <ignore>${noServer}</ignore>
+                     <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>
+                     <ignore>${noServer}</ignore>
+                     <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>
+                     <ignore>${noServer}</ignore>
+                     <location>${basedir}/target/server0</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop1</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <location>${basedir}/target/server1</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>clustered-durable-subscription</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/clustered-durable-subscription/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-durable-subscription/readme.html b/examples/jms/clustered-durable-subscription/readme.html
index 0d17214..57597bd 100644
--- a/examples/jms/clustered-durable-subscription/readme.html
+++ b/examples/jms/clustered-durable-subscription/readme.html
@@ -27,6 +27,8 @@ under the License.
   <body onload="prettyPrint()">
      <h1>JMS Durable Subscription Example</h1>
 
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
+
      <p>This example demonstrates a clustered JMS durable subscription.
      Normally durable subscriptions exist on a single node and can only have one subscriber at any one time,
      however, with ActiveMQ Artemis it's possible to create durable subscription instances with the same name and client-id
@@ -45,6 +47,7 @@ under the License.
      JNDI, these could be instantiated directly.
      <p>Here's the relevant snippet from the server configuration, which tells the server to form a cluster between the two nodes
      and to load balance the messages between the nodes.</p>
+     <p>The cli create method will define this section by default if you use --clustered as a parameter</p>
      <pre class="prettyprint">
      <code>&lt;cluster-connection name="my-cluster"&gt;
         &lt;address&gt;jms&lt;/address&gt;
@@ -59,155 +62,5 @@ under the License.
      <p>For more information on ActiveMQ Artemis load balancing, and clustering in general, please see the clustering
      section of the user manual.</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>
-
-     <ol>
-        <li> Get an initial context for looking up JNDI from server 0.</li>
-        <pre class="prettyprint">
-           <code>
-   ic0 = getContext(0);
-   </code>
-        </pre>
-
-        <li>Look-up the JMS Topic object from JNDI</li>
-        <pre class="prettyprint">
-           <code>Topic topic = (Topic)ic0.lookup("/topic/exampleTopic");</code>
-        </pre>
-
-        <li>Look-up a JMS Connection Factory object from JNDI on server 0</li>
-        <pre class="prettyprint">
-           <code>ConnectionFactory cf0 = (ConnectionFactory)ic0.lookup("/ConnectionFactory");</code>
-        </pre>
-
-        <li>Get an initial context for looking up JNDI from server 1.</li>
-        <pre class="prettyprint">
-           <code>ic1 = getContext(1);</code>
-        </pre>
-
-        <li>Look-up a JMS Connection Factory object from JNDI on server 1</li>
-        <pre class="prettyprint">
-           <code>ConnectionFactory cf1 = (ConnectionFactory)ic1.lookup("/ConnectionFactory");
-           </code>
-        </pre>
-
-        <li>We create a JMS Connection connection0 which is a connection to server 0
-        and set the same client-id.</li>
-        <pre class="prettyprint">
-          <code>
-   connection0 = cf0.createConnection();
-   final String clientID = "my-client-id";
-   connection0.setClientID(clientID);
-          </code>
-        </pre>
-
-        <li>We create a JMS Connection connection1 which is a connection to server 1
-        and set the same client-id.</li>
-        <pre class="prettyprint">
-          <code>
-   connection1 = cf1.createConnection();
-   connection1.setClientID(clientID);
-          </code>
-        </pre>
-
-        <li>We create a JMS Session on server 0</li>
-        <pre class="prettyprint">
-           <code>
-   Session session0 = connection0.createSession(false, Session.AUTO_ACKNOWLEDGE);
-           </code>
-        </pre>
-
-        <li>We create a JMS Session on server 1</li>
-        <pre class="prettyprint">
-           <code>
-   Session session1 = connection1.createSession(false, Session.AUTO_ACKNOWLEDGE);
-            </code>
-        </pre>
-
-        <li>We start the connections to ensure delivery occurs on them</li>
-        <pre class="prettyprint">
-           <code>
-   connection0.start();
-
-   connection1.start();
-           </code>
-        </pre>
-
-        <li>We create JMS durable subscriptions with the same name and client-id on both nodes
-        of the cluster
-        </li>
-        <pre class="prettyprint">
-           <code>
-   final String subscriptionName = "my-subscription";
-
-   MessageConsumer subscriber0 = session0.createDurableSubscriber(topic, subscriptionName);
-
-   MessageConsumer subscriber1 = session1.createDurableSubscriber(topic, subscriptionName);
-           </code>
-        </pre>
-
-        <li>We create a JMS MessageProducer object on server 0.</li>
-        <pre class="prettyprint">
-           <code>
-   MessageProducer producer = session0.createProducer(topic);</code>
-        </pre>
-
-        <li>We send some messages to server 0.</li>
-        <pre class="prettyprint">
-           <code>
-	final int numMessages = 10;
-
-	for (int i = 0; i < numMessages; i++)
-	{
-	   TextMessage message = session0.createTextMessage("This is text message " + i);
-
-	   producer.send(message);
-
-	   System.out.println("Sent message: " + message.getText());
-	}
-           </code>
-        </pre>
-
-        <li>
-        We now consume those messages on *both* server 0 and server 1.
-        Note that the messages have been load-balanced between the two nodes, with some
-        messages on node 0 and others on node 1.
-        The "logical" subscription is distributed across the cluster and contains exactly one copy of all the messages sent.
-         </li>
-        <pre class="prettyprint">
-           <code>
-	for (int i = 0; i < numMessages; i += 2)
-	{
-	   TextMessage message0 = (TextMessage)consumer0.receive(5000);
-
-	   System.out.println("Got message: " + message0.getText() + " from node 0");
-
-	   TextMessage message1 = (TextMessage)consumer1.receive(5000);
-
-	   System.out.println("Got message: " + message1.getText() + " from node 1");
-	}
-           </code>
-        </pre>
-
-        <li>And finally (no pun intended), <b>always</b> remember to close your JMS resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
-
-        <pre class="prettyprint">
-           <code>
-	finally
-	{
-	   if (connection0 != null)
-	   {
-	      connection0.close();
-	   }
-
-	   if (connection1 != null)
-	   {
-	      connection1.close();
-	   }
-	}
-           </code>
-        </pre>
-
-     </ol>
-  </body>
+   </body>
 </html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 31d1434..2dceb7c 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,6 +26,8 @@ import javax.jms.Topic;
 import javax.naming.InitialContext;
 import java.util.Hashtable;
 
+import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
+
 /**
  * A simple example that shows a JMS Durable Subscription across two nodes of a cluster.
  *
@@ -40,36 +42,15 @@ public class ClusteredDurableSubscriptionExample
 
       Connection connection1 = null;
 
-      InitialContext ic0 = null;
-
-      InitialContext ic1 = null;
-
       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", "tcp://localhost:61616");
-         properties.put("topic.topic/exampleTopic", "exampleTopic");
-         ic0 = new InitialContext(properties);
-
-         // Step 2. Look-up the JMS Topic object from JNDI
-         Topic topic = (Topic)ic0.lookup("topic/exampleTopic");
-
-         // Step 3. Look-up a JMS Connection Factory object from JNDI on server 0
-         ConnectionFactory cf0 = (ConnectionFactory)ic0.lookup("ConnectionFactory");
-
-         // 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", "tcp://localhost:61617");
-         ic1 = new InitialContext(properties);
+         // Step 1. Instantiate the connection factory on server 0
+         ConnectionFactory cf0 = new ActiveMQConnectionFactory("tcp://localhost:61616");
 
-         // Step 5. Look-up a JMS Connection Factory object from JNDI on server 1
-         ConnectionFactory cf1 = (ConnectionFactory)ic1.lookup("ConnectionFactory");
+         // Step 2. nstantiate the connection factory on server 1
+         ConnectionFactory cf1 = new ActiveMQConnectionFactory("tcp://localhost:61617");
 
-         // Step 6. We create a JMS Connection connection0 which is a connection to server 0
+         // Step 3. We create a JMS Connection connection0 which is a connection to server 0
          // and set the client-id
          connection0 = cf0.createConnection();
 
@@ -77,38 +58,41 @@ public class ClusteredDurableSubscriptionExample
 
          connection0.setClientID(clientID);
 
-         // Step 7. We create a JMS Connection connection1 which is a connection to server 1
+         // Step 4. We create a JMS Connection connection1 which is a connection to server 1
          // and set the same client-id
          connection1 = cf1.createConnection();
 
          connection1.setClientID(clientID);
 
-         // Step 8. We create a JMS Session on server 0
+         // Step 5. We create a JMS Session on server 0
          Session session0 = connection0.createSession(false, Session.AUTO_ACKNOWLEDGE);
 
-         // Step 9. We create a JMS Session on server 1
+         // Step 6. We create a JMS Session on server 1
          Session session1 = connection1.createSession(false, Session.AUTO_ACKNOWLEDGE);
 
-         // Step 10. We start the connections to ensure delivery occurs on them
+         // Step 7. We start the connections to ensure delivery occurs on them
          connection0.start();
 
          connection1.start();
 
-         // Step 11. We create JMS durable subscriptions with the same name and client-id on both nodes
+         // Step 8. We create JMS durable subscriptions with the same name and client-id on both nodes
          // of the cluster
 
          final String subscriptionName = "my-subscription";
 
+         // Step 9. lookup the topic
+         Topic topic = session0.createTopic("exampleTopic");
+
          MessageConsumer subscriber0 = session0.createDurableSubscriber(topic, subscriptionName);
 
          MessageConsumer subscriber1 = session1.createDurableSubscriber(topic, subscriptionName);
 
          Thread.sleep(1000);
 
-         // Step 12. We create a JMS MessageProducer object on server 0
+         // Step 10. We create a JMS MessageProducer object on server 0
          MessageProducer producer = session0.createProducer(topic);
 
-         // Step 13. We send some messages to server 0
+         // Step 11. We send some messages to server 0
 
          final int numMessages = 10;
 
@@ -121,7 +105,7 @@ public class ClusteredDurableSubscriptionExample
             System.out.println("Sent message: " + message.getText());
          }
 
-         // Step 14. We now consume those messages on *both* server 0 and server 1.
+         // Step 12. We now consume those messages on *both* server 0 and server 1.
          // Note that the messages have been load-balanced between the two nodes, with some
          // messages on node 0 and others on node 1.
          // The "logical" subscription is distributed across the cluster and contains exactly one copy of all the
@@ -150,16 +134,6 @@ public class ClusteredDurableSubscriptionExample
          {
             connection1.close();
          }
-
-         if (ic0 != null)
-         {
-            ic0.close();
-         }
-
-         if (ic1 != null)
-         {
-            ic1.close();
-         }
       }
    }
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 6214a63..2bfaeae 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:./data}/bindings</bindings-directory>
+      <bindings-directory>./data/bindings</bindings-directory>
 
-      <journal-directory>${data.dir:./data}/journal</journal-directory>
+      <journal-directory>./data/journal</journal-directory>
 
-      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
+      <large-messages-directory>./data/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir:./data}/paging</paging-directory>
+      <paging-directory>./data/paging</paging-directory>
 
 
       <!-- Connectors -->

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 3d1cb2e..8134f27 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,13 +29,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>${data.dir:./data}/bindings</bindings-directory>
+      <bindings-directory>./data/bindings</bindings-directory>
 
-      <journal-directory>${data.dir:./data}/journal</journal-directory>
+      <journal-directory>./data/journal</journal-directory>
 
-      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
+      <large-messages-directory>./data/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir:./data}/paging</paging-directory>
+      <paging-directory>./data/paging</paging-directory>
 
       <!-- Connectors -->
       <connectors>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/clustered-grouping/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-grouping/pom.xml b/examples/jms/clustered-grouping/pom.xml
index 0f9f101..86338f3 100644
--- a/examples/jms/clustered-grouping/pom.xml
+++ b/examples/jms/clustered-grouping/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-clustered-grouping-example</artifactId>
+   <artifactId>clustered-grouping</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS CLustered Grouping Example</name>
 
@@ -37,152 +38,166 @@ under the License.
 
    <dependencies>
       <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
       </dependency>
    </dependencies>
 
    <profiles>
       <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <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>create1</id>
-                        <goals>
-                           <goal>create</goal>
-                        </goals>
-                        <configuration>
-                           <instance>${basedir}/target/server1</instance>
-                           <configuration>${basedir}/target/classes/activemq/server1</configuration>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>create2</id>
-                        <goals>
-                           <goal>create</goal>
-                        </goals>
-                        <configuration>
-                           <instance>${basedir}/target/server2</instance>
-                           <configuration>${basedir}/target/classes/activemq/server2</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>
-                           <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.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>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-clustered-grouping-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
+         <!-- specify -PnoServer if you don't want to start the server -->
+         <id>noServer</id>
+         <properties>
+            <noServer>true</noServer>
+         </properties>
       </profile>
    </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create0</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <instance>${basedir}/target/server0</instance>
+                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create1</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <instance>${basedir}/target/server1</instance>
+                     <configuration>${basedir}/target/classes/activemq/server1</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create2</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <instance>${basedir}/target/server2</instance>
+                     <configuration>${basedir}/target/classes/activemq/server2</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start0</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <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>
+                     <ignore>${noServer}</ignore>
+                     <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>
+                     <ignore>${noServer}</ignore>
+                     <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.ClusteredGroupingExample</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop0</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <location>${basedir}/target/server0</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop1</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <location>${basedir}/target/server1</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop2</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <location>${basedir}/target/server2</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>clustered-grouping</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/clustered-grouping/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-grouping/readme.html b/examples/jms/clustered-grouping/readme.html
index 1f5010c..c605168 100644
--- a/examples/jms/clustered-grouping/readme.html
+++ b/examples/jms/clustered-grouping/readme.html
@@ -25,6 +25,8 @@ under the License.
   <body>
      <h1>JMS Clustered Grouping Example</h1>
 
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
+
      <p>This example demonstrates how to ensure strict ordering across a cluster using clustered message grouping</p>
      <p>We create 3 nodes each with a grouping message handler, one with a Local handler and 2 with a Remote handler.</p>
      <p>The local handler acts as an arbitrator for the 2 remote handlers, holding the information on routes and communicating
@@ -75,191 +77,5 @@ under the License.
      </code>
      </pre>
 
-     <p>For more information on ActiveMQ Artemis clustering and grouping see the clustering and grouping
-     section of the user manual.</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>
-
-      <ol>
-        <li> Get an initial context for looking up JNDI from server 0.</li>
-        <pre class="prettyprint">
-           <code>ic0 = getContext(0);</code>
-        </pre>
-
-        <li>Look-up the JMS Queue object from JNDI</li>
-        <pre class="prettyprint">
-           <code>Queue queue = (Queue)ic0.lookup("/queue/exampleQueue");</code>
-        </pre>
-
-        <li>Look-up a JMS Connection Factory object from JNDI on server 0</li>
-        <pre class="prettyprint">
-           <code>ConnectionFactory cf0 = (ConnectionFactory)ic0.lookup("/ConnectionFactory");</code>
-        </pre>
-
-        <li>Get an initial context for looking up JNDI from server 1.</li>
-        <pre class="prettyprint">
-           <code>ic1 = getContext(1);</code>
-        </pre>
-
-        <li>Look-up a JMS Connection Factory object from JNDI on server 1</li>
-        <pre class="prettyprint">
-           <code>ConnectionFactory cf1 = (ConnectionFactory)ic1.lookup("/ConnectionFactory");
-           </code>
-        </pre>
-
-         <li>Get an initial context for looking up JNDI from server 2.</li>
-        <pre class="prettyprint">
-           <code>ic2 = getContext(2);</code>
-        </pre>
-
-        <li>Look-up a JMS Connection Factory object from JNDI on server 2</li>
-        <pre class="prettyprint">
-           <code>ConnectionFactory cf2 = (ConnectionFactory)ic2.lookup("/ConnectionFactory");
-           </code>
-        </pre>
-
-        <li>We create a JMS Connection connection0 which is a connection to server 0</li>
-        <pre class="prettyprint">
-           <code>connection0 = cf0.createConnection();</code>
-        </pre>
-
-         <li>We create a JMS Connection connection0 which is a connection to server 1</li>
-        <pre class="prettyprint">
-           <code>connection1 = cf1.createConnection();</code>
-        </pre>
-
-         <li>We create a JMS Connection connection0 which is a connection to server 2</li>
-        <pre class="prettyprint">
-           <code>connection2 = cf2.createConnection();</code>
-        </pre>
-
-         <li>We create a JMS Session on server 0</li>
-        <pre class="prettyprint">
-           <code>Session session0 = connection0.createSession(false, Session.AUTO_ACKNOWLEDGE);</code>
-        </pre>
-
-         <li>We create a JMS Session on server 1</li>
-        <pre class="prettyprint">
-           <code>Session session1 = connection1.createSession(false, Session.AUTO_ACKNOWLEDGE);</code>
-        </pre>
-
-         <li>We create a JMS Session on server 2</li>
-        <pre class="prettyprint">
-           <code>Session session2 = connection2.createSession(false, Session.AUTO_ACKNOWLEDGE);</code>
-        </pre>
-
-         <li>We start the connections to ensure delivery occurs on them</li>
-        <pre class="prettyprint">
-           <code>
-         connection0.start();
-
-         connection1.start();
-
-         connection2.start();</code>
-        </pre>
-
-         <li>We create JMS MessageConsumer objects on server 0</li>
-        <pre class="prettyprint">
-           <code>MessageConsumer consumer = session0.createConsumer(queue);</code>
-        </pre>
-
-         <li>We create a JMS MessageProducer object on server 0, 1 and 2</li>
-        <pre class="prettyprint">
-           <code>
-         MessageProducer producer0 = session0.createProducer(queue);
-
-         MessageProducer producer1 = session1.createProducer(queue);
-
-         MessageProducer producer2 = session2.createProducer(queue);</code>
-        </pre>
-
-         <li>We send some messages to server 0, 1 and 2 with the same groupid set</li>
-        <pre class="prettyprint">
-           <code>
-         final int numMessages = 10;
-
-         for (int i = 0; i < numMessages; i++)
-         {
-            TextMessage message = session0.createTextMessage("This is text message " + i);
-
-            message.setStringProperty(ActiveMQMessage.JMSXGROUPID, "Group-0");
-
-            producer0.send(message);
-
-            System.out.println("Sent messages: " + message.getText() + " to node 0");
-         }
-
-         for (int i = 0; i < numMessages; i++)
-         {
-            TextMessage message = session1.createTextMessage("This is text message " + (i + 10));
-
-            message.setStringProperty(ActiveMQMessage.JMSXGROUPID, "Group-0");
-
-            producer1.send(message);
-
-            System.out.println("Sent messages: " + message.getText() + " to node 1");
-
-         }
-
-         for (int i = 0; i < numMessages; i++)
-         {
-            TextMessage message = session2.createTextMessage("This is text message " + (i + 20));
-
-            message.setStringProperty(ActiveMQMessage.JMSXGROUPID, "Group-0");
-
-            producer2.send(message);
-
-            System.out.println("Sent messages: " + message.getText() + " to node 2");
-         }
-        </code>
-        </pre>
-
-         <li>We now consume those messages from server 0. We note the messages have all been sent to the same consumer on the same node</li>
-        <pre class="prettyprint">
-           <code>
-         for (int i = 0; i < numMessages * 3; i++)
-         {
-            TextMessage message0 = (TextMessage)consumer.receive(5000);
-
-            System.out.println("Got message: " + message0.getText() + " from node 0");
-
-         }
-        </code>
-        </pre>
-         <li>Finally, Be sure to close our resources!</li>
-        <pre class="prettyprint">
-           <code>
-         if (connection0 != null)
-         {
-            connection0.close();
-         }
-
-         if (connection1 != null)
-         {
-            connection1.close();
-         }
-
-         if (connection2 != null)
-         {
-            connection2.close();
-         }
-
-         if (ic0 != null)
-         {
-            ic0.close();
-         }
-
-         if (ic1 != null)
-         {
-            ic1.close();
-         }
-
-         if (ic2 != null)
-         {
-            ic2.close();
-         }</code>
-        </pre>
-
-     </ol>
-  </body>
+   </body>
 </html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 a60ea6b..04fec83 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
@@ -23,8 +23,10 @@ import javax.jms.MessageProducer;
 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.api.jms.ActiveMQJMSClient;
+import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
+import org.apache.activemq.artemis.jms.client.ActiveMQQueue;
 
 /**
  * A simple example that demonstrates server side load-balancing of messages between the queue instances on different
@@ -40,82 +42,58 @@ public class ClusteredGroupingExample
 
       Connection connection2 = null;
 
-      InitialContext ic0 = null;
+      try
+      {
+         // Step 1. We will instantiate the queue object directly on this example
+         //         This could be done through JNDI or JMSession.createQueue
+         Queue queue =  ActiveMQJMSClient.createQueue("exampleQueue");
 
-      InitialContext ic1 = null;
+         // Step 2. create a connection factory towards server 0.
+         ConnectionFactory cf0 = new ActiveMQConnectionFactory("tcp://localhost:61616");
 
-      InitialContext ic2 = null;
+         // Step 3. create a connection factory towards server 1.
+         ConnectionFactory cf1 = new ActiveMQConnectionFactory("tcp://localhost:61617");
 
-      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", "tcp://localhost:61616");
-         properties.put("queue.queue/exampleQueue", "exampleQueue");
-         ic0 = new InitialContext(properties);
-
-         // Step 2. Look-up the JMS Queue object from JNDI
-         Queue queue = (Queue)ic0.lookup("queue/exampleQueue");
-
-         // Step 3. Look-up a JMS Connection Factory object from JNDI on server 0
-         ConnectionFactory cf0 = (ConnectionFactory)ic0.lookup("ConnectionFactory");
-
-         // 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", "tcp://localhost:61617");
-         ic1 = new InitialContext(properties);
-
-         // Step 5. Look-up a JMS Connection Factory object from JNDI on server 1
-         ConnectionFactory cf1 = (ConnectionFactory)ic1.lookup("ConnectionFactory");
-
-         // 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", "tcp://localhost:61618");
-         ic2 = new InitialContext(properties);
-
-         // Step 5. Look-up a JMS Connection Factory object from JNDI on server 2
-         ConnectionFactory cf2 = (ConnectionFactory)ic2.lookup("ConnectionFactory");
-
-         // Step 6. We create a JMS Connection connection0 which is a connection to server 0
+         // Step 4.  create a connection factory towards server 2.
+         ConnectionFactory cf2 = new ActiveMQConnectionFactory("tcp://localhost:61618");
+
+         // Step 5. We create a JMS Connection connection0 which is a connection to server 0
          connection0 = cf0.createConnection();
 
-         // Step 7. We create a JMS Connection connection1 which is a connection to server 1
+         // Step 6. We create a JMS Connection connection1 which is a connection to server 1
          connection1 = cf1.createConnection();
 
-         // Step 8. We create a JMS Connection connection2 which is a connection to server 2
+         // Step 7. We create a JMS Connection connection2 which is a connection to server 2
          connection2 = cf2.createConnection();
 
-         // Step 9. We create a JMS Session on server 0
+         // Step 8. We create a JMS Session on server 0
          Session session0 = connection0.createSession(false, Session.AUTO_ACKNOWLEDGE);
 
-         // Step 10. We create a JMS Session on server 1
+         // Step 9. We create a JMS Session on server 1
          Session session1 = connection1.createSession(false, Session.AUTO_ACKNOWLEDGE);
 
-         // Step 11. We create a JMS Session on server 2
+         // Step 10. We create a JMS Session on server 2
          Session session2 = connection1.createSession(false, Session.AUTO_ACKNOWLEDGE);
 
-         // Step 12. We start the connections to ensure delivery occurs on them
+         // Step 11. We start the connections to ensure delivery occurs on them
          connection0.start();
 
          connection1.start();
 
          connection2.start();
 
-         // Step 13. We create JMS MessageConsumer objects on server 0
+         // Step 12. We create JMS MessageConsumer objects on server 0
          MessageConsumer consumer = session0.createConsumer(queue);
 
 
-         // Step 14. We create a JMS MessageProducer object on server 0, 1 and 2
+         // Step 13. We create a JMS MessageProducer object on server 0, 1 and 2
          MessageProducer producer0 = session0.createProducer(queue);
 
          MessageProducer producer1 = session1.createProducer(queue);
 
          MessageProducer producer2 = session2.createProducer(queue);
 
-         // Step 15. We send some messages to server 0, 1 and 2 with the same groupid set
+         // Step 14. We send some messages to server 0, 1 and 2 with the same groupid set
 
          final int numMessages = 10;
 
@@ -153,7 +131,7 @@ public class ClusteredGroupingExample
             System.out.println("Sent messages: " + message.getText() + " to node 2");
          }
 
-         // Step 16. We now consume those messages from server 0
+         // Step 15. We now consume those messages from server 0
          // We note the messages have all been sent to the same consumer on the same node
 
          for (int i = 0; i < numMessages * 3; i++)
@@ -182,21 +160,6 @@ public class ClusteredGroupingExample
          {
             connection2.close();
          }
-
-         if (ic0 != null)
-         {
-            ic0.close();
-         }
-
-         if (ic1 != null)
-         {
-            ic1.close();
-         }
-
-         if (ic2 != null)
-         {
-            ic2.close();
-         }
       }
    }
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 77fa2e6..4520059 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,13 +29,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>${data.dir:./data}/bindings</bindings-directory>
+      <bindings-directory>./data/bindings</bindings-directory>
 
-      <journal-directory>${data.dir:./data}/journal</journal-directory>
+      <journal-directory>./data/journal</journal-directory>
 
-      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
+      <large-messages-directory>./data/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir:./data}/paging</paging-directory>
+      <paging-directory>./data/paging</paging-directory>
 
 
       <!-- Connectors -->

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 fabd98d..4765f7a 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,13 +29,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>${data.dir:./data}/bindings</bindings-directory>
+      <bindings-directory>./data/bindings</bindings-directory>
 
-      <journal-directory>${data.dir:./data}/journal</journal-directory>
+      <journal-directory>./data/journal</journal-directory>
 
-      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
+      <large-messages-directory>./data/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir:./data}/paging</paging-directory>
+      <paging-directory>./data/paging</paging-directory>
 
 
       <!-- Connectors -->

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 07d18fc..16bf2eb 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,13 +29,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>${data.dir:./data}/bindings</bindings-directory>
+      <bindings-directory>./data/bindings</bindings-directory>
 
-      <journal-directory>${data.dir:./data}/journal</journal-directory>
+      <journal-directory>./data/journal</journal-directory>
 
-      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
+      <large-messages-directory>./data/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir:./data}/paging</paging-directory>
+      <paging-directory>./data/paging</paging-directory>
 
 
       <!-- Connectors -->

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/clustered-jgroups/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-jgroups/pom.xml b/examples/jms/clustered-jgroups/pom.xml
index fc90be7..9930edc 100644
--- a/examples/jms/clustered-jgroups/pom.xml
+++ b/examples/jms/clustered-jgroups/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -37,123 +38,133 @@ under the License.
 
    <dependencies>
       <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
       </dependency>
    </dependencies>
 
    <profiles>
       <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>create</id>
-                        <goals>
-                           <goal>create</goal>
-                        </goals>
-                        <configuration>
-                           <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>create1</id>
-                        <goals>
-                           <goal>create</goal>
-                        </goals>
-                        <configuration>
-                           <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>
-                        </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.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>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>clustered-jgroups</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
+         <!-- specify -PnoServer if you don't want to start the server -->
+         <id>noServer</id>
+         <properties>
+            <noServer>true</noServer>
+         </properties>
       </profile>
    </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <libList>
+                        <!-- You need to add jgroups.jar to the server's lib -->
+                        <arg>org.jgroups:jgroups:3.6.0.Final</arg>
+                     </libList>
+                     <ignore>${noServer}</ignore>
+                     <instance>${basedir}/target/server0</instance>
+                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create1</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <libList>
+                        <!-- You need to add jgroups.jar to the server's lib -->
+                        <arg>org.jgroups:jgroups:3.6.0.Final</arg>
+                     </libList>
+                     <ignore>${noServer}</ignore>
+                     <instance>${basedir}/target/server1</instance>
+                     <configuration>${basedir}/target/classes/activemq/server1</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start0</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <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>
+                     <ignore>${noServer}</ignore>
+                     <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.ClusteredJgroupsExample</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop0</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <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>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>clustered-jgroups</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/clustered-jgroups/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-jgroups/readme.html b/examples/jms/clustered-jgroups/readme.html
index a88ce0d..123e33a 100644
--- a/examples/jms/clustered-jgroups/readme.html
+++ b/examples/jms/clustered-jgroups/readme.html
@@ -27,7 +27,9 @@ under the License.
   <body onload="prettyPrint()">
      <h1>ActiveMQ Artemis Clustering with JGroups Example</h1>
 
-     <p>This example demonstrates the working of a two node cluster using JGroups as the underlying topology broadcasting/discovery 
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
+
+     <p>This example demonstrates the working of a two node cluster using JGroups as the underlying topology broadcasting/discovery
      technique.</p>
      <p>We deploy a queue on to the cluster, then create a consumer on the queue on each node, and we create a producer on only one of the nodes.</p>
      <p>We then send some messages via the producer, and we verify that <b>both</b> consumers receive the sent messages
@@ -58,150 +60,8 @@ under the License.
       &lt;/discovery-group>
    &lt;/discovery-groups&gt;
      </code>
-     </pre>    
+     </pre>
      <p>For more information on ActiveMQ Artemis clustering in general, please see the clustering
-     section of the user manual.</p>      
-     <h2>Example step-by-step</h2>
-     <p><i>To run the example, simply type <code>./build.sh</code> (or <code>build.bat</code> on windows) from this directory</i></p>
-
-     <ol>
-        <li> Get an initial context for looking up JNDI from server 0.</li>
-        <pre class="prettyprint">
-           <code>
-   ic0 = getContext(0);
-   </code>
-        </pre>
-
-        <li>Look-up the JMS Queue object from JNDI</li>
-        <pre class="prettyprint">
-           <code>Queue queue = (Queue)ic0.lookup("/queue/exampleQueue");</code>
-        </pre>
-
-        <li>Look-up a JMS Connection Factory object from JNDI on server 0</li>
-        <pre class="prettyprint">
-           <code>ConnectionFactory cf0 = (ConnectionFactory)ic0.lookup("/ConnectionFactory");</code>
-        </pre>
-
-        <li>Get an initial context for looking up JNDI from server 1.</li>
-        <pre class="prettyprint">
-           <code>ic1 = getContext(1);</code>
-        </pre>
-
-        <li>Look-up a JMS Connection Factory object from JNDI on server 1</li>
-        <pre class="prettyprint">
-           <code>ConnectionFactory cf1 = (ConnectionFactory)ic1.lookup("/ConnectionFactory");
-           </code>
-        </pre>
-
-        <li>We create a JMS Connection connection0 which is a connection to server 0</li>
-        <pre class="prettyprint">
-          <code>
-   connection0 = cf0.createConnection();
-          </code>
-        </pre>
-        
-        <li>We create a JMS Connection connection1 which is a connection to server 1</li>
-        <pre class="prettyprint">
-          <code>
-   connection1 = cf1.createConnection();
-          </code>
-        </pre>
-
-        <li>We create a JMS Session on server 0</li>
-        <pre class="prettyprint">
-           <code>
-   Session session0 = connection0.createSession(false, Session.AUTO_ACKNOWLEDGE);
-           </code>
-        </pre>
-        
-        <li>We create a JMS Session on server 1</li>
-        <pre class="prettyprint">
-           <code>
-   Session session1 = connection1.createSession(false, Session.AUTO_ACKNOWLEDGE);
-            </code>
-        </pre>
-
-        <li>We start the connections to ensure delivery occurs on them</li>
-        <pre class="prettyprint">
-           <code>
-   connection0.start();
-
-   connection1.start();
-           </code>
-        </pre>
-
-        <li>We create JMS MessageConsumer objects on server 0 and server 1</li>
-        <pre class="prettyprint">
-           <code>
-   MessageConsumer consumer0 = session0.createConsumer(queue);
-
-   MessageConsumer consumer1 = session1.createConsumer(queue);
-           </code>
-        </pre>
-
-        <li>We create a JMS MessageProducer object on server 0.</li>
-        <pre class="prettyprint">
-           <code>
-   MessageProducer producer = session0.createProducer(queue);</code>
-        </pre>
-
-        <li>We send some messages to server 0.</li>
-        <pre class="prettyprint">
-           <code>
-	final int numMessages = 10;
-
-	for (int i = 0; i < numMessages; i++)
-	{
-	   TextMessage message = session0.createTextMessage("This is text message " + i);
-	      
-	   producer.send(message);
-	
-	   System.out.println("Sent message: " + message.getText());
-	}
-           </code>
-        </pre>
-        
-        <li>We now consume those messages on *both* server 0 and server 1.
-         We note the messages have been distributed between servers in a round robin fashion.
-         ActiveMQ Artemis has <b>load balanced</b> the messages between the available consumers on the different nodes.
-         ActiveMQ Artemis can be configured to always load balance messages to all nodes, or to only balance messages
-         to nodes which have consumers with no or matching selectors. See the user manual for more details.</li>
-         JMS Queues implement point-to-point message where each message is only ever consumed by a
-         maximum of one consumer.
-        <pre class="prettyprint">
-           <code>
-	for (int i = 0; i < numMessages; i += 2)
-	{
-	   TextMessage message0 = (TextMessage)consumer0.receive(5000);
-	
-	   System.out.println("Got message: " + message0.getText() + " from node 0");
-	
-	   TextMessage message1 = (TextMessage)consumer1.receive(5000);
-	
-	   System.out.println("Got message: " + message1.getText() + " from node 1");
-	}
-           </code>
-        </pre> 
-
-        <li>And finally (no pun intended), <b>always</b> remember to close your JMS resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
-
-        <pre class="prettyprint">
-           <code>
-	finally
-	{
-	   if (connection0 != null)
-	   {
-	      connection0.close();
-	   }
-	      
-	   if (connection1 != null)
-	   {
-	      connection1.close();
-	   }
-	}
-           </code>
-        </pre>
-
-     </ol>
+     section of the user manual.</p>
   </body>
 </html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 4af9867..17809e5 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,13 +29,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>${data.dir:./data}/bindings</bindings-directory>
+      <bindings-directory>./data/bindings</bindings-directory>
 
-      <journal-directory>${data.dir:./data}/journal</journal-directory>
+      <journal-directory>./data/journal</journal-directory>
 
-      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
+      <large-messages-directory>./data/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir:./data}/paging</paging-directory>
+      <paging-directory>./data/paging</paging-directory>
 
       <!-- Connectors -->
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 3393a42..267eae7 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,13 +29,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>${data.dir:./data}/bindings</bindings-directory>
+      <bindings-directory>./data/bindings</bindings-directory>
 
-      <journal-directory>${data.dir:./data}/journal</journal-directory>
+      <journal-directory>./data/journal</journal-directory>
 
-      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
+      <large-messages-directory>./data/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir:./data}/paging</paging-directory>
+      <paging-directory>./data/paging</paging-directory>
 
       <!-- Connectors -->
       <connectors>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/clustered-queue/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-queue/pom.xml b/examples/jms/clustered-queue/pom.xml
index 7b42875..6bd1537 100644
--- a/examples/jms/clustered-queue/pom.xml
+++ b/examples/jms/clustered-queue/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -37,115 +38,126 @@ under the License.
 
    <dependencies>
       <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
       </dependency>
    </dependencies>
 
    <profiles>
       <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <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>create1</id>
-                        <goals>
-                           <goal>create</goal>
-                        </goals>
-                        <configuration>
-                           <instance>${basedir}/target/server1</instance>
-                           <configuration>${basedir}/target/classes/activemq/server1</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>
-                           <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.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>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>clustered-queue</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
+         <!-- specify -PnoServer if you don't want to start the server -->
+         <id>noServer</id>
+         <properties>
+            <noServer>true</noServer>
+         </properties>
       </profile>
    </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create0</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <instance>${basedir}/target/server0</instance>
+                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create1</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <instance>${basedir}/target/server1</instance>
+                     <configuration>${basedir}/target/classes/activemq/server1</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start0</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <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>
+                     <ignore>${noServer}</ignore>
+                     <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.ClusteredQueueExample</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop0</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <location>${basedir}/target/server0</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop1</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <location>${basedir}/target/server1</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>clustered-queue</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>


[14/18] activemq-artemis git commit: ARTEMIS-180 removing -Pexample and some other improvements around the examples

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/clustered-queue/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-queue/readme.html b/examples/jms/clustered-queue/readme.html
index 60ebd89..d89ed24 100644
--- a/examples/jms/clustered-queue/readme.html
+++ b/examples/jms/clustered-queue/readme.html
@@ -27,6 +27,8 @@ under the License.
   <body onload="prettyPrint()">
      <h1>JMS Load Balanced Clustered Queue Example</h1>
 
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
+
      <p>This example demonstrates a JMS queue deployed on two different nodes. The two nodes are configured to form a cluster.</p>
      <p>We then create a consumer on the queue on each node, and we create a producer on only one of the nodes.</p>
      <p>We then send some messages via the producer, and we verify that <b>both</b> consumers receive the sent messages
@@ -50,147 +52,5 @@ under the License.
      </pre>
      <p>For more information on ActiveMQ Artemis load balancing, and clustering in general, please see the clustering
      section of the user manual.</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>
-
-     <ol>
-        <li> Get an initial context for looking up JNDI from server 0.</li>
-        <pre class="prettyprint">
-           <code>
-   ic0 = getContext(0);
-   </code>
-        </pre>
-
-        <li>Look-up the JMS Queue object from JNDI</li>
-        <pre class="prettyprint">
-           <code>Queue queue = (Queue)ic0.lookup("/queue/exampleQueue");</code>
-        </pre>
-
-        <li>Look-up a JMS Connection Factory object from JNDI on server 0</li>
-        <pre class="prettyprint">
-           <code>ConnectionFactory cf0 = (ConnectionFactory)ic0.lookup("/ConnectionFactory");</code>
-        </pre>
-
-        <li>Get an initial context for looking up JNDI from server 1.</li>
-        <pre class="prettyprint">
-           <code>ic1 = getContext(1);</code>
-        </pre>
-
-        <li>Look-up a JMS Connection Factory object from JNDI on server 1</li>
-        <pre class="prettyprint">
-           <code>ConnectionFactory cf1 = (ConnectionFactory)ic1.lookup("/ConnectionFactory");
-           </code>
-        </pre>
-
-        <li>We create a JMS Connection connection0 which is a connection to server 0</li>
-        <pre class="prettyprint">
-          <code>
-   connection0 = cf0.createConnection();
-          </code>
-        </pre>
-
-        <li>We create a JMS Connection connection1 which is a connection to server 1</li>
-        <pre class="prettyprint">
-          <code>
-   connection1 = cf1.createConnection();
-          </code>
-        </pre>
-
-        <li>We create a JMS Session on server 0</li>
-        <pre class="prettyprint">
-           <code>
-   Session session0 = connection0.createSession(false, Session.AUTO_ACKNOWLEDGE);
-           </code>
-        </pre>
-
-        <li>We create a JMS Session on server 1</li>
-        <pre class="prettyprint">
-           <code>
-   Session session1 = connection1.createSession(false, Session.AUTO_ACKNOWLEDGE);
-            </code>
-        </pre>
-
-        <li>We start the connections to ensure delivery occurs on them</li>
-        <pre class="prettyprint">
-           <code>
-   connection0.start();
-
-   connection1.start();
-           </code>
-        </pre>
-
-        <li>We create JMS MessageConsumer objects on server 0 and server 1</li>
-        <pre class="prettyprint">
-           <code>
-   MessageConsumer consumer0 = session0.createConsumer(queue);
-
-   MessageConsumer consumer1 = session1.createConsumer(queue);
-           </code>
-        </pre>
-
-        <li>We create a JMS MessageProducer object on server 0.</li>
-        <pre class="prettyprint">
-           <code>
-   MessageProducer producer = session0.createProducer(queue);</code>
-        </pre>
-
-        <li>We send some messages to server 0.</li>
-        <pre class="prettyprint">
-           <code>
-	final int numMessages = 10;
-
-	for (int i = 0; i < numMessages; i++)
-	{
-	   TextMessage message = session0.createTextMessage("This is text message " + i);
-
-	   producer.send(message);
-
-	   System.out.println("Sent message: " + message.getText());
-	}
-           </code>
-        </pre>
-
-        <li>We now consume those messages on *both* server 0 and server 1.
-         We note the messages have been distributed between servers in a round robin fashion.
-         ActiveMQ Artemis has <b>load balanced</b> the messages between the available consumers on the different nodes.
-         ActiveMQ Artemis can be configured to always load balance messages to all nodes, or to only balance messages
-         to nodes which have consumers with no or matching selectors. See the user manual for more details.</li>
-         JMS Queues implement point-to-point message where each message is only ever consumed by a
-         maximum of one consumer.
-        <pre class="prettyprint">
-           <code>
-	for (int i = 0; i < numMessages; i += 2)
-	{
-	   TextMessage message0 = (TextMessage)consumer0.receive(5000);
-
-	   System.out.println("Got message: " + message0.getText() + " from node 0");
-
-	   TextMessage message1 = (TextMessage)consumer1.receive(5000);
-
-	   System.out.println("Got message: " + message1.getText() + " from node 1");
-	}
-           </code>
-        </pre>
-
-        <li>And finally (no pun intended), <b>always</b> remember to close your JMS resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
-
-        <pre class="prettyprint">
-           <code>
-	finally
-	{
-	   if (connection0 != null)
-	   {
-	      connection0.close();
-	   }
-
-	   if (connection1 != null)
-	   {
-	      connection1.close();
-	   }
-	}
-           </code>
-        </pre>
-
-     </ol>
   </body>
 </html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 12a0a45..1ee779a 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
@@ -23,8 +23,10 @@ import javax.jms.MessageProducer;
 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.api.jms.ActiveMQJMSClient;
+import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
+import org.apache.activemq.artemis.jms.client.ActiveMQQueue;
 
 /**
  * A simple example that demonstrates server side load-balancing of messages between the queue instances on different
@@ -38,33 +40,16 @@ public class ClusteredQueueExample
 
       Connection connection1 = null;
 
-      InitialContext ic0 = null;
-
-      InitialContext ic1 = null;
-
       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", "tcp://localhost:61616");
-         properties.put("queue.queue/exampleQueue", "exampleQueue");
-         ic0 = new InitialContext(properties);
+         // Step 2. Instantiate the Queue
+         Queue queue = ActiveMQJMSClient.createQueue("exampleQueue");
 
-         // Step 2. Look-up the JMS Queue object from JNDI
-         Queue queue = (Queue)ic0.lookup("queue/exampleQueue");
-
-         // Step 3. Look-up a JMS Connection Factory object from JNDI on server 0
-         ConnectionFactory cf0 = (ConnectionFactory)ic0.lookup("ConnectionFactory");
-
-         // 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", "tcp://localhost:61617");
-         ic1 = new InitialContext(properties);
+         // Instantiate connection towards server 0
+         ConnectionFactory cf0 = new ActiveMQConnectionFactory("tcp://localhost:61616");
 
          // Step 5. Look-up a JMS Connection Factory object from JNDI on server 1
-         ConnectionFactory cf1 = (ConnectionFactory)ic1.lookup("ConnectionFactory");
+         ConnectionFactory cf1 = new ActiveMQConnectionFactory("tcp://localhost:61617");
 
          // Step 6. We create a JMS Connection connection0 which is a connection to server 0
          connection0 = cf0.createConnection();
@@ -135,16 +120,6 @@ public class ClusteredQueueExample
          {
             connection1.close();
          }
-
-         if (ic0 != null)
-         {
-            ic0.close();
-         }
-
-         if (ic1 != null)
-         {
-            ic1.close();
-         }
       }
    }
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 db97076..eb30a90 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,13 +29,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>${data.dir:./data}/bindings</bindings-directory>
+      <bindings-directory>./data/bindings</bindings-directory>
 
-      <journal-directory>${data.dir:./data}/journal</journal-directory>
+      <journal-directory>./data/journal</journal-directory>
 
-      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
+      <large-messages-directory>./data/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir:./data}/paging</paging-directory>
+      <paging-directory>./data/paging</paging-directory>
       <!-- Connectors -->
 
       <connectors>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/clustered-standalone/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-standalone/pom.xml b/examples/jms/clustered-standalone/pom.xml
deleted file mode 100644
index e37336f..0000000
--- a/examples/jms/clustered-standalone/pom.xml
+++ /dev/null
@@ -1,188 +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>artemis-jms-clustered-standalone-example</artifactId>
-   <packaging>jar</packaging>
-   <name>ActiveMQ Artemis JMS Clustered Standalone Example</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>
-   </dependencies>
-
-   <profiles>
-      <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <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>create1</id>
-                        <goals>
-                           <goal>create</goal>
-                        </goals>
-                        <configuration>
-                           <instance>${basedir}/target/server1</instance>
-                           <configuration>${basedir}/target/classes/activemq/server1</configuration>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>create2</id>
-                        <goals>
-                           <goal>create</goal>
-                        </goals>
-                        <configuration>
-                           <instance>${basedir}/target/server2</instance>
-                           <configuration>${basedir}/target/classes/activemq/server2</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>
-                           <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.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>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-clustered-standalone-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
-      </profile>
-   </profiles>
-
-</project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/clustered-standalone/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-standalone/readme.html b/examples/jms/clustered-standalone/readme.html
deleted file mode 100644
index b72aa77..0000000
--- a/examples/jms/clustered-standalone/readme.html
+++ /dev/null
@@ -1,70 +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.
--->
-
-<html>
-  <head>
-    <title>JMS Clustered Stand-alone Example</title>
-    <link rel="stylesheet" type="text/css" href="../common/common.css" />
-    <link rel="stylesheet" type="text/css" href="../common/prettify.css" />
-    <script type="text/javascript" src="../common/prettify.js"></script>
-  </head>
-  <body onload="prettyPrint()">
-     <h1>JMS Clustered Stand-alone Example</h1>
-
-     <p>This example demonstrates a JMS Topic deployed on three different nodes.
-         The three nodes are configured to form a cluster.</p>
-     <p>Subscribers for the topic are created on each node, and a producer is created on only one of the nodes.</p>
-     <p>Some messages are sent by the producer, and we verify that <strong>all</strong> subscribers receive all the
-     sent messages.</p>
-     <p>This example uses ActiveMQ's default stand-alone clustered configuration.
-        The relevant snippet from the server configuration, which tells the servers to form a cluster between the three nodes
-     and to load balance the messages between the nodes is:</p>     
-     <pre class="prettyprint">
-     <code>&lt;cluster-connection name="my-cluster"&gt;
-        &lt;address&gt;jms&lt;/address&gt;
-        &lt;discovery-group-ref discovery-group-name="dg-group1"/&gt;
-     &lt;/cluster-connection&gt;
-     </code>
-     </pre>    
-     <h2>Example step-by-step</h2>
-     <p><i>To run the example, simply type <code>mvn verify -Pexample</code> from this directory</i>. This will
-        automatically start the 3 cluster nodes, each with its specific configuration.</p>
-     <p>To start the tests <em>manually</em>, the following steps are:</p>
-     <ul>
-        <li>create 4 terminals (3 for the servers and 1 for the example client)</li>
-        <li>in the first terminal, go to the <code>bin</code> directory and start the first server (with default configuration):
-           <pre class="prettyprint"><code>./run.sh ../config/stand-alone/clustered</code></pre>
-        <li>in the second terminal, start the second server:
-           <pre class="prettyprint"><code>export CLUSTER_PROPS="-Ddata.dir=../data-server2 -Djnp.port=2099 -Djnp.rmiPort=2098 -Dactivemq.remoting.netty.port=6445 -Dactivemq.remoting.netty.batch.port=6455"
-./run.sh ../config/stand-alone/clustered</code></pre>
-        <li>in the third terminal, start the third server (with default configuration):
-           <pre class="prettyprint"><code>export CLUSTER_PROPS="-Ddata.dir=../data-server3 -Djnp.port=3099 -Djnp.rmiPort=3098 -Dactivemq.remoting.netty.port=7445 -Dactivemq.remoting.netty.batch.port=7455"
-./run.sh ../config/stand-alone/clustered</code></pre>
-        <li>finally, in the fourth terminal, start the example
-           <pre class="prettyprint"><code>./build.sh runRemote</code> (or <code>build.bat runRemote</code> on windows)</pre>
-     <p>The example connects to the three cluster nodes using JNDI (which are retrieved from 
-        <a href="server0/client-jndi.properties">server0</a>, <a href="server1/client-jndi.properties">server1</a>, and
-        <a href="server2/client-jndi.properties">server2</a>' s JNDI properties file). The JNDI ports were specified
-        using the environment property <code>jnp.port</code> (or 1098 by default) when starting the 3 cluster nodes.</p>
-     
-     <p>For a description of the example code, please read the <a href="../clustered-topic/readme.html">
-        clustered-topic example</a> which is very similar (it has 2 nodes while this example has 3 nodes).
-
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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
deleted file mode 100644
index 59427f8..0000000
--- a/examples/jms/clustered-standalone/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredStandaloneExample.java
+++ /dev/null
@@ -1,181 +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.jms.example;
-
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import javax.jms.Topic;
-import javax.naming.InitialContext;
-import java.util.Hashtable;
-
-public class ClusteredStandaloneExample
-{
-   public static void main(final String[] args) throws Exception
-   {
-      Connection connection0 = null;
-
-      Connection connection1 = null;
-
-      Connection connection2 = null;
-
-      InitialContext initialContext0 = null;
-      InitialContext initialContext1 = null;
-      InitialContext initialContext2 = null;
-
-      try
-      {
-         Hashtable<String, Object> properties = new Hashtable<String, Object>();
-         properties.put("java.naming.factory.initial", "org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory");
-         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", "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", "tcp://localhost:61618");
-         initialContext2 = new InitialContext(properties);
-
-         // First we demonstrate a distributed topic.
-         // We create a connection on each node, create a consumer on each connection and send some
-         // messages at a node and verify they are all received by all consumers
-
-         ConnectionFactory cf0 = (ConnectionFactory)initialContext0.lookup("ConnectionFactory");
-
-         System.out.println("Got cf " + cf0);
-
-         ConnectionFactory cf1 = (ConnectionFactory)initialContext1.lookup("ConnectionFactory");
-
-         System.out.println("Got cf " + cf1);
-
-         ConnectionFactory cf2 = (ConnectionFactory)initialContext2.lookup("ConnectionFactory");
-
-         System.out.println("Got cf " + cf2);
-
-         Topic topic = (Topic)initialContext0.lookup("topic/exampleTopic");
-
-         connection0 = cf0.createConnection();
-
-         connection1 = cf1.createConnection();
-
-         connection2 = cf2.createConnection();
-
-         connection0.start();
-
-         connection1.start();
-
-         connection2.start();
-
-         Session session0 = connection0.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-         Session session1 = connection1.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-         Session session2 = connection2.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-         MessageConsumer messageConsumer0 = session0.createConsumer(topic);
-
-         MessageConsumer messageConsumer1 = session1.createConsumer(topic);
-
-         MessageConsumer messageConsumer2 = session2.createConsumer(topic);
-
-         MessageProducer producer = session0.createProducer(topic);
-
-         final int numMessages = 10;
-
-         for (int i = 0; i < numMessages; i++)
-         {
-            TextMessage message = session0.createTextMessage("Message " + i);
-
-            producer.send(message);
-         }
-
-         for (int i = 0; i < numMessages; i++)
-         {
-            TextMessage message0 = (TextMessage)messageConsumer0.receive(2000);
-
-            if (message0 == null)
-            {
-               throw new IllegalStateException();
-            }
-
-            // System.out.println("Received message " + message0.getText());
-
-            TextMessage message1 = (TextMessage)messageConsumer1.receive(2000);
-
-            if (message1 == null)
-            {
-               throw new IllegalStateException();
-            }
-
-            // System.out.println("Received message " + message1.getText());
-
-            TextMessage message2 = (TextMessage)messageConsumer2.receive(2000);
-
-            if (message2 == null)
-            {
-               throw new IllegalStateException();
-            }
-
-            System.out.println("Received message " + message2.getText());
-         }
-
-         producer.close();
-
-         messageConsumer0.close();
-
-         messageConsumer1.close();
-
-         messageConsumer2.close();
-      }
-      finally
-      {
-         // Step 12. Be sure to close our JMS resources!
-         if (initialContext0 != null)
-         {
-            initialContext0.close();
-         }
-         if (initialContext1 != null)
-         {
-            initialContext1.close();
-         }
-         if (initialContext2 != null)
-         {
-            initialContext2.close();
-         }
-         if (connection0 != null)
-         {
-            connection0.close();
-         }
-         if (connection1 != null)
-         {
-            connection1.close();
-         }
-         if (connection2 != null)
-         {
-            connection2.close();
-         }
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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
deleted file mode 100644
index 55675d0..0000000
--- a/examples/jms/clustered-standalone/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 topic used by the example-->
-      <topic name="exampleTopic"/>
-   </jms>
-
-   <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>
-      <!-- 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>
-            <retry-interval>500</retry-interval>
-            <use-duplicate-detection>true</use-duplicate-detection>
-            <message-load-balancing>STRICT</message-load-balancing>
-            <max-hops>1</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.topic.exampleTopic">
-            <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/dd820318/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
deleted file mode 100644
index 78b0f2f..0000000
--- a/examples/jms/clustered-standalone/src/main/resources/activemq/server1/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 topic used by the example-->
-      <topic name="exampleTopic"/>
-   </jms>
-
-   <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>
-
-      <!-- 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>
-            <retry-interval>500</retry-interval>
-            <use-duplicate-detection>true</use-duplicate-detection>
-            <message-load-balancing>STRICT</message-load-balancing>
-            <max-hops>1</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.topic.exampleTopic">
-            <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/dd820318/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
deleted file mode 100644
index 389914c..0000000
--- a/examples/jms/clustered-standalone/src/main/resources/activemq/server2/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 topic used by the example-->
-      <topic name="exampleTopic"/>
-   </jms>
-
-   <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>
-
-      <!-- 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>
-            <retry-interval>500</retry-interval>
-            <use-duplicate-detection>true</use-duplicate-detection>
-            <message-load-balancing>STRICT</message-load-balancing>
-            <max-hops>1</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.topic.exampleTopic">
-            <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/dd820318/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 98fcc90..7a86bf7 100644
--- a/examples/jms/clustered-static-discovery/pom.xml
+++ b/examples/jms/clustered-static-discovery/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-clustered-static-discovery-example</artifactId>
+   <artifactId>clustered-static-discovery</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS Clustered Static Discovery Example</name>
 
@@ -42,189 +43,206 @@ under the License.
          <version>${project.version}</version>
       </dependency>
       <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
       </dependency>
    </dependencies>
 
    <profiles>
       <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <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>create1</id>
-                        <goals>
-                           <goal>create</goal>
-                        </goals>
-                        <configuration>
-                           <instance>${basedir}/target/server1</instance>
-                           <configuration>${basedir}/target/classes/activemq/server1</configuration>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>create2</id>
-                        <goals>
-                           <goal>create</goal>
-                        </goals>
-                        <configuration>
-                           <instance>${basedir}/target/server2</instance>
-                           <configuration>${basedir}/target/classes/activemq/server2</configuration>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>create3</id>
-                        <goals>
-                           <goal>create</goal>
-                        </goals>
-                        <configuration>
-                           <instance>${basedir}/target/server3</instance>
-                           <configuration>${basedir}/target/classes/activemq/server3</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>
-                           <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>runClient</id>
-                        <goals>
-                           <goal>runClient</goal>
-                        </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>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-clustered-static-discovery-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
+         <!-- specify -PnoServer if you don't want to start the server -->
+         <id>noServer</id>
+         <properties>
+            <noServer>true</noServer>
+         </properties>
       </profile>
    </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create0</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <instance>${basedir}/target/server0</instance>
+                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create1</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <instance>${basedir}/target/server1</instance>
+                     <configuration>${basedir}/target/classes/activemq/server1</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create2</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <instance>${basedir}/target/server2</instance>
+                     <configuration>${basedir}/target/classes/activemq/server2</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create3</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <instance>${basedir}/target/server3</instance>
+                     <configuration>${basedir}/target/classes/activemq/server3</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start0</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <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>
+                     <ignore>${noServer}</ignore>
+                     <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>
+                     <ignore>${noServer}</ignore>
+                     <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>
+                     <ignore>${noServer}</ignore>
+                     <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>runClient</id>
+                  <goals>
+                     <goal>runClient</goal>
+                  </goals>
+                  <configuration>
+                     <clientClass>org.apache.activemq.artemis.jms.example.StaticClusteredQueueExample</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop0</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <location>${basedir}/target/server0</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop1</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <location>${basedir}/target/server1</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop2</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <location>${basedir}/target/server2</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop3</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <location>${basedir}/target/server3</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>clustered-static-discovery</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/clustered-static-discovery/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/clustered-static-discovery/readme.html b/examples/jms/clustered-static-discovery/readme.html
index 71a4501..c1347dc 100644
--- a/examples/jms/clustered-static-discovery/readme.html
+++ b/examples/jms/clustered-static-discovery/readme.html
@@ -26,6 +26,7 @@ under the License.
   </head>
   <body onload="prettyPrint()">
      <h1>JMS Load Balanced Static Clustered Queue Example</h1>
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
 
      <p>This example demonstrates a JMS queue deployed on two different nodes. The two nodes are configured to form a cluster
        from a <em>static</em> list of nodes.</p>
@@ -53,147 +54,5 @@ under the License.
      </pre>
      <p>For more information on ActiveMQ Artemis load balancing, and clustering in general, please see the clustering
      section of the user manual.</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>
-
-     <ol>
-        <li> Get an initial context for looking up JNDI from server 0.</li>
-        <pre class="prettyprint">
-           <code>
-   ic0 = getContext(0);
-   </code>
-        </pre>
-
-        <li>Look-up the JMS Queue object from JNDI</li>
-        <pre class="prettyprint">
-           <code>Queue queue = (Queue)ic0.lookup("/queue/exampleQueue");</code>
-        </pre>
-
-        <li>Look-up a JMS Connection Factory object from JNDI on server 0</li>
-        <pre class="prettyprint">
-           <code>ConnectionFactory cf0 = (ConnectionFactory)ic0.lookup("/ConnectionFactory");</code>
-        </pre>
-
-        <li>Get an initial context for looking up JNDI from server 1.</li>
-        <pre class="prettyprint">
-           <code>ic1 = getContext(1);</code>
-        </pre>
-
-        <li>Look-up a JMS Connection Factory object from JNDI on server 1</li>
-        <pre class="prettyprint">
-           <code>ConnectionFactory cf1 = (ConnectionFactory)ic1.lookup("/ConnectionFactory");
-           </code>
-        </pre>
-
-        <li>We create a JMS Connection connection0 which is a connection to server 0</li>
-        <pre class="prettyprint">
-          <code>
-   connection0 = cf0.createConnection();
-          </code>
-        </pre>
-
-        <li>We create a JMS Connection connection1 which is a connection to server 1</li>
-        <pre class="prettyprint">
-          <code>
-   connection1 = cf1.createConnection();
-          </code>
-        </pre>
-
-        <li>We create a JMS Session on server 0</li>
-        <pre class="prettyprint">
-           <code>
-   Session session0 = connection0.createSession(false, Session.AUTO_ACKNOWLEDGE);
-           </code>
-        </pre>
-
-        <li>We create a JMS Session on server 1</li>
-        <pre class="prettyprint">
-           <code>
-   Session session1 = connection1.createSession(false, Session.AUTO_ACKNOWLEDGE);
-            </code>
-        </pre>
-
-        <li>We start the connections to ensure delivery occurs on them</li>
-        <pre class="prettyprint">
-           <code>
-   connection0.start();
-
-   connection1.start();
-           </code>
-        </pre>
-
-        <li>We create JMS MessageConsumer objects on server 0 and server 1</li>
-        <pre class="prettyprint">
-           <code>
-   MessageConsumer consumer0 = session0.createConsumer(queue);
-
-   MessageConsumer consumer1 = session1.createConsumer(queue);
-           </code>
-        </pre>
-
-        <li>We create a JMS MessageProducer object on server 0.</li>
-        <pre class="prettyprint">
-           <code>
-   MessageProducer producer = session0.createProducer(queue);</code>
-        </pre>
-
-        <li>We send some messages to server 0.</li>
-        <pre class="prettyprint">
-           <code>
-	final int numMessages = 10;
-
-	for (int i = 0; i < numMessages; i++)
-	{
-	   TextMessage message = session0.createTextMessage("This is text message " + i);
-
-	   producer.send(message);
-
-	   System.out.println("Sent message: " + message.getText());
-	}
-           </code>
-        </pre>
-
-        <li>We now consume those messages on *both* server 0 and server 1.
-         We note the messages have been distributed between servers in a round robin fashion.
-         ActiveMQ Artemis has <b>load balanced</b> the messages between the available consumers on the different nodes.
-         ActiveMQ Artemis can be configured to always load balance messages to all nodes, or to only balance messages
-         to nodes which have consumers with no or matching selectors. See the user manual for more details.</li>
-         JMS Queues implement point-to-point message where each message is only ever consumed by a
-         maximum of one consumer.
-        <pre class="prettyprint">
-           <code>
-	for (int i = 0; i < numMessages; i += 2)
-	{
-	   TextMessage message0 = (TextMessage)consumer0.receive(5000);
-
-	   System.out.println("Got message: " + message0.getText() + " from node 0");
-
-	   TextMessage message1 = (TextMessage)consumer1.receive(5000);
-
-	   System.out.println("Got message: " + message1.getText() + " from node 1");
-	}
-           </code>
-        </pre>
-
-        <li>And finally (no pun intended), <b>always</b> remember to close your JMS resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
-
-        <pre class="prettyprint">
-           <code>
-	finally
-	{
-	   if (connection0 != null)
-	   {
-	      connection0.close();
-	   }
-
-	   if (connection1 != null)
-	   {
-	      connection1.close();
-	   }
-	}
-           </code>
-        </pre>
-
-     </ol>
   </body>
 </html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 4e0ac26..6716075 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 org.apache.activemq.artemis.util.ServerUtil;
-
 import javax.jms.Connection;
 import javax.jms.ConnectionFactory;
 import javax.jms.MessageConsumer;
@@ -25,8 +23,10 @@ import javax.jms.MessageProducer;
 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.api.jms.ActiveMQJMSClient;
+import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
+import org.apache.activemq.artemis.util.ServerUtil;
 
 /**
  * A simple example that demonstrates server side load-balancing of messages between the queue instances on different
@@ -46,22 +46,13 @@ public class StaticClusteredQueueExample
 
       Connection connection3 = null;
 
-      InitialContext ic0 = null;
-
       try
       {
-         // 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", "tcp://localhost:61619");
-         properties.put("queue.queue/exampleQueue", "exampleQueue");
-         ic0 = new InitialContext(properties);
+         // Step 2. Use direct instantiation (or JNDI if you like)
+         Queue queue = ActiveMQJMSClient.createQueue("exampleQueue");
 
-         // Step 2. Look-up the JMS Queue object from JNDI
-         Queue queue = (Queue)ic0.lookup("queue/exampleQueue");
-
-         // Step 3. Look-up a JMS Connection Factory object from JNDI on server 0
-         ConnectionFactory cf0 = (ConnectionFactory)ic0.lookup("ConnectionFactory");
+         // Step 3. new JMS Connection Factory object from JNDI on server 3
+         ConnectionFactory cf0 = new ActiveMQConnectionFactory("tcp://localhost:61619");
 
          //grab an initial connection and wait, in reality you wouldn't do it this way but since we want to ensure an
          // equal load balance we do this and then create 4 connections round robined
@@ -189,11 +180,6 @@ public class StaticClusteredQueueExample
          {
             connection3.close();
          }
-
-         if (ic0 != null)
-         {
-            ic0.close();
-         }
       }
    }
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 30bee5d..b1bfd11 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,13 +29,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>${data.dir:./data}/bindings</bindings-directory>
+      <bindings-directory>./data/bindings</bindings-directory>
 
-      <journal-directory>${data.dir:./data}/journal</journal-directory>
+      <journal-directory>./data/journal</journal-directory>
 
-      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
+      <large-messages-directory>./data/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir:./data}/paging</paging-directory>
+      <paging-directory>./data/paging</paging-directory>
 
       <!-- Connectors -->
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 f2f2565..0412576 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,13 +29,13 @@ under the License.
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>${data.dir:./data}/bindings</bindings-directory>
+      <bindings-directory>./data/bindings</bindings-directory>
 
-      <journal-directory>${data.dir:./data}/journal</journal-directory>
+      <journal-directory>./data/journal</journal-directory>
 
-      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
+      <large-messages-directory>./data/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir:./data}/paging</paging-directory>
+      <paging-directory>./data/paging</paging-directory>
 
       <!-- Connectors -->
       <connectors>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 e9e5f08..98b8f04 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,13 +26,13 @@
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>${data.dir:./data}/bindings</bindings-directory>
+      <bindings-directory>./data/bindings</bindings-directory>
 
-      <journal-directory>${data.dir:./data}/journal</journal-directory>
+      <journal-directory>./data/journal</journal-directory>
 
-      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
+      <large-messages-directory>./data/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir:./data}/paging</paging-directory>
+      <paging-directory>./data/paging</paging-directory>
 
       <!-- Connectors -->
       <connectors>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 0ebc2d0..40bef87 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,13 +26,13 @@
 
    <core xmlns="urn:activemq:core">
 
-      <bindings-directory>${data.dir:./data}/bindings</bindings-directory>
+      <bindings-directory>./data/bindings</bindings-directory>
 
-      <journal-directory>${data.dir:./data}/journal</journal-directory>
+      <journal-directory>./data/journal</journal-directory>
 
-      <large-messages-directory>${data.dir:./data}/largemessages</large-messages-directory>
+      <large-messages-directory>./data/largemessages</large-messages-directory>
 
-      <paging-directory>${data.dir:./data}/paging</paging-directory>
+      <paging-directory>./data/paging</paging-directory>
 
       <!-- Connectors -->
       <connectors>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 991a624..f3d8db5 100644
--- a/examples/jms/clustered-static-oneway/pom.xml
+++ b/examples/jms/clustered-static-oneway/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-clustered-static-oneway-example</artifactId>
+   <artifactId>clustered-static-oneway</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS Clustered Static One Way Example</name>
 
@@ -42,151 +43,165 @@ under the License.
          <version>${project.version}</version>
       </dependency>
       <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
       </dependency>
    </dependencies>
 
    <profiles>
       <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <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>create1</id>
-                        <goals>
-                           <goal>create</goal>
-                        </goals>
-                        <configuration>
-                           <instance>${basedir}/target/server1</instance>
-                           <configuration>${basedir}/target/classes/activemq/server1</configuration>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>create2</id>
-                        <goals>
-                           <goal>create</goal>
-                        </goals>
-                        <configuration>
-                           <instance>${basedir}/target/server2</instance>
-                           <configuration>${basedir}/target/classes/activemq/server2</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>
-                           <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>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-clustered-static-oneway-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
+         <!-- specify -PnoServer if you don't want to start the server -->
+         <id>noServer</id>
+         <properties>
+            <noServer>true</noServer>
+         </properties>
       </profile>
    </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create0</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <instance>${basedir}/target/server0</instance>
+                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create1</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <instance>${basedir}/target/server1</instance>
+                     <configuration>${basedir}/target/classes/activemq/server1</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create2</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <instance>${basedir}/target/server2</instance>
+                     <configuration>${basedir}/target/classes/activemq/server2</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start0</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <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>
+                     <ignore>${noServer}</ignore>
+                     <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>
+                     <ignore>${noServer}</ignore>
+                     <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>
+                     <ignore>${noServer}</ignore>
+                     <location>${basedir}/target/server0</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop1</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <location>${basedir}/target/server1</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop2</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <location>${basedir}/target/server2</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>clustered-static-oneway</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 </project>


[12/18] activemq-artemis git commit: ARTEMIS-180 removing -Pexample and some other improvements around the examples

Posted by cl...@apache.org.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/dead-letter/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/dead-letter/readme.html b/examples/jms/dead-letter/readme.html
index 36985e2..deb836d 100644
--- a/examples/jms/dead-letter/readme.html
+++ b/examples/jms/dead-letter/readme.html
@@ -26,9 +26,10 @@ under the License.
   </head>
   <body onload="prettyPrint()">
      <h1>Dead Letter Example</h1>
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
 
      <p>This example shows you how to define and deal with dead letter messages.</p>
-     <p>Messages can be delivered unsuccessfully (e.g. if the transacted session used to consume them is rolled back). 
+     <p>Messages can be delivered unsuccessfully (e.g. if the transacted session used to consume them is rolled back).
          Such a message goes back to the JMS destination ready to be redelivered.
          However, this means it is possible for a message to be delivered again and again without any success and remain in the destination, clogging the system.</p>
      <p>To prevent this, messaging systems define dead letter messages: after a specified unsuccessful delivery attempts, the message is removed from the destination
@@ -47,12 +48,12 @@ under the License.
             &lt;max-delivery-attempts&gt;3&lt;/max-delivery-attempts&gt;
          &lt;/address-setting&gt;
          </code>
-     </pre>          
+     </pre>
      <p>This configuration will moved dead letter messages from <code>exampleQueue</code> to the <code>deadLetterQueue</code>.</p>
      <p>ActiveMQ Artemis allows to specify either a <code>Queue</code> by prefixing the <code>dead-letter-address</code> with <code>jms.queue.</code>
          or a <code>Topic</code> by prefixing with <code>jms.topic.</code>.<br />
          In this example, we will use a <code>Queue</code> to hold the dead letter messages.</p>
-     <p>The maximum attempts of delivery is <code>3</code>. Once this figure is reached, a message is considered a dead letter message and is moved to 
+     <p>The maximum attempts of delivery is <code>3</code>. Once this figure is reached, a message is considered a dead letter message and is moved to
          the <code>deadLetterQueue</code>.
      <p>Since we want to consume messages from this deadLetterQueue, we also need to add a JNDI binding to perform a lookup.
          This is configured in <a href="src/main/resources/activemq/server0/activemq-jms.xml">activemq-jms.xml</a></p>
@@ -61,166 +62,5 @@ under the License.
             &lt;entry name="/queue/deadLetterQueue"/&gt;
          &lt;/queue&gt;</code>
      </pre>
-     </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>
-     <ol>
-        <li>First we need to get an initial context so we can look-up the JMS connection factory and destination objects from JNDI. This initial context will get it's properties from the <code>client-jndi.properties</code> file in the directory <code>../common/config</code></li>
-        <pre class="prettyprint">
-           <code>InitialContext initialContext = getContext();</code>
-        </pre>
-
-        <li>We look up the JMS queue object from JNDI</li>
-        <pre class="prettyprint">
-           <code>Queue queue = (Queue) initialContext.lookup("/queue/exampleQueue");</code>
-        </pre>
-
-        <li>We look up the JMS connection factory object from JNDI</li>
-        <pre class="prettyprint">
-           <code>ConnectionFactory cf = (ConnectionFactory) initialContext.lookup("/ConnectionFactory");</code>
-        </pre>
-
-        <li>We create a JMS connection</li>
-        <pre class="prettyprint">
-           <code>connection = cf.createConnection();</code>
-        </pre>
-
-        <li>We create a JMS <em>transacted</em> session
-        <pre class="prettyprint">
-           <code>Session session = connection.createSession(true, 0);</code>
-        </pre>
-
-        <li>We create a JMS message producer on the session. This will be used to send the messages</li>
-        <pre class="prettyprint">
-          <code>MessageProducer messageProducer = session.createProducer(topic);</code>
-       </pre>
-       
-        <li>We create a text messages</li>
-        <pre class="prettyprint">
-            <code>TextMessage message = session.createTextMessage("this is a text message");</code>
-        </pre>
-
-        <li>We send the message to the queue</li>
-        <pre class="prettyprint">
-            <code>producer.send(message);</code>
-        </pre>
-        
-       <li>We commit the session to effectively send the message to the queue</li>
-        <pre class="prettyprint">
-            <code>session.commit();</code>
-        </pre>
-
-        <p>We will now consume the message from the queue 3 times and roll back the session every time</p>
-        
-        <li>We create a JMS message consumer on the queue</li>
-        <pre class="prettyprint">
-            <code>MessageConsumer messageConsumer = session.createConsumer(queue);</code>
-        </pre>
-        
-        <li>We start the connection. In order for delivery to occur on any consumers or subscribers on a connection, the connection must be started</li>
-        <pre class="prettyprint">
-           <code>connection.start();</code>
-        </pre>
-        
-        <li>We receive the message a 1<sup>st</sup> time</li>
-        <pre class="prettyprint">
-            <code>TextMessage messageReceived = (TextMessage)messageConsumer.receive(5000);
-            System.out.println("1st delivery from " + queue.getQueueName() + ": " + messageReceived.getText());</code>            
-        </pre>
-        
-        <li>We roll back the session. The message we received is undelivered and goes back to the queue</li>
-        <pre class="prettyprint">
-            <code>session.rollback();</code>
-        </pre>
-        
-        <li>We receive a message and roll back the session a 2<sup>nd</sup> time
-        <pre class="prettyprint">
-            <code>messageReceived = (TextMessage)messageConsumer.receive(5000);
-            System.out.println("2nd delivery from " + queue.getQueueName() + ": " + messageReceived.getText());
-            session.rollback();</code>
-        </pre>
-  
-        <li>We do it againt a 3<sup>rd</sup> time
-       <pre class="prettyprint">
-           <code>messageReceived = (TextMessage)messageConsumer.receive(5000);
-           System.out.println("3rd delivery from " + queue.getQueueName() + ": " + messageReceived.getText());
-           session.rollback();</code>
-       </pre>
-  
-       <p>Since the queue was configured to move messages to the <code>deadLetterQueue</code> after <code>3</code> unsuccessful delivery attempts,
-           the message won't be in the <code>queue</code> anymore</p>
-           
-        <li>We try to receive a message from the queue for a 4<sup>th</sup>. Since there is none, the call will timeout after 5000ms and <code>messageReceived</code> will be <code>null</code>
-        <pre class="prettyprint">
-           <code>messageReceived = (TextMessage)messageConsumer.receive(5000);
-           System.out.println("4th delivery from " + queue.getQueueName() + ": " + messageReceived);</code>
-        </pre>
-        
-        <p>We have configured ActiveMQ Artemis to send any dead letter messages to the <code>deadLetterQueue</code>.
-            We will now consume messages from this queue and receives the <em>dead letter messages</em>.</p>
-            
-        <li>We look up the JMS <em>dead letter queue</em> object from JNDI</li>
-        <pre class="prettyprint">
-           <code>Queue deadLetterQueue = (Queue)initialContext.lookup("/queue/deadLetterQueue");</code>
-        </pre>
-                  
-        <li>We create a JMS message consumer on the dead letter queue</li>
-        <pre class="prettyprint">
-            <code>MessageConsumer deadLetterConsumer = session.createConsumer(expiryQueue);</code>
-        </pre>
-        
-        <li>We consume a message from the dead letter queue:</li>
-        <pre class="prettyprint">
-            <code>messageReceived = (TextMessage)deadLetterConsumer.receive(5000);</code>
-        </pre>
-        
-        <li>The message consumed from the <em>dead letter queue</em> has the <em>same content</em> than the message which was sent to the <em>queue</em>
-        <pre class="prettyprint">
-            <code>System.out.println("Received message from " + deadLetterQueue.getQueueName() + ": " + messageReceived.getText());</code>
-        </pre>    
-            
-        <p>JMS does not specify the notion of dead letter destinations and messages. From JMS point of view, the message received from the dead letter queue
-            is a <strong>different</strong> message than the message removed from the queue after the unsuccessful delivery attempts:
-            the messages have the same content (properties and body) but their JMS headers differ.<br />
-            ActiveMQ Artemis defines additional properties for messages received from a dead letter destination</p>
-            
-        <li>The message's destination is the dead letter queue</li>
-        <pre class="prettyprint">
-            <code>System.out.println("Destination of the message: " + ((Queue)messageReceived.getJMSDestination()).getQueueName());</code>
-        </pre>
-
-        <li>The <strong>origin destination</strong> is stored in the <code>_AMQ_ORIG_ADDRESS</code> property
-        <pre class="prettyprint">
-            <code>System.out.println("*Origin destination* of the message: " + messageReceived.getStringProperty("_AMQ_ORIG_ADDRESS"));</code>
-        </pre>
-
-        <li>We do not forget to commit the session to acknowledge that we have received the message from the dead letter queue</li>
-        <pre class="prettyprint">
-            <code>session.commit();</code>
-        </pre>
-
-        </p>    
-        <li>And finally, <b>always</b> remember to close your JMS connections and resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
-
-        <pre class="prettyprint">
-           <code>finally
-           {
-              if (initialContext != null)
-              {
-                initialContext.close();
-              }
-              if (connection != null)
-              {
-                 connection.close();
-              }
-           }</code>
-        </pre>
-     </ol>
-     
-     <h2>More information</h2>
-     
-     <ul>
-        <li>User Manual's <a href="../../../docs/user-manual/en/html_single/index.html#undelivered-messages">Undelivered Messages chapter</a></li>
-     </ul>
   </body>
 </html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/delayed-redelivery/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/delayed-redelivery/pom.xml b/examples/jms/delayed-redelivery/pom.xml
index 764efda..2fd5090 100644
--- a/examples/jms/delayed-redelivery/pom.xml
+++ b/examples/jms/delayed-redelivery/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-delayed-redelivery-example</artifactId>
+   <artifactId>delayed-redelivery</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS Delayed Redelivery Example</name>
 
@@ -37,71 +38,82 @@ under the License.
 
    <dependencies>
       <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
       </dependency>
    </dependencies>
 
    <profiles>
       <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>create</id>
-                        <goals>
-                           <goal>create</goal>
-                        </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.DelayedRedeliveryExample</clientClass>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>cli</goal>
-                        </goals>
-                        <configuration>
-                           <args>
-                              <param>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-delayed-redelivery-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
+         <!-- specify -PnoServer if you don't want to start the server -->
+         <id>noServer</id>
+         <properties>
+            <noServer>true</noServer>
+         </properties>
       </profile>
    </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                     <ignore>${noServer}</ignore>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <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.DelayedRedeliveryExample</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>delayed-redelivery</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/delayed-redelivery/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/delayed-redelivery/readme.html b/examples/jms/delayed-redelivery/readme.html
index 8613c02..09ecb38 100644
--- a/examples/jms/delayed-redelivery/readme.html
+++ b/examples/jms/delayed-redelivery/readme.html
@@ -26,7 +26,8 @@ under the License.
   </head>
   <body onload="prettyPrint()">
      <h1>Delayed Redelivery Example</h1>
-     
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
+
      <p>This example demonstrates how ActiveMQ Artemis can be configured to provide a delayed redelivery in the case
      where a message needs to be redelivered.</p>
      <p>Delaying redelivery can often be useful in the case that clients regularly fail or roll-back. Without a delayed
@@ -46,142 +47,10 @@ under the License.
      <p>We then consume a message in a transacted session, and rollback, and note that the message is not redelivered until
      after 5 seconds.</p>
      <pre class="prettyprint">
-         <code>&lt;address-setting match="jms.queue.exampleQueue"&gt;           
+         <code>&lt;address-setting match="jms.queue.exampleQueue"&gt;
             &lt;redelivery-delay&gt;5000&lt;/redelivery-delay&gt;
          &lt;/address-setting&gt;
          </code>
-     </pre>                 
-     <p><i>To run the example, simply type <code>mvn verify -Pexample</code> from this directory</i></p>
-     <ol>
-        <li>Create an initial context to perform the JNDI lookup.</li>
-        <pre class="prettyprint">
-           <code>initialContext = getContext(0);</code>
-        </pre>
-
-        <li>Perform a lookup on the queue</li>
-        <pre class="prettyprint">
-           <code>Queue queue = (Queue)initialContext.lookup("/queue/exampleQueue");</code>
-        </pre>
-
-        <li>Perform a lookup on the Connection Factory</li>
-        <pre class="prettyprint">
-           <code>ConnectionFactory cf = (ConnectionFactory)initialContext.lookup("/ConnectionFactory");</code>
-        </pre>
-
-        <li>Create a JMS Connection</li>
-        <pre class="prettyprint">
-           <code>connection = cf.createConnection();</code>
-        </pre>
-
-        <li>Create a transacted JMS Session
-        <pre class="prettyprint">
-           <code>Session session = connection.createSession(true, 0);</code>
-        </pre>
-
-        <li>Create a JMS Message Producer</li>
-        <pre class="prettyprint">
-          <code>MessageProducer producer = session.createProducer(queue);</code>
-       </pre>
-       
-        <li>Create a Text Message</li>
-        <pre class="prettyprint">
-            <code>TextMessage message = session.createTextMessage("this is a text message");</code>
-        </pre>
-
-        <li>Send the Message</li>
-        <pre class="prettyprint">
-            <code>producer.send(message);</code>
-        </pre>
-        
-       <li>We commit the session to effectively send the message to the queue</li>
-        <pre class="prettyprint">
-            <code>session.commit();</code>
-        </pre>
-
-        <li>We create a JMS message consumer on the queue</li>
-        <pre class="prettyprint">
-            <code>MessageConsumer messageConsumer = session.createConsumer(queue);</code>
-        </pre>
-        
-        <li>We start the connection. In order for delivery to occur on any consumers or subscribers on a connection, the connection must be started</li>
-        <pre class="prettyprint">
-           <code>connection.start();</code>
-        </pre>
-        
-        <li>We receive the message...</li>
-        <pre class="prettyprint">
-            <code>TextMessage messageReceived = (TextMessage)messageConsumer.receive(5000);
-            System.out.println("1st delivery from " + queue.getQueueName() + ": " + messageReceived.getText());</code>            
-        </pre>
-        
-        <li>...but we roll back the session. the message returns to the queue, but only after a 
-            5 second delay</li>
-        <pre class="prettyprint">
-            <code>session.rollback();</code>
-        </pre>
-        
-        <li>We try to receive the message but it's being delayed</li>
-        <pre class="prettyprint">
-            <code>
-         messageReceived = (TextMessage)messageConsumer.receive(3000);
-         
-         if (messageReceived != null)
-         {
-            return false;
-         }
-         
-         System.out.println("Redelivery has been delayed so received message is " + messageReceived);
-            
-            </code>
-        </pre>
-  
-       <li>We try and receive the message again, this time we should get it</li>
-       <pre class="prettyprint">
-           <code>             
-         messageReceived = (TextMessage)messageConsumer.receive(3000);
-         
-         System.out.println("2nd delivery from " + queue.getQueueName() + ": " + messageReceived.getText());
-           </code>
-       </pre>
-              
-        <li>We rollback the session again to cause another redelivery, and we time how long this one takes</code>
-        <pre class="prettyprint">
-           <code>
-         long start = System.currentTimeMillis();
-         
-         session.rollback();
-                         
-         messageReceived = (TextMessage)messageConsumer.receive(8000);
-         
-         long end = System.currentTimeMillis();
-         
-         System.out.println("3nd delivery from " + queue.getQueueName() + ": " + messageReceived.getText() +
-                            " after " + (end - start) + " milliseconds.");           
-           </code>
-        </pre>
-        
-        <li>And finally, <b>always</b> remember to close your JMS connections and resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
-
-        <pre class="prettyprint">
-           <code>finally
-           {
-              if (initialContext != null)
-              {
-                initialContext.close();
-              }
-              if (connection != null)
-              {
-                 connection.close();
-              }
-           }</code>
-        </pre>
-     </ol>
-    
-     <h2>More information</h2>
-     
-     <ul>
-        <li>User Manual's <a href="../../../docs/user-manual/en/html_single/index.html#undelivered-messages">Undelivered Messages chapter</a></li>
-     </ul>
-    
+     </pre>
   </body>
 </html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/divert/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/divert/pom.xml b/examples/jms/divert/pom.xml
index 46dfbc6..4c912b2 100644
--- a/examples/jms/divert/pom.xml
+++ b/examples/jms/divert/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -26,8 +27,7 @@ under the License.
       <artifactId>jms-examples</artifactId>
       <version>1.0.1-SNAPSHOT</version>
    </parent>
-
-   <artifactId>artemis-jms-divert-example</artifactId>
+   <artifactId>divert</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS Divert Example</name>
 
@@ -42,114 +42,127 @@ under the License.
          <version>${project.version}</version>
       </dependency>
       <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
       </dependency>
    </dependencies>
 
    <profiles>
       <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <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>create1</id>
-                        <goals>
-                           <goal>create</goal>
-                        </goals>
-                        <configuration>
-                           <instance>${basedir}/target/server1</instance>
-                           <configuration>${basedir}/target/classes/activemq/server1</configuration>
-                        </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>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-divert-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
+         <!-- specify -PnoServer if you don't want to start the server -->
+         <id>noServer</id>
+         <properties>
+            <noServer>true</noServer>
+         </properties>
       </profile>
    </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create0</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <libList><arg>org.apache.activemq.examples.jms:divert:${project.version}</arg></libList>
+                     <instance>${basedir}/target/server0</instance>
+                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>create1</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <libList><arg>org.apache.activemq.examples.jms:divert:${project.version}</arg></libList>
+                     <instance>${basedir}/target/server1</instance>
+                     <configuration>${basedir}/target/classes/activemq/server1</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start0</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <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>
+                     <ignore>${noServer}</ignore>
+                     <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>
+                     <ignore>${noServer}</ignore>
+                     <location>${basedir}/target/server0</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop1</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <location>${basedir}/target/server1</location>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>divert</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/divert/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/divert/readme.html b/examples/jms/divert/readme.html
index 6a5707f..62067d6 100644
--- a/examples/jms/divert/readme.html
+++ b/examples/jms/divert/readme.html
@@ -26,6 +26,7 @@ under the License.
   </head>
   <body onload="prettyPrint()">
      <h1>Divert Example</h1>
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
 
      <p>ActiveMQ Artemis diverts allow messages to be transparently "diverted" from one address to another
      with just some simple configuration defined on the server side.</p>
@@ -114,325 +115,5 @@ under the License.
       &lt;/bridges&gt;
          </code>
      </pre>
-
-     <p><i>To run the example, simply type <code>mvn verify -Pexample</code> from this directory</i></p>
-
-     <ol>
-        <li>Create an initial context to perform the JNDI lookup on the London server</li>
-        <pre class="prettyprint">
-           <code>
-     initialContext0 = getContext(0);
-           </code>
-        </pre>
-
-        <li>Look-up the queue orderQueue on the London server - this is the queue any orders are sent to</li>
-        <pre class="prettyprint">
-           <code>
-     Queue queue = (Queue) initialContext.lookup("/queue/exampleQueue");
-           </code>
-        </pre>
-
-        <li>Look-up the topic priceUpdates on the London server- this is the topic that any price updates are sent to</li>
-        <pre class="prettyprint">
-           <code>
-     Topic priceUpdates = (Topic)initialContextLondon.lookup("/topic/priceUpdates");
-           </code>
-        </pre>
-
-        <li>Look-up the spy topic on the London server- this is what we will use to snoop on any orders</li>
-        <pre class="prettyprint">
-           <code>
-     Topic spyTopic = (Topic)initialContextLondon.lookup("/topic/spyTopic");
-           </code>
-        </pre>
-
-        <li>Create an initial context to perform the JNDI lookup on the New York server.</li>
-        <pre class="prettyprint">
-           <code>
-     initialContextNewYork = getContext(1);
-           </code>
-        </pre>
-
-        <li>Look-up the topic newYorkPriceUpdates on the New York server - any price updates sent to priceUpdates on the London server will
-         be diverted to the queue priceForward on the London server, and a bridge will consume from that queue and forward
-         them to the address newYorkPriceUpdates on the New York server where they will be distributed to the topic subscribers on
-         the New York server.
-        </li>
-        <pre class="prettyprint">
-          <code>
-     Topic newYorkPriceUpdates = (Topic)initialContextNewYork.lookup("/topic/newYorkPriceUpdates");
-          </code>
-       </pre>
-
-        <li>Perform a lookup on the Connection Factory on the London server</li>
-        <pre class="prettyprint">
-           <code>
-    ConnectionFactory cfLondon = (ConnectionFactory)initialContextLondon.lookup("/ConnectionFactory");
-           </code>
-        </pre>
-
-        <li>Perform a lookup on the Connection Factory on the New York server.</li>
-        <pre class="prettyprint">
-           <code>
-    ConnectionFactory cfNewYork = (ConnectionFactory)initialContextNewYork.lookup("/ConnectionFactory");
-           </code>
-        </pre>
-
-        <li>Create a JMS Connection on the London server</li>
-          <pre class="prettyprint">
-           <code>
-    connectionLondon = cfLondon.createConnection();
-           </code>
-        </pre>
-
-        <li>Create a JMS Connection on the New York server</li>
-          <pre class="prettyprint">
-           <code>
-    connectionNewYork = cfNewYork.createConnection();
-           </code>
-        </pre>
-
-        <li>Create a JMS Session on the London server.</li>
-        <pre class="prettyprint">
-           <code>
-    Session sessionLondon = connectionLondon.createSession(false, Session.AUTO_ACKNOWLEDGE);
-           </code>
-        </pre>
-
-        <li>Create a JMS Session on the New York server.</li>
-        <pre class="prettyprint">
-           <code>
-    Session sessionNewYork = connectionNewYork.createSession(false, Session.AUTO_ACKNOWLEDGE);
-           </code>
-        </pre>
-
-        <li>Create a JMS MessageProducer orderProducer that sends to the queue orderQueue on the London server.</li>
-        <pre class="prettyprint">
-           <code>
-    MessageProducer orderProducer = sessionLondon.createProducer(orderQueue);
-           /code>
-        </pre>
-
-        <li>Create a JMS MessageProducer priceProducer that sends to the topic priceUpdates on the London server.</li>
-        <pre class="prettyprint">
-           <code>
-    MessageProducer priceProducer = sessionLondon.createProducer(priceUpdates);
-           /code>
-        </pre>
-
-        <li>Create a JMS subscriber which subscribes to the spyTopic on the London server</li>
-        <pre class="prettyprint">
-           <code>
-    MessageConsumer spySubscriberA = sessionLondon.createConsumer(spyTopic);
-           </code>
-        </pre>
-
-        <li>Create another JMS subscriber which also subscribes to the spyTopic on the London server</li>
-        <pre class="prettyprint">
-           <code>
-    MessageConsumer spySubscriberB = sessionLondon.createConsumer(spyTopic);
-           </code>
-        </pre>
-
-        <li>Create a JMS MessageConsumer which consumes orders from the order queue on the London server</li>
-        <pre class="prettyprint">
-           <code>
-    MessageConsumer orderConsumer = sessionLondon.createConsumer(orderQueue);
-           </code>
-        </pre>
-
-        <li>Create a JMS subscriber which subscribes to the priceUpdates topic on the London server</li>
-        <pre class="prettyprint">
-           <code>
-    MessageConsumer priceUpdatesSubscriberLondon = sessionLondon.createConsumer(priceUpdates);
-           </code>
-        </pre>
-
-        <li>Create a JMS subscriber which subscribes to the newYorkPriceUpdates topic on the New York server</li>
-        <pre class="prettyprint">
-           <code>
-    MessageConsumer newYorkPriceUpdatesSubscriberA = sessionNewYork.createConsumer(newYorkPriceUpdates);
-           </code>
-        </pre>
-
-        <li>Create another JMS subscriber which also subscribes to the newYorkPriceUpdates topic on the New York server</li>
-        <pre class="prettyprint">
-           <code>
-    MessageConsumer newYorkPriceUpdatesSubscriberB = sessionNewYork.createConsumer(newYorkPriceUpdates);
-           </code>
-        </pre>
-
-        <li>Start the connections</li>
-        <pre class="prettyprint">
-           <code>
-    connectionLondon.start();
-
-    connectionNewYork.start();
-           </code>
-        </pre>
-
-        <li>Create an order message</li>
-        <pre class="prettyprint">
-           <code>
-    TextMessage orderMessage = sessionLondon.createTextMessage("This is an order");
-           </code>
-        </pre>
-
-        <li>Send the order message to the order queue on the London server</li>
-        <pre class="prettyprint">
-           <code>
-    orderProducer.send(orderMessage);
-
-    System.out.println("Sent message: " + orderMessage.getText());
-           </code>
-        </pre>
-
-        <li>The order message is consumed by the orderConsumer on the London server</li>
-        <pre class="prettyprint">
-           <code>
-    TextMessage receivedOrder = (TextMessage)orderConsumer.receive(5000);
-
-    System.out.println("Received order: " + receivedOrder.getText());
-           </code>
-        </pre>
-
-        <li>A copy of the order is also received by the spyTopic subscribers on the London server</li>
-        <pre class="prettyprint">
-           <code>
-    TextMessage spiedOrder1 = (TextMessage)spySubscriberA.receive(5000);
-
-    System.out.println("Snooped on order: " + spiedOrder1.getText());
-
-    TextMessage spiedOrder2 = (TextMessage)spySubscriberB.receive(5000);
-
-    System.out.println("Snooped on order: " + spiedOrder2.getText());
-           </code>
-        </pre>
-
-        <li>Create and send a price update message, destined for London</li>
-        <pre class="prettyprint">
-           <code>
-    TextMessage priceUpdateMessageLondon = sessionLondon.createTextMessage("This is a price update for London");
-
-    priceUpdateMessageLondon.setStringProperty("office", "London");
-
-    priceProducer.send(priceUpdateMessageLondon);
-           </code>
-        </pre>
-
-        <li>The price update *should* be received by the local subscriber since we only divert messages
-        where office = New York</li>
-        <pre class="prettyprint">
-           <code>
-    TextMessage receivedUpdate = (TextMessage)priceUpdatesSubscriberLondon.receive(2000);
-
-    System.out.println("Received price update locally: " + receivedUpdate.getText());
-           </code>
-        </pre>
-
-        <li>The price update *should not* be received in New York</li>
-        <pre class="prettyprint">
-           <code>
-    TextMessage priceUpdate1 = (TextMessage)newYorkPriceUpdatesSubscriberA.receive(1000);
-
-    if (priceUpdate1 != null)
-    {
-       return false;
-    }
-
-    System.out.println("Did not received price update in New York, look it's: " + priceUpdate1);
-
-    TextMessage priceUpdate2 = (TextMessage)newYorkPriceUpdatesSubscriberB.receive(1000);
-
-    if (priceUpdate2 != null)
-    {
-       return false;
-    }
-
-    System.out.println("Did not received price update in New York, look it's: " + priceUpdate2);
-           </code>
-        </pre>
-
-        <li>Create a price update message, destined for New York</li>
-        <pre class="prettyprint">
-           <code>
-    TextMessage priceUpdateMessageNewYork = sessionLondon.createTextMessage("This is a price update for New York");
-
-    priceUpdateMessageNewYork.setStringProperty("office", "New York");
-           </code>
-        </pre>
-
-        <li>Send the price update message to the priceUpdates topic on the London server</li>
-        <pre class="prettyprint">
-           <code>
-   priceProducer.send(priceUpdateMessageNewYork);
-           </code>
-        </pre>
-
-        <li>The price update *should not* be received by the local subscriber to the priceUpdates topic
-         since it has been *exclusively* diverted to the priceForward queue, because it has a header saying
-         it is destined for the New York office</li>
-        <pre class="prettyprint">
-           <code>
-   Message message = priceUpdatesSubscriberLondon.receive(1000);
-
-   if (message != null)
-   {
-      return false;
-   }
-
-   System.out.println("Didn't receive local price update, look, it's: " + message);
-           </code>
-        </pre>
-
-        <li>The remote subscribers on server 1 *should* receive a copy of the price update since
-        it has been diverted to a local priceForward queue which has a bridge consuming from it and which
-        forwards it to the same address on server 1.
-        We notice how the forwarded messages have had a special header added by our custom transformer that
-        we told the divert to use</li>
-        <pre class="prettyprint">
-           <code>
-   priceUpdate1 = (TextMessage)newYorkPriceUpdatesSubscriberA.receive(5000);
-
-   System.out.println("Received forwarded price update on server 1: " + priceUpdate1.getText());
-   System.out.println("Time of forward: " + priceUpdate1.getLongProperty("time_of_forward"));
-
-   priceUpdate2 = (TextMessage)newYorkPriceUpdatesSubscriberB.receive(5000);
-
-   System.out.println("Received forwarded price update on server 2: " + priceUpdate2.getText());
-   System.out.println("Time of forward: " + priceUpdate2.getLongProperty("time_of_forward"));
-           </code>
-        </pre>
-
-
-        <li>And finally, <b>always</b> remember to close your resources after use, in a <code>finally</code> block.</li>
-
-        <pre class="prettyprint">
-           <code>
-   finally
-   {
-      if (initialContextLondon != null)
-      {
-         initialContextLondon.close();
-      }
-      if (initialContextNewYork != null)
-      {
-         initialContextNewYork.close();
-      }
-      if (connectionLondon != null)
-      {
-         connectionLondon.close();
-      }
-      if (connectionNewYork != null)
-      {
-         connectionNewYork.close();
-      }
-   }
-           </code>
-        </pre>
-
-
-
-     </ol>
   </body>
 </html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/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 9cbaaa6..3d74c55 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
@@ -25,8 +25,9 @@ import javax.jms.Queue;
 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.api.jms.ActiveMQJMSClient;
+import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
 
 /**
  * This examples demonstrates the use of ActiveMQ Artemis "Diverts" to transparently divert or copy messages
@@ -41,37 +42,17 @@ public class DivertExample
       Connection connectionLondon = null;
 
       Connection connectionNewYork = null;
-
-      InitialContext initialContextLondon = null;
-
-      InitialContext initialContextNewYork = null;
       try
       {
-         // 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", "tcp://localhost:61616");
-         properties.put("queue.queue/orders", "orders");
-         properties.put("topic.topic/priceUpdates", "priceUpdates");
-         properties.put("topic.topic/spyTopic", "spyTopic");
-         initialContextLondon = new InitialContext(properties);
-
          // Step 2. Look-up the queue orderQueue on the London server - this is the queue any orders are sent to
-         Queue orderQueue = (Queue)initialContextLondon.lookup("queue/orders");
+         Queue orderQueue = ActiveMQJMSClient.createQueue("orders");
 
          // Step 3. Look-up the topic priceUpdates on the London server- this is the topic that any price updates are
          // sent to
-         Topic priceUpdates = (Topic)initialContextLondon.lookup("topic/priceUpdates");
+         Topic priceUpdates = ActiveMQJMSClient.createTopic("priceUpdates");
 
          // Step 4. Look-up the spy topic on the London server- this is what we will use to snoop on any orders
-         Topic spyTopic = (Topic)initialContextLondon.lookup("topic/spyTopic");
-
-         // 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.ConnectionFactory2", "tcp://localhost:61617");
-         properties.put("topic.topic/newYorkPriceUpdates", "newYorkPriceUpdates");
-         initialContextNewYork = new InitialContext(properties);
+         Topic spyTopic = ActiveMQJMSClient.createTopic("spyTopic");
 
          // Step 7. Look-up the topic newYorkPriceUpdates on the New York server - any price updates sent to
          // priceUpdates on the London server will
@@ -80,13 +61,13 @@ public class DivertExample
          // them to the address newYorkPriceUpdates on the New York server where they will be distributed to the topic
          // subscribers on
          // the New York server
-         Topic newYorkPriceUpdates = (Topic)initialContextNewYork.lookup("topic/newYorkPriceUpdates");
+         Topic newYorkPriceUpdates = ActiveMQJMSClient.createTopic("newYorkPriceUpdates");
 
          // Step 8. Perform a lookup on the Connection Factory on the London server
-         ConnectionFactory cfLondon = (ConnectionFactory)initialContextLondon.lookup("ConnectionFactory");
+         ConnectionFactory cfLondon = new ActiveMQConnectionFactory("tcp://localhost:61616");
 
          // Step 9. Perform a lookup on the Connection Factory on the New York server
-         ConnectionFactory cfNewYork = (ConnectionFactory)initialContextNewYork.lookup("ConnectionFactory2");
+         ConnectionFactory cfNewYork =  new ActiveMQConnectionFactory("tcp://localhost:61617");
 
          // Step 10. Create a JMS Connection on the London server
          connectionLondon = cfLondon.createConnection();
@@ -226,15 +207,6 @@ public class DivertExample
       }
       finally
       {
-         // Step 12. Be sure to close our resources!
-         if (initialContextLondon != null)
-         {
-            initialContextLondon.close();
-         }
-         if (initialContextNewYork != null)
-         {
-            initialContextNewYork.close();
-         }
          if (connectionLondon != null)
          {
             connectionLondon.close();

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/durable-subscription/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/durable-subscription/pom.xml b/examples/jms/durable-subscription/pom.xml
index 9571cd8..a87bf28 100644
--- a/examples/jms/durable-subscription/pom.xml
+++ b/examples/jms/durable-subscription/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-durable-subscription-example</artifactId>
+   <artifactId>durable-subscription</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS Durable Subscription Example</name>
 
@@ -37,71 +38,82 @@ under the License.
 
    <dependencies>
       <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
       </dependency>
    </dependencies>
 
    <profiles>
       <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>create</id>
-                        <goals>
-                           <goal>create</goal>
-                        </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.DurableSubscriptionExample</clientClass>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>cli</goal>
-                        </goals>
-                        <configuration>
-                           <args>
-                              <param>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-durable-subscription-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
+         <!-- specify -PnoServer if you don't want to start the server -->
+         <id>noServer</id>
+         <properties>
+            <noServer>true</noServer>
+         </properties>
       </profile>
    </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <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.DurableSubscriptionExample</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>durable-subscription</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/durable-subscription/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/durable-subscription/readme.html b/examples/jms/durable-subscription/readme.html
index 4379baa..def30b7 100644
--- a/examples/jms/durable-subscription/readme.html
+++ b/examples/jms/durable-subscription/readme.html
@@ -27,133 +27,13 @@ under the License.
   <body onload="prettyPrint()">
      <h1>JMS Durable Subscription Example</h1>
 
+     <pre>To run the example, simply type <b>mvn verify</b> from this directory, <br>or <b>mvn -PnoServer verify</b> if you want to start and create the server manually.</pre>
      <p>This example demonstrates how to use a durable subscription with ActiveMQ Artemis.</p>
      <p>Durable subscriptions are a standard part of JMS, please consult the JMS 1.1 specification for full details.</p>
      <p>Unlike non durable subscriptions, the key function of durable subscriptions is that the messages contained in them
          persist longer than the lifetime of the subscriber - i.e. they will accumulate messages sent to the topic even
-         if the subscriber is not currently connected. They will also survive server restarts. Note that for the messages to 
+         if the subscriber is not currently connected. They will also survive server restarts. Note that for the messages to
          be persisted, the messages sent to them must be marked as persistent messages.</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>
-
-     <ol>
-        <li>First we need to get an initial context so we can look-up the JMS connection factory and destination objects from JNDI. This initial context will get it's properties from the <code>client-jndi.properties</code> file in the directory <code>../common/config</code></li>
-        <pre class="prettyprint">
-           <code>initialContext = getContext();</code>
-        </pre>
-
-        <li>We look-up the JMS topic object from JNDI</li>
-        <pre class="prettyprint">
-           <code>Topic topic = (Topic) initialContext.lookup("/topic/exampleTopic");</code>
-        </pre>
-
-        <li>We look-up the JMS connection factory object from JNDI</li>
-        <pre class="prettyprint">
-           <code>ConnectionFactory cf = (ConnectionFactory) initialContext.lookup("/ConnectionFactory");</code>
-        </pre>
-
-        <li>We create a JMS connection</li>
-        <pre class="prettyprint">
-           <code>connection = cf.createConnection();</code>
-        </pre>
-         
-        <li>We set the client-id on the connection. This must be the <b>first operation</b> performed on the connection object.
-        The combination of client-id and durable subscription name uniquely identifies the durable subscription. Maybe different durable subscritions can have the same name if they belong to different client-id values</li>
-        <pre class="prettyprint">
-           <code>connection.setClientID("durable-client");</code>
-        </pre>
-         
-        <li>We start the connection. In order for delivery to occur on any consumers or subscribers on a connection, the connection must be started</li>
-        <pre class="prettyprint">
-           <code>connection.start();</code>
-        </pre>
-         
-        <li>We create a JMS session. The session is created as non transacted and will auto acknowledge messages.</li>
-        <pre class="prettyprint">
-           <code>Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);</code>
-        </pre>
-
-        <li>We create a JMS message producer on the session. This will be used to send the messages.</li>
-	<pre class="prettyprint">
-	   <code>MessageProducer messageProducer = session.createProducer(topic);</code>
-        </pre>
-
-        <li>We create the durable subscriber on the topic, specifying it's name. Since this is the first time the subscriber is created and a subscription with that name and for this client-id does not already exist, then the underlying durable subscription will be created, and a subscriber will be created and returned for that subscription.</li>
-	<pre class="prettyprint">
-           <code>TopicSubscriber subscriber = session.createDurableSubscriber(topic, "subscriber-1");</code>
-        </pre>
-         
-        <li>We create a JMS text message, message 1, that we are going to send. Note that it must be a persistent message in order to survive server restart.</li>
-        <pre class="prettyprint">
-           <code>TextMessage message1 = session.createTextMessage("This is a text message 1");</code>
-        </pre>
-   
-        <li>We send message 1 to the topic</li>
-        <pre class="prettyprint">
-           <code>messageProducer.send(message1);</code>
-        </pre>
-
-        <li>The message arrives in the subscription, and we consume the message from the subscription.</li>
-        <pre class="prettyprint">
-           <code>TextMessage messageReceived = (TextMessage)subscriber.receive();</code>
-        </pre>
-
-        <li>We create and send another text message, message 2, to the same topic</li>
-        <pre class="prettyprint">
-           <code>TextMessage message2 = session.createTextMessage("This is a text message 2");
-              
-           messageProducer.send(message2);</code>
-        </pre>
-         
-        <li>Now we close the subscriber. Since the subscription is durable it will continue to survive even though there is no subscriber attached to it. At this point you could even stop and restart the server and the subscription would survive!</li>
-
-        <pre class="prettyprint">
-           <code>subscriber.close();</code>
-        </pre>
-         
-        <li>We now create another durable subscriber, with the same name and same client-id on the same topic. Since the durable subscrition already exists, it will simply return a new subscriber consuming from the <i>same</i> durable subscription instance as before</li>
-
-        <pre class="prettyprint"> 
-           <code>subscriber = session.createDurableSubscriber(topic, "subscriber-1");</code>
-        </pre>
-         
-        <li>We consume message 2 which was sent before the first subscriber was closed.</li>
-
-        <pre class="prettyprint">
-           <code>messageReceived = (TextMessage)subscriber.receive();</code>
-        </pre>
-
-        <li>We close the second subscriber.</li>
-
-        <pre class="prettyprint">
-           <code>subscriber.close();</code>
-        </pre>
-
-        <li>Now we <i>delete</i> the underlying durable subscription. This will delete any remaining unacknowledged messages in the subscription and a new subscriber will not be able to access them</li>
-
-        <pre class="prettyprint">
-           <code>session.unsubscribe("subscriber-1");</code>
-        </pre>
-
-        <li>And finally, <b>always</b> remember to close your JMS connections and resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>
-
-        <pre class="prettyprint">
-           <code>finally
-           {
-              if (initialContext != null)
-              {
-                initialContext.close();
-              }
-              if (connection != null)
-              {
-                 connection.close();
-              }
-           }</code>
-        </pre>
-
-
-         
-     </ol>
   </body>
 </html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/embedded-simple/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/embedded-simple/pom.xml b/examples/jms/embedded-simple/pom.xml
index a1dae09..8b19033 100644
--- a/examples/jms/embedded-simple/pom.xml
+++ b/examples/jms/embedded-simple/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-embedded-simple-example</artifactId>
+   <artifactId>embedded-simple</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS Simple Embedded Example</name>
 
@@ -47,41 +48,37 @@ under the License.
          <version>${project.version}</version>
       </dependency>
       <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
       </dependency>
    </dependencies>
 
-   <profiles>
-      <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>runClient</id>
-                        <goals>
-                           <goal>runClient</goal>
-                        </goals>
-                        <configuration>
-                           <clientClass>org.apache.activemq.artemis.jms.example.EmbeddedExample</clientClass>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-embedded-simple-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
-      </profile>
-   </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>runClient</id>
+                  <goals>
+                     <goal>runClient</goal>
+                  </goals>
+                  <configuration>
+                     <clientClass>org.apache.activemq.artemis.jms.example.EmbeddedExample</clientClass>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>embedded-simple</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/embedded/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/embedded/pom.xml b/examples/jms/embedded/pom.xml
index 8d81f45..75d876c 100644
--- a/examples/jms/embedded/pom.xml
+++ b/examples/jms/embedded/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-embedded-example</artifactId>
+   <artifactId>embedded</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS Embedded Example</name>
 
@@ -47,41 +48,37 @@ under the License.
          <version>${project.version}</version>
       </dependency>
       <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
       </dependency>
    </dependencies>
 
-   <profiles>
-      <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>runClient</id>
-                        <goals>
-                           <goal>runClient</goal>
-                        </goals>
-                        <configuration>
-                           <clientClass>org.apache.activemq.artemis.jms.example.EmbeddedExample</clientClass>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-embedded-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
-      </profile>
-   </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>runClient</id>
+                  <goals>
+                     <goal>runClient</goal>
+                  </goals>
+                  <configuration>
+                     <clientClass>org.apache.activemq.artemis.jms.example.EmbeddedExample</clientClass>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>embedded</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/embedded/readme.html
----------------------------------------------------------------------
diff --git a/examples/jms/embedded/readme.html b/examples/jms/embedded/readme.html
index b64ea4c..b1bdd0f 100644
--- a/examples/jms/embedded/readme.html
+++ b/examples/jms/embedded/readme.html
@@ -26,78 +26,13 @@ under the License.
    </head>
    <body onload="prettyPrint()">
       <h1>Embedded JMS Server Example</h1>
-      
+      <pre>To run the example, simply type <b>mvn verify</b> from this directory</pre>
+
       <p>This examples shows how to setup and run an embedded JMS server using ActiveMQ Artemis.</p>
       <p>ActiveMQ Artemis was designed using POJOs (Plain Old Java Objects) which means embedding ActiveMQ Artemis in your own application
           is as simple as instantiating a few objects.</p>
-      <p>This example does not use any configuration files. The server is configured using POJOs and can be easily ported to any dependency injection framework.<br /> 
+      <p>This example does not use any configuration files. The server is configured using POJOs and can be easily ported to any dependency injection framework.<br />
          We will setup and run a full-fledged JMS server which binds its JMS resources to JNDI and can be accessed by remote clients.</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>
-
-      <ol>
-         <li>Create ActiveMQ Artemis core configuration, and set the properties accordingly</li>
-         <pre class="prettyprint">
-            <code>Configuration configuration = new ConfigurationImpl();
-            configuration.setPersistenceEnabled(false);
-            configuration.setSecurityEnabled(false);
-            configuration.getAcceptorConfigurations().add(new TransportConfiguration(NettyAcceptorFactory.class.getName()));</code>
-            Configuration configuration = new ConfigurationImpl();</pre>
-
-         <li>Create the ActiveMQ Artemis core server</li>
-         <pre class="prettyprint">
-            <code>ActiveMQServer activemqServer = ActiveMQ Artemis.newActiveMQServer(configuration);</code>
-         </pre>
-
-         <li>Create the JMS configuration</li>
-         <pre class="prettyprint">
-            <code>JMSConfiguration jmsConfig = new JMSConfigurationImpl();</code>
-         </pre>
-
-         <li>Configure the JMS ConnectionFactory</li>
-         <pre class="prettyprint">
-            <code>TransportConfiguration connectorConfig = new TransportConfiguration(NettyConnectorFactory.class.getName());
-            ConnectionFactoryConfiguration cfConfig = new ConnectionFactoryConfigurationImpl("cf", connectorConfig, "/cf");
-            jmsConfig.getConnectionFactoryConfigurations().add(cfConfig);</code>
-         </pre>
-         
-         <li>Configure the JMS Queue</li>
-         <pre class="prettyprint">
-            <code>QueueConfiguration queueConfig = new QueueConfigurationImpl("queue1", null, false, "/queue/queue1");
-            jmsConfig.getQueueConfigurations().add(queueConfig);</code>
-         </pre>
-     
-         <li>Start the JMS Server using the ActiveMQ Artemis core server and the JMS configuration</li>
-         <pre class="prettyprint">
-            <code>JMSServerManager jmsServer = new JMSServerManagerImpl(activemqServer, jmsConfig);
-            jmsServer.start();</code>
-         </pre>
 
-         <p>At this point the JMS server is started and any JMS clients can look up JMS resources from JNDI to send/receive 
-            messages from the server. To keep the example simple, we will send and receive a JMS message from the same JVM 
-            used to run the JMS server.</p>
-              
-         <li>Lookup JMS resources defined in the configuration </li>
-         <pre class="prettyprint">
-            <code>ConnectionFactory cf = (ConnectionFactory)context.lookup("/cf");
-            Queue queue = (Queue)context.lookup("/queue/queue1");</code>
-         </pre>
-         
-         <li>Send and receive a message using JMS API</li>
-         <p>See the <a href="../../queue/readme.html">Queue Example</a> for detailed steps to send and receive a JMS message</p>
-           
-         <p>Finally, we stop the JMS server and its associated resources.</p>
-        
-         <li>Stop the JMS server</li>
-         <pre class="prettyprint">
-            <code>jmsServer.stop();</code>
-         </pre>
-        
-         <li>Stop the JNDI server</li>
-         <pre class="prettyprint">
-            <code>naming.stop();</code>
-         </pre>
-      </ol>
    </body>
 </html>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd820318/examples/jms/expiry/pom.xml
----------------------------------------------------------------------
diff --git a/examples/jms/expiry/pom.xml b/examples/jms/expiry/pom.xml
index 9c53999..44c48e4 100644
--- a/examples/jms/expiry/pom.xml
+++ b/examples/jms/expiry/pom.xml
@@ -18,7 +18,8 @@ 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">
+<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>
@@ -27,7 +28,7 @@ under the License.
       <version>1.0.1-SNAPSHOT</version>
    </parent>
 
-   <artifactId>artemis-jms-expiry-example</artifactId>
+   <artifactId>expiry</artifactId>
    <packaging>jar</packaging>
    <name>ActiveMQ Artemis JMS Expiry Example</name>
 
@@ -37,71 +38,82 @@ under the License.
 
    <dependencies>
       <dependency>
-         <groupId>org.apache.geronimo.specs</groupId>
-         <artifactId>geronimo-jms_2.0_spec</artifactId>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>artemis-jms-client</artifactId>
+         <version>${project.version}</version>
       </dependency>
    </dependencies>
 
    <profiles>
       <profile>
-         <id>example</id>
-         <build>
-            <plugins>
-               <plugin>
-                  <groupId>org.apache.activemq</groupId>
-                  <artifactId>artemis-maven-plugin</artifactId>
-                  <executions>
-                     <execution>
-                        <id>create</id>
-                        <goals>
-                           <goal>create</goal>
-                        </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.ExpiryExample</clientClass>
-                        </configuration>
-                     </execution>
-                     <execution>
-                        <id>stop</id>
-                        <goals>
-                           <goal>cli</goal>
-                        </goals>
-                        <configuration>
-                           <args>
-                              <param>stop</param>
-                           </args>
-                        </configuration>
-                     </execution>
-                  </executions>
-                  <dependencies>
-                     <dependency>
-                        <groupId>org.apache.activemq.examples.jms</groupId>
-                        <artifactId>artemis-jms-expiry-example</artifactId>
-                        <version>${project.version}</version>
-                     </dependency>
-                  </dependencies>
-               </plugin>
-            </plugins>
-         </build>
+         <!-- specify -PnoServer if you don't want to start the server -->
+         <id>noServer</id>
+         <properties>
+            <noServer>true</noServer>
+         </properties>
       </profile>
    </profiles>
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>create</id>
+                  <goals>
+                     <goal>create</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <configuration>${basedir}/target/classes/activemq/server0</configuration>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>start</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <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.ExpiryExample</clientClass>
+                  </configuration>
+               </execution>
+               <execution>
+                  <id>stop</id>
+                  <goals>
+                     <goal>cli</goal>
+                  </goals>
+                  <configuration>
+                     <ignore>${noServer}</ignore>
+                     <args>
+                        <param>stop</param>
+                     </args>
+                  </configuration>
+               </execution>
+            </executions>
+            <dependencies>
+               <dependency>
+                  <groupId>org.apache.activemq.examples.jms</groupId>
+                  <artifactId>expiry</artifactId>
+                  <version>${project.version}</version>
+               </dependency>
+            </dependencies>
+         </plugin>
+      </plugins>
+   </build>
 
 </project>