This is an automated email from the ASF dual-hosted git repository.

dmvolod pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
     new c0ff167  CAMEL-12634: Automate Artmemis download and config for 
camel-example-artemis-*
c0ff167 is described below

commit c0ff167ca77335c919016ca9bbdbab8e520d93b3
Author: Dmitry Volodin <[email protected]>
AuthorDate: Tue Jul 10 19:24:21 2018 +0300

    CAMEL-12634: Automate Artmemis download and config for
    camel-example-artemis-*
---
 .../camel-example-artemis-amqp-blueprint/README.md | 17 +++----
 .../camel-example-artemis-amqp-blueprint/pom.xml   | 57 ++++++++++++++++++++--
 .../example/artemis/amqp/ArtemisAmqpIntTest.java   |  3 +-
 .../camel-example-artemis-large-messages/README.md | 17 +++----
 .../camel-example-artemis-large-messages/pom.xml   | 56 ++++++++++++++++++++-
 5 files changed, 125 insertions(+), 25 deletions(-)

diff --git a/examples/camel-example-artemis-amqp-blueprint/README.md 
b/examples/camel-example-artemis-amqp-blueprint/README.md
index 84c65be..e97d788 100644
--- a/examples/camel-example-artemis-amqp-blueprint/README.md
+++ b/examples/camel-example-artemis-amqp-blueprint/README.md
@@ -16,22 +16,19 @@ The JUnit with an included embedded Artemis Broker can be 
triggered using Maven.
 
 ### Install ActiveMQ Artemis
 
-You download and unzip Apache ActiveMQ Artemis from: 
http://activemq.apache.org/artemis/download.html
+To automate downloading, unpacking and configuration of Apache ActiveMQ 
Artemis with latest defined version a special profile is added.
+It's necessary to run following Maven command for do this during example 
install:
 
-After unzipping the download, you can then create a new broker with the name 
`mybroker`:
-
-    $ cd apache-artemis-2.6.0 
-    $ bin/artemis create mybroker
+    mvn install -P artemis
 
 ### Run ActiveMQ Artemis
 
-You start ActiveMQ in a shell by running:
+To start configured ActiveMQ Artemis instance in a shell use:
 
-    $ cd mybroker
-    $ bin/artemis run
+    $ target/artemis-instance/bin/artemis run
 
-Which startup Artemis in the foreground and keeps it running until you hit 
<kbd>ctrl</kbd>+<kbd>c</kbd>
-to shutdown Artemis.
+Which startup ActiveMQ Artemis in the foreground and keeps it running until 
you hit <kbd>ctrl</kbd>+<kbd>c</kbd>
+to shutdown ActiveMQ Artemis.
 
 ### Run Camel
 
diff --git a/examples/camel-example-artemis-amqp-blueprint/pom.xml 
b/examples/camel-example-artemis-amqp-blueprint/pom.xml
index 2eb922b..efcf8c2 100644
--- a/examples/camel-example-artemis-amqp-blueprint/pom.xml
+++ b/examples/camel-example-artemis-amqp-blueprint/pom.xml
@@ -118,10 +118,9 @@
     </dependency>
 
   </dependencies>
-
+  
   <build>
     <plugins>
-
       <!-- to generate the MANIFEST-FILE of the bundle -->
       <plugin>
         <groupId>org.apache.felix</groupId>
@@ -173,8 +172,8 @@
     </plugins>
   </build>
 
-  <!-- to run the test you need to enable this profile:  mvn test -P itest -->
   <profiles>
+    <!-- to run the test you need to enable this profile:  mvn test -P itest 
-->
     <profile>
       <id>itest</id>
       <build>
@@ -193,6 +192,58 @@
         </plugins>
       </build>
     </profile>
+    
+    <profile>
+      <id>artemis</id>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-dependency-plugin</artifactId>
+            <executions>
+              <execution>
+                <id>download-artemis-broker</id>
+                <goals>
+                  <goal>unpack</goal>
+                </goals>
+                <configuration>
+                  <artifactItems>
+                    <artifactItem>
+                      <groupId>org.apache.activemq</groupId>
+                      <artifactId>apache-artemis</artifactId>
+                      <version>${activemq-artemis-version}</version>
+                      <classifier>bin</classifier>
+                      <type>zip</type>
+                      <overWrite>false</overWrite>
+                      
<outputDirectory>${project.build.directory}/</outputDirectory>
+                    </artifactItem>
+                  </artifactItems>
+                  <overWriteReleases>false</overWriteReleases>
+                  <overWriteSnapshots>true</overWriteSnapshots>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+          <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <version>${activemq-artemis-version}</version>
+            <executions>
+              <execution>
+                <id>create</id>
+                <goals>
+                  <goal>create</goal>
+                </goals>
+                <configuration>
+                  
<home>${project.build.directory}/apache-artemis-${activemq-artemis-version}</home>
+                  
<instance>${project.build.directory}/artemis-instance</instance>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
   </profiles>
 
 </project>
