kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danburk...@apache.org
Subject kudu git commit: [java] Ensure the shaded packages are always in the same location
Date Tue, 27 Jun 2017 18:19:34 GMT
Repository: kudu
Updated Branches:
  refs/heads/master a85b294fb -> 5a258508f


[java] Ensure the shaded packages are always in the same location

Currently when a module depends on kudu-clients and is
shaded it is possible to get bloat in the jar due to
dependencies like guava being included in the shaded
jar twice.

This moves the shade plugin and relocation configuration
to the parent pom's pluginManagement section to ensure the
same packages are always placed in the same location.

For example this reduces the kudu-client-tools jar
from 13.4 MB to 8.5 MB.

Note: The relocation target is changed from
org.apache.kudu.clients.shaded to
org.apache.kudu.shaded since the shading is not specific to
the clients anymore.

Change-Id: I3b519ae75a62ed9bdbf37b7132a43392dd9082db
Reviewed-on: http://gerrit.cloudera.org:8080/7305
Tested-by: Kudu Jenkins
Reviewed-by: Dan Burkert <danburkert@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/5a258508
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/5a258508
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/5a258508

Branch: refs/heads/master
Commit: 5a258508f8d560f630512c237711a65cd137c6b3
Parents: a85b294
Author: Grant Henke <granthenke@gmail.com>
Authored: Tue Jun 27 11:23:34 2017 -0500
Committer: Dan Burkert <danburkert@apache.org>
Committed: Tue Jun 27 18:19:09 2017 +0000

----------------------------------------------------------------------
 java/kudu-client-tools/pom.xml |  8 --------
 java/kudu-client/pom.xml       | 31 ------------------------------
 java/kudu-flume-sink/pom.xml   |  9 ---------
 java/kudu-spark-tools/pom.xml  |  8 --------
 java/kudu-spark/pom.xml        |  8 --------
 java/pom.xml                   | 38 +++++++++++++++++++++++++++++++++++++
 6 files changed, 38 insertions(+), 64 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/5a258508/java/kudu-client-tools/pom.xml
----------------------------------------------------------------------
diff --git a/java/kudu-client-tools/pom.xml b/java/kudu-client-tools/pom.xml
index 7097d86..d4908fa 100644
--- a/java/kudu-client-tools/pom.xml
+++ b/java/kudu-client-tools/pom.xml
@@ -106,14 +106,6 @@
                         </includes>
                     </artifactSet>
                 </configuration>
-                <executions>
-                    <execution>
-                        <phase>package</phase>
-                        <goals>
-                            <goal>shade</goal>
-                        </goals>
-                    </execution>
-                </executions>
             </plugin>
         </plugins>
     </build>

http://git-wip-us.apache.org/repos/asf/kudu/blob/5a258508/java/kudu-client/pom.xml
----------------------------------------------------------------------
diff --git a/java/kudu-client/pom.xml b/java/kudu-client/pom.xml
index 175392c..fbbdc15 100644
--- a/java/kudu-client/pom.xml
+++ b/java/kudu-client/pom.xml
@@ -162,38 +162,7 @@
                     <include>io.netty:netty</include>
                   </includes>
                 </artifactSet>
-                <relocations>
-                  <relocation>
-                    <pattern>com.google.common</pattern>
-                    <shadedPattern>org.apache.kudu.client.shaded.com.google.common</shadedPattern>
-                  </relocation>
-                  <relocation>
-                    <pattern>com.google.protobuf</pattern>
-                    <shadedPattern>org.apache.kudu.client.shaded.com.google.protobuf</shadedPattern>
-                  </relocation>
-                  <relocation>
-                    <pattern>com.google.thirdparty</pattern>
-                    <shadedPattern>org.apache.kudu.client.shaded.com.google.thirdparty</shadedPattern>
-                  </relocation>
-                  <relocation>
-                    <pattern>com.sangupta</pattern>
-                    <shadedPattern>org.apache.kudu.client.shaded.com.sangupta</shadedPattern>
-                  </relocation>
-                  <relocation>
-                    <pattern>org.jboss.netty</pattern>
-                    <shadedPattern>org.apache.kudu.client.shaded.org.jboss.netty</shadedPattern>
-                  </relocation>
-                </relocations>
-                <shadeTestJar>true</shadeTestJar>
               </configuration>
-              <executions>
-                <execution>
-                  <phase>package</phase>
-                  <goals>
-                    <goal>shade</goal>
-                  </goals>
-                </execution>
-              </executions>
             </plugin>
             <!-- Attach source and javadoc to packaged jar -->
             <plugin>

