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 <[email protected]> Authored: Wed Aug 5 15:33:20 2015 -0400 Committer: Clebert Suconic <[email protected]> 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>
