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

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-examples.git

commit 343d00306f585a71fd3e132cb5ff9dcb19239be1
Author: Claus Ibsen <[email protected]>
AuthorDate: Thu May 20 13:24:37 2021 +0200

    Let add fat-jar to this example
---
 examples/kamelet-yaml/README.adoc |  9 +++++++++
 examples/kamelet-yaml/pom.xml     | 35 ++++++++++++++++++++++++++++++++++-
 2 files changed, 43 insertions(+), 1 deletion(-)

diff --git a/examples/kamelet-yaml/README.adoc 
b/examples/kamelet-yaml/README.adoc
index b018f7e..1767566 100644
--- a/examples/kamelet-yaml/README.adoc
+++ b/examples/kamelet-yaml/README.adoc
@@ -33,6 +33,15 @@ You can run this example using
 $ mvn camel:run
 ----
 
+The application is also built as a _fat jar_ (see `pom.xml`), which you can 
run with
+
+[source,sh]
+----
+$ mvn package
+$ java -jar target/camel-example-kamelet-yaml-3.11.0-jar-with-dependencies.jar
+----
+
+
 === Help and contributions
 
 If you hit any problem using Camel or have some feedback, then please
diff --git a/examples/kamelet-yaml/pom.xml b/examples/kamelet-yaml/pom.xml
index 3fc7a4b..36fe0ae 100644
--- a/examples/kamelet-yaml/pom.xml
+++ b/examples/kamelet-yaml/pom.xml
@@ -17,7 +17,8 @@
     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>
 
@@ -120,6 +121,38 @@
                     <logClasspath>false</logClasspath>
                     <mainClass>org.apache.camel.main.Main</mainClass>
                 </configuration>
+                <executions>
+                    <execution>
+                        <goals>
+                            <!-- to be able to make a fat-jar via the 
maven-assembly-plugin -->
+                            <goal>prepare-fatjar</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <!-- build a fat-jar -->
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-assembly-plugin</artifactId>
+                <configuration>
+                    <descriptorRefs>
+                        <descriptorRef>jar-with-dependencies</descriptorRef>
+                    </descriptorRefs>
+                    <archive>
+                        <manifest>
+                            <mainClass>org.apache.camel.main.Main</mainClass>
+                        </manifest>
+                    </archive>
+                </configuration>
+                <executions>
+                    <execution>
+                        <id>make-assembly</id>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>single</goal>
+                        </goals>
+                    </execution>
+                </executions>
             </plugin>
         </plugins>
     </build>

Reply via email to