Input
I am developing an infrastructure that uses Kafka Clients 0.11 (KC-0.11). KC-0.11 has it's own dependencies off course.
Project X aims to use my infra. Project X also uses a different infra which uses Kafka Client 0.8 (KC-0.8). Obviously, KC-0.8 has it's own dependencies (similar to KC-0.11 only with earlier versions...)
I need project X to be able to work with both KC-0.8 and KC-0.11. For that I used maven shade plugin, where (in my infra) I shaded KC-0.11 within my jar.
Problem
The shading is performed ONLY for the KC-0.11 and not for KC-0.11's dependencies, but I need to shade the transitive dependencies of KC-0.11 as well. (I must shade KC-0.11's transitive dependencies so that KC-0.8 could work as before with it's original dependencies. KC-0.8 cannot work with advanced versions of it's dependencies)
Questions
- How can I shade transitive dependencies of KC-0.11 within my jar, without picking them one by one manually ?
- Generally speaking: shouldn't this be the default option in case of shading ? doesn't it make sense that each time I am shading a 3rd party I would need also have to shade all it's (transitive) dependencies in order to assure it remains work properly ?