我有一个数据流管道,可以使用谷歌云自然语言 API 进行情感分析。所以,我包括云语言和数据流运行器的 jar,如下所示:
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-language</artifactId>
<version>1.25.0</version>
</dependency>
<dependency>
<groupId>org.apache.beam</groupId>
<artifactId>beam-runners-google-cloud-dataflow-java</artifactId>
<version>2.4.0</version>
</dependency>
但问题是,依赖项有崩溃
云语言使用 io.grpc 1.10.1,而 beam sdk 使用 1.2.0。有什么办法可以解决吗?谢谢。
com.google.cloud:google-cloud-language:jar:1.25.0 -> io.grpc:grpc-stub:jar:1.10.1 -> io.grpc:grpc-core:jar:1.10.1
org.apache.beam:beam-sdks-java-io-google-cloud-platform:jar:2.4.0 -> io.grpc:grpc-core:jar:1.2.0,
详细日志:
[ERROR] Failed to execute goal on project apache-beam-loader: Could not resolve dependencies for project com.sample.cloud:apache-beam-loader:jar:0.0.1-SNAPSHOT: Failed to collect dependencies for com.sample.cloud:apache-beam-loader:jar:0.0.1-SNAPSHOT: Could not resolve version conflict among [org.apache.beam:beam-runners-google-cloud-dataflow-java:jar:2.4.0 -> org.apache.beam:beam-sdks-java-io-google-cloud-platform:jar:2.4.0 -> io.grpc:grpc-core:jar:1.2.0, org.apache.beam:beam-runners-google-cloud-dataflow-java:jar:2.4.0 -> org.apache.beam:beam-sdks-java-io-google-cloud-platform:jar:2.4.0 -> io.grpc:grpc-netty:jar:1.2.0 -> io.grpc:grpc-core:jar:[1.2.0,1.2.0], org.apache.beam:beam-runners-google-cloud-dataflow-java:jar:2.4.0 -> org.apache.beam:beam-sdks-java-io-google-cloud-platform:jar:2.4.0 -> io.grpc:grpc-all:jar:1.2.0 -> io.grpc:grpc-core:jar:[1.2.0,1.2.0], org.apache.beam:beam-runners-google-cloud-dataflow-java:jar:2.4.0 -> org.apache.beam:beam-sdks-java-io-google-cloud-platform:jar:2.4.0 -> io.grpc:grpc-all:jar:1.2.0 -> io.grpc:grpc-okhttp:jar:1.2.0 -> io.grpc:grpc-core:jar:[1.2.0,1.2.0], org.apache.beam:beam-runners-google-cloud-dataflow-java:jar:2.4.0 -> org.apache.beam:beam-sdks-java-io-google-cloud-platform:jar:2.4.0 -> io.grpc:grpc-all:jar:1.2.0 -> io.grpc:grpc-protobuf-lite:jar:1.2.0 -> io.grpc:grpc-core:jar:1.2.0, org.apache.beam:beam-runners-google-cloud-dataflow-java:jar:2.4.0 -> org.apache.beam:beam-sdks-java-io-google-cloud-platform:jar:2.4.0 -> io.grpc:grpc-all:jar:1.2.0 -> io.grpc:grpc-protobuf-nano:jar:1.2.0 -> io.grpc:grpc-core:jar:1.2.0, org.apache.beam:beam-runners-google-cloud-dataflow-java:jar:2.4.0 -> org.apache.beam:beam-sdks-java-io-google-cloud-platform:jar:2.4.0 -> com.google.cloud.bigtable:bigtable-protos:jar:1.0.0-pre3 -> io.grpc:grpc-core:jar:1.5.0, org.apache.beam:beam-runners-google-cloud-dataflow-java:jar:2.4.0 -> org.apache.beam:beam-sdks-java-io-google-cloud-platform:jar:2.4.0 -> com.google.cloud.bigtable:bigtable-client-core:jar:1.0.0 -> io.grpc:grpc-core:jar:1.7.0, org.apache.beam:beam-runners-google-cloud-dataflow-java:jar:2.4.0 -> org.apache.beam:beam-sdks-java-io-google-cloud-platform:jar:2.4.0 -> com.google.cloud.bigtable:bigtable-client-core:jar:1.0.0 -> io.opencensus:opencensus-contrib-grpc-util:jar:0.7.0 -> io.grpc:grpc-core:jar:1.6.1, com.google.cloud:google-cloud-language:jar:1.25.0 -> com.google.cloud:google-cloud-core-grpc:jar:1.25.0 -> io.grpc:grpc-protobuf:jar:1.10.1 -> io.grpc:grpc-core:jar:1.10.1, com.google.cloud:google-cloud-language:jar:1.25.0 -> io.grpc:grpc-netty-shaded:jar:1.10.1 -> io.grpc:grpc-core:jar:[1.10.1,1.10.1], com.google.cloud:google-cloud-language:jar:1.25.0 -> io.grpc:grpc-stub:jar:1.10.1 -> io.grpc:grpc-core:jar:1.10.1, com.google.cloud:google-cloud-language:jar:1.25.0 -> io.grpc:grpc-auth:jar:1.10.1 -> io.grpc:grpc-core:jar:[1.10.1,1.10.1]] -> [Help 1]