From 3918177c6b0dd933a5a8cfa8c80435c2284538fc Mon Sep 17 00:00:00 2001 From: Shawn Pearce Date: Tue, 6 Aug 2013 08:44:46 -0700 Subject: [PATCH] Exclude Guava Maven data and javax sources from Guice JARs Guice 4.0-beta leaked the maven metadata files for Guava when it was repacked to a private namespace. This confuses Buck when creating a combined JAR that has both Guice and Guava. Guice also leaked the source files for javax.annotation into its binary JAR files. Buck sometimes finds and extracts these source files at compile time, creating duplicate versions of the classes. Change-Id: Iea0a3394530abd8b0853d016b7cb2f5182f82a96 --- gerrit-util-cli/BUCK | 1 + lib/guice/BUCK | 36 +++++++++++++++++++++++++++++++++++- 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/gerrit-util-cli/BUCK b/gerrit-util-cli/BUCK index c281e86b47..d5fff90e7f 100644 --- a/gerrit-util-cli/BUCK +++ b/gerrit-util-cli/BUCK @@ -4,6 +4,7 @@ java_library( deps = [ '//lib:args4j', '//lib:guava', + '//lib:jsr305', '//lib/guice:guice', '//lib/guice:guice-assistedinject', ], diff --git a/lib/guice/BUCK b/lib/guice/BUCK index c226101ede..4fac2c0c8b 100644 --- a/lib/guice/BUCK +++ b/lib/guice/BUCK @@ -23,7 +23,41 @@ maven_jar( sha1 = 'a82be989679df08b66d48b42659a3ca2daaf1d5b', license = 'Apache2.0', deps = [':aopalliance'], - exclude = EXCLUDE, + exclude = EXCLUDE + [ + 'META-INF/maven/com.google.guava/guava/pom.properties', + 'META-INF/maven/com.google.guava/guava/pom.xml', + 'javax/annotation/CheckForNull.java', + 'javax/annotation/CheckForSigned.java', + 'javax/annotation/CheckReturnValue.java', + 'javax/annotation/concurrent/GuardedBy.java', + 'javax/annotation/concurrent/Immutable.java', + 'javax/annotation/concurrent/NotThreadSafe.java', + 'javax/annotation/concurrent/ThreadSafe.java', + 'javax/annotation/Detainted.java', + 'javax/annotation/MatchesPattern.java', + 'javax/annotation/meta/Exclusive.java', + 'javax/annotation/meta/Exhaustive.java', + 'javax/annotation/meta/TypeQualifier.java', + 'javax/annotation/meta/TypeQualifierDefault.java', + 'javax/annotation/meta/TypeQualifierNickname.java', + 'javax/annotation/meta/TypeQualifierValidator.java', + 'javax/annotation/meta/When.java', + 'javax/annotation/Nonnegative.java', + 'javax/annotation/Nonnull.java', + 'javax/annotation/Nullable.java', + 'javax/annotation/OverridingMethodsMustInvokeSuper.java', + 'javax/annotation/ParametersAreNonnullByDefault.java', + 'javax/annotation/ParametersAreNullableByDefault.java', + 'javax/annotation/PropertyKey.java', + 'javax/annotation/RegEx.java', + 'javax/annotation/Signed.java', + 'javax/annotation/Syntax.java', + 'javax/annotation/Tainted.java', + 'javax/annotation/Untainted.java', + 'javax/annotation/WillClose.java', + 'javax/annotation/WillCloseWhenClosed.java', + 'javax/annotation/WillNotClose.java', + ], visibility = [], )