Unable to resolve confluent kafka dependencies in gradle?

Viewed 4894

While adding dependencies for confluent kafka in build gradle file, its unable to resolve it.

   compile group: 'io.confluent', name: 'kafka-avro-serializer', version: '4.0.0'
   compile group: 'io.confluent', name: 'kafka-schema-registry', version: '4.0.0'
   compile 'io.confluent:kafka-schema-registry:4.0.0:tests'

After adding giving following error .

enter image description here

3 Answers

As @Joseph said, you have to add the confluent repository to looks the dependencies. Inside the repositories block, you have to add the confluent maven repository. Please note that my gradle version is 7.1

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

Correct entry should be,

repositories {
  mavenCentral()
  maven {
    url = uri("https://packages.confluent.io/maven")
  }
}
Related