From 0eb4bcf9c3232e38f9d430ae79e542da7ccc1687 Mon Sep 17 00:00:00 2001 From: Dan Halperin Date: Fri, 5 May 2017 17:16:34 -0700 Subject: [PATCH] [BEAM-2190] pom.xml: do a better job of dependency management Even if Beam appears to have the correct dependencies, we cannot guarantee that modules that depend on us transitively get the right dependencies. For example, even though grpc-protobuf-lite has protobuf-lite excluded, and the Maven Enforcer banned-dependencies check passes... if a user happens to get a transitive dependency on grpc-all first, they may pull in grpc-protobuf from that other source without the exclusion. Thus we need to exclude protobuf-lite from grpc-all as well. While we're here, also add guava-jdk5 to the set of banned dependencies, though (as above) we cannot currently properly identify the places it might be transitively exposed in a users' pom.xml. --- pom.xml | 24 ++++++++++++++++++++++ sdks/java/io/google-cloud-platform/pom.xml | 8 +------- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/pom.xml b/pom.xml index 83eafc613ad3..991144793f00 100644 --- a/pom.xml +++ b/pom.xml @@ -553,6 +553,12 @@ io.grpc grpc-all ${grpc.version} + + + com.google.protobuf + protobuf-lite + + @@ -898,6 +904,12 @@ com.google.api.grpc grpc-google-common-protos ${grpc-google-common-protos.version} + + + com.google.protobuf + protobuf-lite + + @@ -1611,12 +1623,24 @@ [3.2,) + + + + + enforce-banned-dependencies + + enforce + + + + com.google.guava:guava-jdk5 com.google.protobuf:protobuf-lite + true diff --git a/sdks/java/io/google-cloud-platform/pom.xml b/sdks/java/io/google-cloud-platform/pom.xml index 070b116d5402..7a21f07cd191 100644 --- a/sdks/java/io/google-cloud-platform/pom.xml +++ b/sdks/java/io/google-cloud-platform/pom.xml @@ -133,19 +133,13 @@ + scope and depend on it at runtime. --> io.grpc grpc-all runtime - - io.grpc - grpc-protobuf - runtime - - joda-time joda-time