You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ja...@apache.org on 2019/12/04 16:36:12 UTC

[camel] branch master updated: Add FAQ entry how to create runnable JAR

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

janbednar 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 1913b85  Add FAQ entry how to create runnable JAR
1913b85 is described below

commit 1913b85b0729d9a49b412a46cbe1070504069738
Author: Jan Bednář <ma...@janbednar.eu>
AuthorDate: Wed Dec 4 17:29:33 2019 +0100

    Add FAQ entry how to create runnable JAR
---
 docs/user-manual/modules/ROOT/pages/faq.adoc       |  1 +
 .../pages/faq/how-to-create-executable-jar.adoc    | 33 ++++++++++++++++++++++
 2 files changed, 34 insertions(+)

diff --git a/docs/user-manual/modules/ROOT/pages/faq.adoc b/docs/user-manual/modules/ROOT/pages/faq.adoc
index 7cbc56c..afc9056 100644
--- a/docs/user-manual/modules/ROOT/pages/faq.adoc
+++ b/docs/user-manual/modules/ROOT/pages/faq.adoc
@@ -97,6 +97,7 @@ Questions on using Apache Camel
 * xref:faq/how-should-i-package-applications-using-camel-and-activemq.adoc[How should I package applications using Camel and ActiveMQ?]
 * xref:faq/how-to-avoid-importing-bunch-of-cxf-packages-when-start-up-the-camel-cxf-endpoint-from-osgi-platform-.adoc[How to avoid importing bunch of cxf packages when start up the camel-cxf endpoint from OSGi platform?]
 * xref:faq/how-to-avoid-sending-some-or-all-message-headers.adoc[How to avoid sending some or all message headers?]
+* xref:faq/how-to-create-executable-jar.adoc[How to create executable JAR?]
 * xref:faq/how-to-define-a-static-camel-converter-method-in-scala.adoc[How to define a static Camel converter method in Scala?]
 * xref:faq/how-to-remove-the-http-protocol-headers-in-the-camel-message.adoc[How to remove the http protocol headers in the camel message?]
 * xref:faq/how-to-send-the-same-message-to-multiple-endpoints.adoc[How to send the same message to multiple endpoints?]
diff --git a/docs/user-manual/modules/ROOT/pages/faq/how-to-create-executable-jar.adoc b/docs/user-manual/modules/ROOT/pages/faq/how-to-create-executable-jar.adoc
new file mode 100644
index 0000000..50f447c
--- /dev/null
+++ b/docs/user-manual/modules/ROOT/pages/faq/how-to-create-executable-jar.adoc
@@ -0,0 +1,33 @@
+[[HowtocreateexecutableJAR-HowtocreateexecutableJAR]]
+= How to create executable JAR
+
+You need to use `maven-shade-plugin` to create executable JAR.
+
+[source]
+----
+<plugin>
+    <groupId>org.apache.maven.plugins</groupId>
+    <artifactId>maven-shade-plugin</artifactId>
+    <version>3.2.1</version>
+    <executions>
+        <execution>
+            <phase>package</phase>
+            <goals>
+                <goal>shade</goal>
+            </goals>
+            <configuration>
+                <shadedArtifactAttached>true</shadedArtifactAttached>
+                <shadedClassifierName>executable-jar</shadedClassifierName>
+                <transformers>
+                    <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
+                        <mainClass>my.package.MainClass</mainClass>
+                    </transformer>
+                    <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
+                        <resource>META-INF/services/org/apache/camel/TypeConverterLoader</resource>
+                    </transformer>
+                </transformers>
+            </configuration>
+        </execution>
+    </executions>
+</plugin>
+----