First time I try to do a migration of a project to Java Modules (Jigsaw), and I'm having problems with Confluent Serialization libraries:
module myproject reads package io.confluent.kafka.serializers from both kafka.schema.serializer and kafka.avro.serializer
Both libraries define that package with different classes in each (called a "split package"). The library kafka.avro.serializer
depends on kafka.schema.serializer
, so exclusion of irrelevant transitive dependency is not the case. And both seem to be non-migrated to modules, so I assume they are automatic modules.
I expected that everybody using Avro and Java Modules would have faced this and I would get a fast solution, but I had to find other similar cases to try to dig a solution for this. This answer suggests repackaging the offending libraries in a single JAR and hosting in an internal repository, but that is out of the question in my company (security considerations). Confluent refactoring the library by moving the classes to non-conflicting packages would solve it, but it's hard to guess when they would do that.
Is there any other solution to this, something ideally doable at the project level (POM or otherwise)?