kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From granthe...@apache.org
Subject kudu git commit: [Java] Fix Guava transitive dependecies
Date Mon, 23 Apr 2018 16:27:44 GMT
Repository: kudu
Updated Branches:
  refs/heads/master 3a801d104 -> 650e39e23


[Java] Fix Guava transitive dependecies

In Guava 22.0+ the annotations dependencies are no
longer marked as optional. However, if the annotations
are not used at runtime or compile time they are
actually not required.

- Excludes the transitive annotations libraries that are
   not marked as optional in version 22.0+
- Adds Guava where it was used directly but not in the
   dependencies

Change-Id: I8f1f6e762629c1dea30589a1ade1f3da6de6ad3d
Reviewed-on: http://gerrit.cloudera.org:8080/10096
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/650e39e2
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/650e39e2
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/650e39e2

Branch: refs/heads/master
Commit: 650e39e234142c69d4ff7adc56ad6359b790741b
Parents: 3a801d1
Author: Grant Henke <granthenke@apache.org>
Authored: Mon Apr 16 10:45:19 2018 -0500
Committer: Grant Henke <granthenke@apache.org>
Committed: Mon Apr 23 16:18:47 2018 +0000

----------------------------------------------------------------------
 java/build.gradle                   | 11 +++++++++++
 java/kudu-client-tools/build.gradle |  8 +++++---
 java/kudu-client-tools/pom.xml      | 25 +++++++++++++++++++++++++
 java/kudu-client/pom.xml            |  8 ++++++++
 java/kudu-flume-sink/build.gradle   |  1 +
 java/kudu-flume-sink/pom.xml        |  6 ++++++
 java/kudu-mapreduce/build.gradle    |  1 +
 java/kudu-mapreduce/pom.xml         | 14 ++++++++++++++
 8 files changed, 71 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/650e39e2/java/build.gradle
