-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow users of kafka-avro-serializer to use any Scala version. #61
Conversation
Make Kafka a provided dependency for kafka-avro-serializer. The serializer still needs the core jar that depends on Scala, but doesn't use any Scala code. Instead of building multiple jars for different Scala versions, we can instead require them to provide the dependency themselves which they'll already be doing in order to use those interfaces. Additionally, this works without the jar available if they only use interfaces from kafka-clients, i.e. new producer/consumer interfaces. Fixes #60.
Fixing #60 turns out to be trivial since one of Maven's scopes provides for the behavior we want. If you want to verify, I applied the patch, installed locally, then used the following two files to check if failed as expected by commenting/uncommenting the kafka dependency and sections of the test program.
|
@@ -20,6 +20,7 @@ | |||
<groupId>org.apache.kafka</groupId> | |||
<artifactId>kafka_${kafka.scala.version}</artifactId> | |||
<version>${kafka.version}</version> | |||
<scope>provided</scope> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So provided ensures that it can be used at compile time but not for packaging?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, see the description here: http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Dependency_Scope -- basically it's used during compile of the package, but anything that runs/links the application/library are expected to provide the dependency themselves.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Got it.
+1 |
Allow users of kafka-avro-serializer to use any Scala version.
* DGS-16603 Allow oneofs to be flattened in Protobuf converter (#41) (#3250) * Add CSFLE tests with pre-canned data (#42) (#3252) * DGS-16763 Add format query param to APIs that return a schema (#46) (#3276) * DGS-16791 Set field type for enum/message fields * DGS-16763 Add format query param to APIs that return a schema * Use concurrent hash maps in serde members (#61) (#3278) * remove azure-identity definition, update azure-keyvault version (#49) (#3262) * inor fix * inor fix --------- Co-authored-by: Jan Werner <105367074+janjwerner-confluent@users.noreply.github.com> Co-authored-by: ConfluentSemaphore <40306929+ConfluentSemaphore@users.noreply.github.com>
Make Kafka a provided dependency for kafka-avro-serializer. The serializer still
needs the core jar that depends on Scala, but doesn't use any Scala
code. Instead of building multiple jars for different Scala versions, we can
instead require them to provide the dependency themselves which they'll already
be doing in order to use those interfaces. Additionally, this works without the
jar available if they only use interfaces from kafka-clients, i.e. new
producer/consumer interfaces. Fixes #60.