From 43706f50def84ded97a9e8b87e3ac9ab3cee35d0 Mon Sep 17 00:00:00 2001 From: Shehzaad Nakhoda Date: Thu, 25 Feb 2021 12:13:03 -0800 Subject: [PATCH 1/2] [BEAM-10961] enable strict dependency checking for sdks/java/extensions/ml --- sdks/java/extensions/ml/build.gradle | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/sdks/java/extensions/ml/build.gradle b/sdks/java/extensions/ml/build.gradle index d7ab4caabb5e..c6fd78e3daf0 100644 --- a/sdks/java/extensions/ml/build.gradle +++ b/sdks/java/extensions/ml/build.gradle @@ -21,25 +21,33 @@ import groovy.json.JsonOutput */ plugins { id 'org.apache.beam.module' } -applyJavaNature(automaticModuleName: 'org.apache.beam.sdk.extensions.ml') +applyJavaNature( + enableStrictDependencies: true, + automaticModuleName: 'org.apache.beam.sdk.extensions.ml' +) description = 'Apache Beam :: SDKs :: Java :: Extensions :: ML' dependencies { compile project(path: ":sdks:java:core", configuration: "shadow") compile project(":sdks:java:expansion-service") + permitUnusedDeclared project(":sdks:java:expansion-service") // BEAM-11761 compile 'com.google.cloud:google-cloud-video-intelligence:1.2.0' compile 'com.google.cloud:google-cloud-dlp:1.1.4' compile 'com.google.cloud:google-cloud-language:1.99.4' + compile 'com.google.api.grpc:proto-google-cloud-dlp-v2:1.1.4' + compile 'com.google.api.grpc:proto-google-cloud-language-v1:1.81.4' + compile 'com.google.api.grpc:proto-google-cloud-video-intelligence-v1:1.2.0' + compile 'com.google.api.grpc:proto-google-cloud-vision-v1:1.81.3' + compile library.java.gax + compile library.java.protobuf_java + compile library.java.slf4j_api provided library.java.junit testCompile project(path: ':sdks:java:core', configuration: 'shadowTest') compile 'com.google.cloud:google-cloud-vision:1.99.3' + permitUsedUndeclared "com.google.auto.value:auto-value-annotations:1.7" testCompile library.java.mockito_core - testCompile 'com.google.cloud:google-cloud-video-intelligence:1.2.0' - testCompile 'com.google.cloud:google-cloud-dlp:1.1.4' testCompile project(path: ":sdks:java:extensions:google-cloud-platform-core", configuration: "testRuntime") - testCompile 'com.google.cloud:google-cloud-language:1.99.4' - testCompile 'com.google.cloud:google-cloud-vision:1.99.3' testRuntimeOnly project(path: ":runners:direct-java", configuration: "shadow") testRuntimeOnly project(":runners:google-cloud-dataflow-java") } From 1d874626654e5c1e42698dd7319f2bfb59cc1a12 Mon Sep 17 00:00:00 2001 From: Shehzaad Nakhoda Date: Fri, 26 Feb 2021 01:08:09 -0800 Subject: [PATCH 2/2] [BEAM-10961] add explicit compile for auto_value_annotations in sdks/extensions/ml/build.gradle --- .../main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy | 1 + sdks/java/extensions/ml/build.gradle | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy b/buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy index 5d1b1013cda2..17cfbe2de888 100644 --- a/buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy +++ b/buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy @@ -472,6 +472,7 @@ class BeamModulePlugin implements Plugin { antlr : "org.antlr:antlr4:4.7", antlr_runtime : "org.antlr:antlr4-runtime:4.7", args4j : "args4j:args4j:2.33", + auto_value_annotations : "com.google.auto.value:auto-value-annotations:$autovalue_version", avro : "org.apache.avro:avro:1.8.2", avro_tests : "org.apache.avro:avro:1.8.2:tests", aws_java_sdk_cloudwatch : "com.amazonaws:aws-java-sdk-cloudwatch:$aws_java_sdk_version", diff --git a/sdks/java/extensions/ml/build.gradle b/sdks/java/extensions/ml/build.gradle index c6fd78e3daf0..e5aa7d1baef6 100644 --- a/sdks/java/extensions/ml/build.gradle +++ b/sdks/java/extensions/ml/build.gradle @@ -39,13 +39,13 @@ dependencies { compile 'com.google.api.grpc:proto-google-cloud-language-v1:1.81.4' compile 'com.google.api.grpc:proto-google-cloud-video-intelligence-v1:1.2.0' compile 'com.google.api.grpc:proto-google-cloud-vision-v1:1.81.3' + compile library.java.auto_value_annotations compile library.java.gax compile library.java.protobuf_java compile library.java.slf4j_api provided library.java.junit testCompile project(path: ':sdks:java:core', configuration: 'shadowTest') compile 'com.google.cloud:google-cloud-vision:1.99.3' - permitUsedUndeclared "com.google.auto.value:auto-value-annotations:1.7" testCompile library.java.mockito_core testCompile project(path: ":sdks:java:extensions:google-cloud-platform-core", configuration: "testRuntime") testRuntimeOnly project(path: ":runners:direct-java", configuration: "shadow")