diff --git 
a/examples/camel-example-artemis-amqp-blueprint/src/test/java/org/apache/camel/example/artemis/amqp/ArtemisAmqpIntTest.java
 
b/examples/camel-example-artemis-amqp-blueprint/src/test/java/org/apache/camel/example/artemis/amqp/ArtemisAmqpIntTest.java
index f65d69c..5ce3ea7 100644
--- 
a/examples/camel-example-artemis-amqp-blueprint/src/test/java/org/apache/camel/example/artemis/amqp/ArtemisAmqpIntTest.java
+++ 
b/examples/camel-example-artemis-amqp-blueprint/src/test/java/org/apache/camel/example/artemis/amqp/ArtemisAmqpIntTest.java
@@ -33,12 +33,13 @@ public class ArtemisAmqpIntTest extends 
CamelBlueprintTestSupport {
     }
 
     @Override
+    @SuppressWarnings({"unchecked", "rawtypes"})
     protected String useOverridePropertiesWithConfigAdmin(Dictionary props) { 
         //obtain an available port
         int port = AvailablePortFinder.getNextAvailable(9090);
 
         if (port != 9090) {
-            //override the netty port to use
+            //override the Netty port to use
             props.put("netty.port", "" + port);
 
             //return the PID of the config-admin we are using in the blueprint 
xml file
diff --git a/examples/camel-example-artemis-large-messages/README.md 
b/examples/camel-example-artemis-large-messages/README.md
index 6542746..2b27b94 100644
--- a/examples/camel-example-artemis-large-messages/README.md
+++ b/examples/camel-example-artemis-large-messages/README.md
@@ -21,22 +21,19 @@ First compile the example by entering:
 
 ### Install ActiveMQ Artemis
 
-You download and unzip Apache ActiveMQ Artemis from: 
http://activemq.apache.org/artemis/download.html
+To automate downloading, unpacking and configuration of Apache ActiveMQ 
Artemis with latest defined version a special profile is added.
+It's necessary to run following Maven command for do this during example 
install:
 
-After unzipping the download, you can then create a new broker with the name 
`mybroker`:
-
-    $ cd apache-artemis-2.4.0 
-    $ bin/artemis create mybroker
+    mvn install -P artemis
 
 ### Run ActiveMQ Artemis
 
-You start ActiveMQ in a shell by running:
+To start configured ActiveMQ Artemis instance in a shell use:
 
-    $ cd mybroker
-    $ bin/artemis run
+    $ target/artemis-instance/bin/artemis run
 
-Which startup Artemis in the foreground and keeps it running until you hit 
<kbd>ctrl</kbd>+<kbd>c</kbd>
-to shutdown Artemis.
+Which startup ActiveMQ Artemis in the foreground and keeps it running until 
you hit <kbd>ctrl</kbd>+<kbd>c</kbd>
+to shutdown ActiveMQ Artemis.
 
 ### Run Camel
 
diff --git a/examples/camel-example-artemis-large-messages/pom.xml 
b/examples/camel-example-artemis-large-messages/pom.xml
index 46a12f4..9c86fcb 100644
--- a/examples/camel-example-artemis-large-messages/pom.xml
+++ b/examples/camel-example-artemis-large-messages/pom.xml
@@ -86,5 +86,59 @@
       </plugin>
     </plugins>
   </build>
-
+  
+  <profiles>
+    <profile>
+      <id>artemis</id>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-dependency-plugin</artifactId>
+            <executions>
+              <execution>
+                <id>download-artemis-broker</id>
+                <goals>
+                  <goal>unpack</goal>
+                </goals>
+                <configuration>
+                  <artifactItems>
+                    <artifactItem>
+                      <groupId>org.apache.activemq</groupId>
+                      <artifactId>apache-artemis</artifactId>
+                      <version>${activemq-artemis-version}</version>
+                      <classifier>bin</classifier>
+                      <type>zip</type>
+                      <overWrite>false</overWrite>
+                      
<outputDirectory>${project.build.directory}/</outputDirectory>
+                    </artifactItem>
+                  </artifactItems>
+                  <overWriteReleases>false</overWriteReleases>
+                  <overWriteSnapshots>true</overWriteSnapshots>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+          <plugin>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>artemis-maven-plugin</artifactId>
+            <version>${activemq-artemis-version}</version>
+            <executions>
+              <execution>
+                <id>create</id>
+                <goals>
+                  <goal>create</goal>
+                </goals>
+                <configuration>
+                  
<home>${project.build.directory}/apache-artemis-${activemq-artemis-version}</home>
+                  
<instance>${project.build.directory}/artemis-instance</instance>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+  </profiles>
+  
 </project>

Reply via email to