Repository: beam Updated Branches: refs/heads/master a0da7beca -> 2b0e699b8
[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. Project: http://git-wip-us.apache.org/repos/asf/beam/repo Commit: http://git-wip-us.apache.org/repos/asf/beam/commit/44c9385d Tree: http://git-wip-us.apache.org/repos/asf/beam/tree/44c9385d Diff: http://git-wip-us.apache.org/repos/asf/beam/diff/44c9385d Branch: refs/heads/master Commit: 44c9385ddbcfbdf904c5d054754dca3ddde88ec2 Parents: a0da7be Author: Dan Halperin <[email protected]> Authored: Fri May 5 17:16:34 2017 -0700 Committer: Dan Halperin <[email protected]> Committed: Mon May 8 11:35:54 2017 -0700 ---------------------------------------------------------------------- pom.xml | 24 ++++++++++++++++++++++++ sdks/java/io/google-cloud-platform/pom.xml | 8 +------- 2 files changed, 25 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/beam/blob/44c9385d/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index 367a61f..e3fa7d8 100644 --- a/pom.xml +++ b/pom.xml @@ -553,6 +553,12 @@ <groupId>io.grpc</groupId> <artifactId>grpc-all</artifactId> <version>${grpc.version}</version> + <exclusions> + <exclusion> + <groupId>com.google.protobuf</groupId> + <artifactId>protobuf-lite</artifactId> + </exclusion> + </exclusions> </dependency> <dependency> @@ -898,6 +904,12 @@ <groupId>com.google.api.grpc</groupId> <artifactId>grpc-google-common-protos</artifactId> <version>${grpc-google-common-protos.version}</version> + <exclusions> + <exclusion> + <groupId>com.google.protobuf</groupId> + <artifactId>protobuf-lite</artifactId> + </exclusion> + </exclusions> </dependency> <dependency> @@ -1611,12 +1623,24 @@ <!-- Keep aligned with preqrequisite section below. --> <version>[3.2,)</version> </requireMavenVersion> + </rules> + </configuration> + </execution> + <execution> + <id>enforce-banned-dependencies</id> + <goals> + <goal>enforce</goal> + </goals> + <configuration> + <rules> <bannedDependencies> <excludes> + <exclude>com.google.guava:guava-jdk5</exclude> <exclude>com.google.protobuf:protobuf-lite</exclude> </excludes> </bannedDependencies> </rules> + <fail>true</fail> </configuration> </execution> </executions> http://git-wip-us.apache.org/repos/asf/beam/blob/44c9385d/sdks/java/io/google-cloud-platform/pom.xml ---------------------------------------------------------------------- diff --git a/sdks/java/io/google-cloud-platform/pom.xml b/sdks/java/io/google-cloud-platform/pom.xml index 6846990..f0526f0 100644 --- a/sdks/java/io/google-cloud-platform/pom.xml +++ b/sdks/java/io/google-cloud-platform/pom.xml @@ -133,7 +133,7 @@ </dependency> <!-- grpc-all does not obey IWYU, so we need to exclude from compile - scope and depend on it at runtime. --> + scope and depend on it at runtime. --> <dependency> <groupId>io.grpc</groupId> <artifactId>grpc-all</artifactId> @@ -141,12 +141,6 @@ </dependency> <dependency> - <groupId>io.grpc</groupId> - <artifactId>grpc-protobuf</artifactId> - <scope>runtime</scope> - </dependency> - - <dependency> <groupId>joda-time</groupId> <artifactId>joda-time</artifactId> </dependency>