----------------------------------------------------------------------
diff --git a/java/build.gradle b/java/build.gradle
index 30c3cd6..a64e4a1 100755
--- a/java/build.gradle
+++ b/java/build.gradle
@@ -48,6 +48,17 @@ subprojects {
   apply from: "$rootDir/gradle/quality.gradle"
   apply from: "$rootDir/gradle/artifacts.gradle"
   apply from: "$rootDir/gradle/publishing.gradle"
+
+  // Ignore the transitive annotations libraries that are
+  // not marked as optional in Guava version 22.0+.
+  // See https://github.com/google/guava/issues/2824
+  configurations.compile {
+    exclude group: "com.google.errorprone", module: "error_prone_annotations"
+    exclude group: "com.google.code.findbugs", module: "jsr305"
+    exclude group: "com.google.j2objc", module: "j2objc-annotations"
+    exclude group: "org.checkerframework", module: "checker-compat-qual"
+    exclude group: "org.codehaus.mojo", module: "animal-sniffer-annotations"
+  }
 }
 
 task javadocAggregate(type: Javadoc, group: "Documentation") {

http://git-wip-us.apache.org/repos/asf/kudu/blob/650e39e2/java/kudu-client-tools/build.gradle
----------------------------------------------------------------------
diff --git a/java/kudu-client-tools/build.gradle b/java/kudu-client-tools/build.gradle
index fb07600..9cb53c2 100644
--- a/java/kudu-client-tools/build.gradle
+++ b/java/kudu-client-tools/build.gradle
@@ -19,15 +19,17 @@ apply from: "$rootDir/gradle/shadow.gradle"
 
 dependencies {
   compile project(":kudu-mapreduce")
+  compile libs.guava
+  compile libs.slf4jApi
+
   // This artifact is in compile scope for convenience, as it is typically
   // not included in the job classpath by MapReduce platform providers.
   compile libs.parquetHadoop
-  compile libs.slf4jApi
-
-  optional libs.yetusAnnotations
 
   provided libs.hadoopClient
 
+  optional libs.yetusAnnotations
+
   testCompile project(path: ":kudu-client", configuration: "shadowTest")
   testCompile project(path: ":kudu-mapreduce", configuration: "test")
   testCompile libs.junit

http://git-wip-us.apache.org/repos/asf/kudu/blob/650e39e2/java/kudu-client-tools/pom.xml
----------------------------------------------------------------------
diff --git a/java/kudu-client-tools/pom.xml b/java/kudu-client-tools/pom.xml
index b363e49..1c768de 100644
--- a/java/kudu-client-tools/pom.xml
+++ b/java/kudu-client-tools/pom.xml
@@ -36,6 +36,20 @@
             <artifactId>kudu-mapreduce</artifactId>
             <version>${project.version}</version>
         </dependency>
+
+        <dependency>
+            <groupId>com.google.guava</groupId>
+            <artifactId>guava</artifactId>
+            <version>${guava.version}</version>
+            <exclusions>
+                <!-- Ignore the transitive annotations libraries that are -->
+                <!-- not marked as optional in version 22.0+ -->
+                <exclusion>
+                    <groupId>*</groupId>
+                    <artifactId>*</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
         <dependency>
             <groupId>org.slf4j</groupId>
             <artifactId>slf4j-api</artifactId>
@@ -112,11 +126,22 @@
                 <configuration>
                     <artifactSet>
                         <includes>
+                            <include>com.google.guava:guava</include>
                             <include>org.apache.kudu:kudu-client</include>
                             <include>org.apache.kudu:kudu-mapreduce</include>
                             <include>org.apache.parquet:parquet-hadoop</include>
                         </includes>
                     </artifactSet>
+                    <relocations>
+                        <relocation>
+                            <pattern>com.google.common</pattern>
+                            <shadedPattern>org.apache.kudu.shaded.com.google.common</shadedPattern>
+                        </relocation>
+                        <relocation>
+                            <pattern>com.google.thirdparty</pattern>
+                            <shadedPattern>org.apache.kudu.shaded.com.google.thirdparty</shadedPattern>
+                        </relocation>
+                    </relocations>
                 </configuration>
             </plugin>
         </plugins>

http://git-wip-us.apache.org/repos/asf/kudu/blob/650e39e2/java/kudu-client/pom.xml
----------------------------------------------------------------------
diff --git a/java/kudu-client/pom.xml b/java/kudu-client/pom.xml
index 70dffc6..ad3cd36 100644
--- a/java/kudu-client/pom.xml
+++ b/java/kudu-client/pom.xml
@@ -50,6 +50,14 @@
             <groupId>com.google.guava</groupId>
             <artifactId>guava</artifactId>
             <version>${guava.version}</version>
+            <exclusions>
+                <!-- Ignore the transitive annotations libraries that are -->
+                <!-- not marked as optional in version 22.0+ -->
+                <exclusion>
+                    <groupId>*</groupId>
+                    <artifactId>*</artifactId>
+                </exclusion>
+            </exclusions>
         </dependency>
         <dependency>
             <groupId>com.google.protobuf</groupId>

http://git-wip-us.apache.org/repos/asf/kudu/blob/650e39e2/java/kudu-flume-sink/build.gradle
----------------------------------------------------------------------
diff --git a/java/kudu-flume-sink/build.gradle b/java/kudu-flume-sink/build.gradle
index fcadcee..72ae0cd 100644
--- a/java/kudu-flume-sink/build.gradle
+++ b/java/kudu-flume-sink/build.gradle
@@ -27,6 +27,7 @@ dependencies {
   provided libs.avro
   provided libs.flumeConfiguration
   provided libs.flumeCore
+  provided libs.guava
   provided libs.hadoopClient
 
   testCompile project(path: ":kudu-client", configuration: "shadowTest")

http://git-wip-us.apache.org/repos/asf/kudu/blob/650e39e2/java/kudu-flume-sink/pom.xml
----------------------------------------------------------------------
diff --git a/java/kudu-flume-sink/pom.xml b/java/kudu-flume-sink/pom.xml
index b783925..a585a19 100644
--- a/java/kudu-flume-sink/pom.xml
+++ b/java/kudu-flume-sink/pom.xml
@@ -28,6 +28,12 @@
     </dependency>
 
     <dependency>
+      <groupId>com.google.guava</groupId>
+      <artifactId>guava</artifactId>
+      <version>${guava.version}</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
       <groupId>org.apache.flume</groupId>
       <artifactId>flume-ng-core</artifactId>
       <version>${flume.version}</version>

http://git-wip-us.apache.org/repos/asf/kudu/blob/650e39e2/java/kudu-mapreduce/build.gradle
----------------------------------------------------------------------
diff --git a/java/kudu-mapreduce/build.gradle b/java/kudu-mapreduce/build.gradle
index 70c2624..0c40c8d 100644
--- a/java/kudu-mapreduce/build.gradle
+++ b/java/kudu-mapreduce/build.gradle
@@ -22,6 +22,7 @@ dependencies {
     // Remove this once the following is merged: https://github.com/OpenTSDB/async/pull/8
     exclude group: "org.slf4j", module: "slf4j-api"
   }
+  compile libs.guava
   compile libs.slf4jApi
 
   provided libs.hadoopClient

http://git-wip-us.apache.org/repos/asf/kudu/blob/650e39e2/java/kudu-mapreduce/pom.xml
----------------------------------------------------------------------
diff --git a/java/kudu-mapreduce/pom.xml b/java/kudu-mapreduce/pom.xml
index a98afcf..ee26955 100644
--- a/java/kudu-mapreduce/pom.xml
+++ b/java/kudu-mapreduce/pom.xml
@@ -35,6 +35,20 @@
             <artifactId>kudu-client</artifactId>
             <version>${project.version}</version>
         </dependency>
+
+        <dependency>
+            <groupId>com.google.guava</groupId>
+            <artifactId>guava</artifactId>
+            <version>${guava.version}</version>
+            <exclusions>
+                <!-- Ignore the transitive annotations libraries that are -->
+                <!-- not marked as optional in version 22.0+ -->
+                <exclusion>
+                    <groupId>*</groupId>
+                    <artifactId>*</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
         <dependency>
             <groupId>com.stumbleupon</groupId>
             <artifactId>async</artifactId>


Mime
View raw message