kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From granthe...@apache.org
Subject [1/3] kudu git commit: [build] Fix build jar verification
Date Sat, 25 Aug 2018 03:03:16 GMT
Repository: kudu
Updated Branches:
  refs/heads/master 264b5b20f -> be360bf01


[build] Fix build jar verification

- Adjusts the verify_jars.pl script to ignore jars in
build/jars path. This is where all the dependency jars
are staged for dist-tests. They are not included in the
distribution.

- Shades gson and scopt in kudu-backup and adjusts
verify_jars.pl to allow it to be relocated when shading.

- Adjust the  kudu-backup pom to relocate the
needed classes.

Change-Id: Ib3789b6ec379bf715499d1142576218ed7344258
Reviewed-on: http://gerrit.cloudera.org:8080/11318
Reviewed-by: Adar Dembo <adar@cloudera.com>
Tested-by: Grant Henke <granthenke@apache.org>


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

Branch: refs/heads/master
Commit: 245f0a7e0d412c9a820746987f64c034a710ef1e
Parents: 264b5b2
Author: Grant Henke <granthenke@apache.org>
Authored: Fri Aug 24 15:52:27 2018 -0500
Committer: Grant Henke <granthenke@apache.org>
Committed: Sat Aug 25 02:33:20 2018 +0000

----------------------------------------------------------------------
 build-support/verify_jars.pl | 11 +++++++----
 java/gradle/shadow.gradle    |  2 ++
 java/kudu-backup/pom.xml     | 37 +++++++++++++++++++++++++++++++++++++
 3 files changed, 46 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/245f0a7e/build-support/verify_jars.pl
----------------------------------------------------------------------
diff --git a/build-support/verify_jars.pl b/build-support/verify_jars.pl
index 45352a8..7b93ee3 100755
--- a/build-support/verify_jars.pl
+++ b/build-support/verify_jars.pl
@@ -34,8 +34,10 @@ my $pat_allow_non_java =
 # Allowed filenames of shaded dependencies in JARs.
 my $pat_allow_kudu_shaded =
     qr{^org/apache/kudu/shaded/
-        (?:org/jboss/netty|com/google/(?:common|protobuf|thirdparty/publicsuffix)|
-           com/sangupta/murmur)
+        (?:com/google/(?:common|gson|protobuf|thirdparty/publicsuffix)|
+           com/sangupta/murmur|
+           org/jboss/netty|
+           scopt)
       }x;
 
 # Allowed paths of unshaded Kudu dependencies in JARs.
@@ -44,9 +46,9 @@ my $pat_allow_kudu_unshaded = qr{^org/apache/kudu/.*};
 
 # Allowed paths of unshaded non-Kudu dependencies in JARs.
 my $pat_allow_nonkudu_unshaded = qr{^(?:com/databricks/spark/avro|
+                                        com/stumbleupon/async/|
                                         org/apache/parquet/|
-                                        org/apache/yetus/|
-                                        com/stumbleupon/async/)}x;
+                                        org/apache/yetus/)}x;
 
 if (scalar @ARGV != 1) {
   print STDERR "Usage: $0 <dest_dir>\n";
@@ -58,6 +60,7 @@ chdir($dest_dir) or die "cannot chdir to destination directory $dest_dir:
$!";
 print "Checking jars in directory: " . `pwd`;
 
 chomp(my @jars = `find . -type f -name \*.jar |
+                         grep -v build/jars |
                          grep -v tests\.jar |
                          grep -v tests-shaded\.jar |
                          grep -v original |

http://git-wip-us.apache.org/repos/asf/kudu/blob/245f0a7e/java/gradle/shadow.gradle
----------------------------------------------------------------------
diff --git a/java/gradle/shadow.gradle b/java/gradle/shadow.gradle
index 29e22ec..95a9b04 100644
--- a/java/gradle/shadow.gradle
+++ b/java/gradle/shadow.gradle
@@ -53,10 +53,12 @@ shadowJar {
 // location across all modules.
 shadowJar {
   relocate "com.google.common", "org.apache.kudu.shaded.com.google.common"
+  relocate "com.google.gson", "org.apache.kudu.shaded.com.google.gson"
   relocate "com.google.protobuf", "org.apache.kudu.shaded.com.google.protobuf"
   relocate "com.google.thirdparty", "org.apache.kudu.shaded.com.google.thirdparty"
   relocate "com.sangupta", "org.apache.kudu.shaded.com.sangupta"
   relocate "org.jboss.netty", "org.apache.kudu.shaded.org.jboss.netty"
+  relocate "scopt", "org.apache.kudu.shaded.scopt"
 }
 
 // ------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/kudu/blob/245f0a7e/java/kudu-backup/pom.xml
----------------------------------------------------------------------
diff --git a/java/kudu-backup/pom.xml b/java/kudu-backup/pom.xml
index 4200b5f..0cac985 100644
--- a/java/kudu-backup/pom.xml
+++ b/java/kudu-backup/pom.xml
@@ -184,6 +184,43 @@
                 </executions>
             </plugin>
             <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-shade-plugin</artifactId>
+                <version>${maven-shade-plugin.version}</version>
+                <configuration>
+                    <artifactSet>
+                        <includes>
+                            <include>com.google.guava:guava</include>
+                            <include>com.google.gson:protobuf-gson</include>
+                            <include>com.google.protobuf:protobuf-java</include>
+                            <include>com.google.protobuf:protobuf-java</include>
+                        </includes>
+                    </artifactSet>
+                    <relocations>
+                        <relocation>
+                            <pattern>com.google.common</pattern>
+                            <shadedPattern>org.apache.kudu.shaded.com.google.common</shadedPattern>
+                        </relocation>
+                        <relocation>
+                            <pattern>com.google.gson</pattern>
+                            <shadedPattern>org.apache.kudu.shaded.com.google.gson</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.github.scopt</pattern>
+                            <shadedPattern>org.apache.kudu.shaded.scopt</shadedPattern>
+                        </relocation>
+                    </relocations>
+                </configuration>
+            </plugin>
+            <plugin>
                 <groupId>net.alchim31.maven</groupId>
                 <artifactId>scala-maven-plugin</artifactId>
                 <version>${scala-maven-plugin.version}</version>


Mime
View raw message