Java 8 examples: add shade configuration for producing bundled/fat jar

This helps users who may need the fat jar to submit it to the cluster.


Project: http://git-wip-us.apache.org/repos/asf/beam/repo
Commit: http://git-wip-us.apache.org/repos/asf/beam/commit/90c8094d
Tree: http://git-wip-us.apache.org/repos/asf/beam/tree/90c8094d
Diff: http://git-wip-us.apache.org/repos/asf/beam/diff/90c8094d

Branch: refs/heads/master
Commit: 90c8094d883983f0006065169fd3ef230963e083
Parents: 630df6f
Author: Davor Bonaci <[email protected]>
Authored: Sun Mar 5 15:23:07 2017 -0800
Committer: Davor Bonaci <[email protected]>
Committed: Sun Mar 5 18:01:32 2017 -0800

----------------------------------------------------------------------
 .../main/resources/archetype-resources/pom.xml  | 32 ++++++++++++++++++++
 1 file changed, 32 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/beam/blob/90c8094d/sdks/java/maven-archetypes/examples-java8/src/main/resources/archetype-resources/pom.xml
----------------------------------------------------------------------
diff --git 
a/sdks/java/maven-archetypes/examples-java8/src/main/resources/archetype-resources/pom.xml
 
b/sdks/java/maven-archetypes/examples-java8/src/main/resources/archetype-resources/pom.xml
index f30a35f..3907fd5 100644
--- 
a/sdks/java/maven-archetypes/examples-java8/src/main/resources/archetype-resources/pom.xml
+++ 
b/sdks/java/maven-archetypes/examples-java8/src/main/resources/archetype-resources/pom.xml
@@ -73,6 +73,38 @@
           </dependency>
         </dependencies>
       </plugin>
+
+      <!--
+        Configures `mvn package` to produce a bundled jar ("fat jar") for 
runners
+        that require this for job submission to a cluster.
+      -->
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-shade-plugin</artifactId>
+        <version>2.4.1</version>
+        <executions>
+          <execution>
+            <phase>package</phase>
+            <goals>
+              <goal>shade</goal>
+            </goals>
+            <configuration>
+              
<finalName>${project.artifactId}-bundled-${project.version}</finalName>
+              <filters>
+                <filter>
+                  <artifact>*:*</artifact>
+                  <excludes>
+                    <exclude>META-INF/LICENSE</exclude>
+                    <exclude>META-INF/*.SF</exclude>
+                    <exclude>META-INF/*.DSA</exclude>
+                    <exclude>META-INF/*.RSA</exclude>
+                  </excludes>
+                </filter>
+              </filters>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
     </plugins>
 
     <pluginManagement>

Reply via email to