When creating extensions that depend on other exte...
# dev
c
When creating extensions that depend on other extensions... is there a way to actually load those dependencies reliably? Specifically, I'm trying to implement the
RoleProvider
interface that is defined in the druid-basic-security extension, but if I try to make my extension a standalone extension (using the
provided
scope for the
druid-basic-security
dependency in my
pom.xml
) I get
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/druid/security/basic/authorization/RoleProvider
... however if I shade the jar, then it does work. Also if I build it into
druid-basic-security
that also works. Am I missing something with how the interface might be implemented outside of this core extension package? Anyone have experience with this?
a
I’m not sure about the specific auth classs in question…but inter-extension dependency support was added here in 32.0.0, in case it’s useful: https://github.com/apache/druid/pull/16973
c
this looks extremely helpful! Thank you!
g
note, that PR was mainly to support a different use case: an extension needed to be able to use objects from another extension (not provide alternate implementations of an interface). It might work for your use case too, though. Worth a try
c
It actually did work!
g
🙌