Java gradle kafka-avro序列化程序和kafka模式注册表客户端无法在部署管道中下载



试图在云中部署我们的服务时,我遇到了两个可传递依赖项无法下载的问题,错误为:

Welcome to Gradle 6.7.1!
Here are the highlights of this release:
- File system watching is ready for production use
- Declare the version of Java your build requires
- Java 15 support
For more details see https://docs.gradle.org/6.7.1/release-notes.html
Starting a Gradle Daemon (subsequent builds will be faster)
> Task :compileJava FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileJava'.
> Could not resolve all files for configuration ':compileClasspath'.
> Could not resolve io.confluent:kafka-avro-serializer:5.3.2.
Required by:
project :
project : > org.apache.beam:beam-runners-google-cloud-dataflow-java:2.32.0 > org.apache.beam:beam-sdks-java-io-kafka:2.32.0
> Could not resolve io.confluent:kafka-avro-serializer:5.3.2.
> Could not get resource 'http://packages.confluent.io/maven/io/confluent/kafka-avro-serializer/5.3.2/kafka-avro-serializer-5.3.2.pom'.
> Could not GET 'http://packages.confluent.io/maven/io/confluent/kafka-avro-serializer/5.3.2/kafka-avro-serializer-5.3.2.pom'.
> Connection reset
> Could not resolve io.confluent:kafka-schema-registry-client:5.3.2.
Required by:
project :
project : > org.apache.beam:beam-runners-google-cloud-dataflow-java:2.32.0 > org.apache.beam:beam-sdks-java-io-kafka:2.32.0
> Could not resolve io.confluent:kafka-schema-registry-client:5.3.2.
> Could not get resource 'http://packages.confluent.io/maven/io/confluent/kafka-schema-registry-client/5.3.2/kafka-schema-registry-client-5.3.2.pom'.
> Could not GET 'http://packages.confluent.io/maven/io/confluent/kafka-schema-registry-client/5.3.2/kafka-schema-registry-client-5.3.2.pom'.
> Connection reset

我在网上和stackoverflow上能找到的大多数解决方案都是围绕添加一个新的confluent.io-gradle存储库:

repositories {
mavenCentral()
maven {
url "http://packages.confluent.io/maven/"
}
}

我同时尝试了http和https。两者都没有改变云中的任何东西。

我试图将可传递的依赖项直接添加到项目等级中。这种方法也不成功:


implementation group: 'io.confluent', name: 'kafka-avro-serializer', version: '5.3.2'
implementation group: 'io.confluent', name: 'kafka-schema-registry-client', version: '5.3.2'

问题可能是什么?如何最好地解决这个问题?

云中的防火墙正在阻止请求。出于某种原因,它们不是被归类为http,而是被归类为confluent请求,防火墙对此一无所知,因此正在阻止这些请求。针对";汇合的";应用程序。我不知道这个应用程序是从哪里来的,但是。。。启用这些请求解决了问题。

Include below repository in your pom.xml file
<repositories>
<repository>
<id>confluent</id>
<url>http://packages.confluent.io/maven/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>

最新更新