http://git-wip-us.apache.org/repos/asf/kudu/blob/5a258508/java/kudu-flume-sink/pom.xml
----------------------------------------------------------------------
diff --git a/java/kudu-flume-sink/pom.xml b/java/kudu-flume-sink/pom.xml
index ce6ce68..3b47adc 100644
--- a/java/kudu-flume-sink/pom.xml
+++ b/java/kudu-flume-sink/pom.xml
@@ -38,16 +38,7 @@
               <include>org.apache.kudu:kudu-client</include>
             </includes>
           </artifactSet>
-          <shadeTestJar>true</shadeTestJar>
         </configuration>
-        <executions>
-          <execution>
-            <phase>package</phase>
-            <goals>
-              <goal>shade</goal>
-            </goals>
-          </execution>
-        </executions>
       </plugin>
       <plugin>
         <groupId>org.apache.avro</groupId>

http://git-wip-us.apache.org/repos/asf/kudu/blob/5a258508/java/kudu-spark-tools/pom.xml
----------------------------------------------------------------------
diff --git a/java/kudu-spark-tools/pom.xml b/java/kudu-spark-tools/pom.xml
index c73a9f9..1146a98 100644
--- a/java/kudu-spark-tools/pom.xml
+++ b/java/kudu-spark-tools/pom.xml
@@ -168,14 +168,6 @@
                         </includes>
                     </artifactSet>
                 </configuration>
-                <executions>
-                    <execution>
-                        <phase>package</phase>
-                        <goals>
-                            <goal>shade</goal>
-                        </goals>
-                    </execution>
-                </executions>
             </plugin>
         </plugins>
     </build>

http://git-wip-us.apache.org/repos/asf/kudu/blob/5a258508/java/kudu-spark/pom.xml
----------------------------------------------------------------------
diff --git a/java/kudu-spark/pom.xml b/java/kudu-spark/pom.xml
index c1ea0c9..a086074 100644
--- a/java/kudu-spark/pom.xml
+++ b/java/kudu-spark/pom.xml
@@ -137,14 +137,6 @@
                         </includes>
                     </artifactSet>
                 </configuration>
-                <executions>
-                    <execution>
-                        <phase>package</phase>
-                        <goals>
-                            <goal>shade</goal>
-                        </goals>
-                    </execution>
-                </executions>
             </plugin>
 
             <!-- http://stackoverflow.com/questions/270445 -->

http://git-wip-us.apache.org/repos/asf/kudu/blob/5a258508/java/pom.xml
----------------------------------------------------------------------
diff --git a/java/pom.xml b/java/pom.xml
index c38f7d1..00dd8bf 100644
--- a/java/pom.xml
+++ b/java/pom.xml
@@ -141,6 +141,44 @@
                         <argLine>${testArgLine}</argLine>
                     </configuration>
                 </plugin>
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-shade-plugin</artifactId>
+                    <version>${maven-shade-plugin.version}</version>
+                    <configuration>
+                        <relocations>
+                            <relocation>
+                                <pattern>com.google.common</pattern>
+                                <shadedPattern>org.apache.kudu.shaded.com.google.common</shadedPattern>
+                            </relocation>
+                            <relocation>
+                                <pattern>com.google.protobuf</pattern>
+                                <shadedPattern>org.apache.kudu.shaded.com.google.protobuf</shadedPattern>
+                            </relocation>
+                            <relocation>
+                                <pattern>com.google.thirdparty</pattern>
+                                <shadedPattern>org.apache.kudu.shaded.com.google.thirdparty</shadedPattern>
+                            </relocation>
+                            <relocation>
+                                <pattern>com.sangupta</pattern>
+                                <shadedPattern>org.apache.kudu.shaded.com.sangupta</shadedPattern>
+                            </relocation>
+                            <relocation>
+                                <pattern>org.jboss.netty</pattern>
+                                <shadedPattern>org.apache.kudu.shaded.org.jboss.netty</shadedPattern>
+                            </relocation>
+                        </relocations>
+                        <shadeTestJar>true</shadeTestJar>
+                    </configuration>
+                    <executions>
+                        <execution>
+                            <phase>package</phase>
+                            <goals>
+                                <goal>shade</goal>
+                            </goals>
+                        </execution>
+                    </executions>
+                </plugin>
             </plugins>
         </pluginManagement>
 


Mime
View raw message