megfigura commented on issue #9045: URL: https://github.com/apache/pulsar/issues/9045#issuecomment-774309546
I hit a similar issue today where adding a dependency on pulsar-client-admin (2.6.0) caused compilation errors in other code in my project using protobuf. Checking the pulsar-client-admin jar, I see that its protobuf dependency (and others) are included inside and their packages are not [shaded / relocated.](https://maven.apache.org/plugins/maven-shade-plugin/examples/class-relocation.html) This caused Eclipse to see the protobuf classes included in the pulsar-client-admin jar rather than the incompatible ones from the protobuf dependency I had defined in my pom.xml, hence the compilation error in my code. Switching to the pulsar-client-admin-original / pulsar-client-original packages fixes my problem since this allows Maven to resolve dependencies as expected rather than running into "surprise dependencies" hidden away inside the pulsar jar. Maybe pulsar should relocate the packages of its dependencies, or maybe the "original" version should be mentioned in the documentation. Like, "use _original_ if you have a complex application with many of its own dependencies." ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected]
