What I want to do:
I have a common interface which is implemented by plugin A. Plugin B asks for a component implementing the common interfaced. If such a component is found, then plugin B calls some methods on it. If no such component is found (i.e. plugin A is not installed), then those calls are omitted.
That's what I have so far:
The interface is not common but belongs to plugin A. Plugin B gets access to the classes of plugin A and can therefore reference the interface. But only if plugin A is installed!
If plugin A is not installed, then instead of not finding a suitable component I get a NoClassDefFoundError when referencing the interface. Adding the interface to plugin B too doesn't work either, since then it isn't the same interface anymore (one is loaded by classloader A and the other by classloader B).
How do others handle this problem?