diff --git a/sdks/java/io/kafka/build.gradle b/sdks/java/io/kafka/build.gradle index a500ddd49fb5..51bb13e2c3fa 100644 --- a/sdks/java/io/kafka/build.gradle +++ b/sdks/java/io/kafka/build.gradle @@ -20,6 +20,7 @@ import java.util.stream.Collectors plugins { id 'org.apache.beam.module' } applyJavaNature( + enableStrictDependencies: true, automaticModuleName: 'org.apache.beam.sdk.io.kafka', mavenRepositories: [ [id: 'io.confluent', url: 'https://packages.confluent.io/maven/'] @@ -49,6 +50,8 @@ dependencies { compile library.java.vendored_guava_26_0_jre compile project(path: ":sdks:java:core", configuration: "shadow") compile project(":sdks:java:expansion-service") + permitUnusedDeclared project(":sdks:java:expansion-service") // BEAM-11761 + compile library.java.avro // Get back to "provided" since 2.14 provided library.java.kafka_clients compile library.java.slf4j_api @@ -57,6 +60,13 @@ dependencies { compile library.java.jackson_databind compile "org.springframework:spring-expression:4.3.18.RELEASE" compile ("io.confluent:kafka-avro-serializer:5.3.2") { + // zookeeper depends on "spotbugs-annotations:3.1.9" which clashes with current + // "spotbugs-annotations:3.1.12" used in Beam. Not required. + exclude group: "org.apache.zookeeper", module: "zookeeper" + // "kafka-clients" has to be provided since user can use its own version. + exclude group: "org.apache.kafka", module: "kafka-clients" + } + compile ("io.confluent:kafka-schema-registry-client:5.3.2") { // It depends on "spotbugs-annotations:3.1.9" which clashes with current // "spotbugs-annotations:3.1.12" used in Beam. Not required. exclude group: "org.apache.zookeeper", module: "zookeeper" @@ -71,8 +81,6 @@ dependencies { // For testing Cross-language transforms testCompile project(":runners:core-construction-java") testCompile library.java.avro - testCompile library.java.hamcrest_core - testCompile library.java.hamcrest_library testCompile library.java.junit testCompile library.java.powermock testCompile library.java.powermock_mockito