confluentinc / schema-registry

Confluent Schema Registry for Kafka
https://docs.confluent.io/current/schema-registry/docs/index.html
Other
2.21k stars 1.11k forks source link

Remove or make kotlin dependencies optional #3270

Closed philsttr closed 2 weeks ago

philsttr commented 3 weeks ago

The schema registry submodules only have a few references to two kotlin types:

This forces Java applications to transitively depend on a bunch of kotlin dependencies.

|  +- io.confluent:kafka-connect-json-schema-converter:jar:7.5.1:compile
|  |  +- io.confluent:kafka-json-schema-provider:jar:7.5.1:compile
|  |  |  +- org.jetbrains.kotlin:kotlin-stdlib:jar:1.9.24:compile
|  |  |  +- org.jetbrains.kotlin:kotlin-scripting-jvm:jar:1.9.24:compile
|  |  |  |  +- org.jetbrains.kotlin:kotlin-script-runtime:jar:1.9.24:compile
|  |  |  |  \- org.jetbrains.kotlin:kotlin-scripting-common:jar:1.9.24:compile
|  |  |  \- org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:jar:1.6.0:compile
|  |  |     \- org.jetbrains.kotlin:kotlin-scripting-compiler-impl-embeddable:jar:1.6.0:runtime

It would be really nice if Java applications using the schema registry did not have to pull in a bunch of kotlin dependencies just for these two classes.

Can those references be removed? Perhaps by creating similar Pair and IntRange classes in this library instead?

If references to those kotlin classes can't be removed, can they be made optional? For example, only reference them if kotlin is already on the classpath (and mark the maven dependencies on kotlin libraries as optional)

rayokota commented 2 weeks ago

kafka-json-schema-provider relies on https://github.com/erosb/json-sKema, which is written in Kotlin

kafka-protobuf-provider relies on https://github.com/square/wire, which is written on Kotlin