<div dir="ltr"><div dir="ltr"><div class="gmail_quote" style=""><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I’m confused. To use the implementation of the `x.Plugin` service (defined in X) that you want Y to `provides` an implementation of, some module *must* have a `uses x.Plugin`. The runtime has to know that that service is needed by the program. Maybe the application `uses` it, but X itself could also declare that it `uses` an implementation of a service interface that it, itself, declares. So perhaps it is X that `uses X.plugin`, but someone has to actually say they want to use the service.<br></blockquote><div> </div><div>I believe I'm picking up what you're putting down, but let's review it again to be sure.</div><div><br></div><div> </div><div>In artifact X we have:</div><div><br></div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br><div>    exports x.spi;</div><div>    uses x.spi.Plugin;</div></blockquote><div><br></div></div><div>in artifact Y we have two modules: y and y.inject.</div><div><br></div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">    exports y.stuff;<br></blockquote></div><div><br></div><div>And </div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>    requires x;</div><div>    provides x.spi.Plugin with y.inject.PluginImpl;</div></blockquote><div><br></div></div><div>With this in mind, we have two situations we want to support. we have an application Z that wants to use the Y artifact alone and a case where Z wants to use X and Y.</div><div><br></div><div>With Y alone, the z module should look like this correct?</div><div><br></div></div></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>    requires y;</div></blockquote><div><br></div><div> And in the case where Z wants both X and Y (with X doing the service-loading), we do:</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">     requires x;<br>    requires y;<br></blockquote><div><br></div><div>Am I right to understand that X will service load the y.inject plugin correctly? </div></div><input name="virtru-metadata" type="hidden" value="{"email-policy":{"disableCopyPaste":false,"disablePrint":false,"disableForwarding":false,"enableNoauth":false,"expandedWatermarking":false,"expires":false,"sms":false,"expirationNum":1,"expirationUnit":"days","isManaged":false,"persistentProtection":false},"attachments":{},"compose-id":"9","compose-window":{"secure":false}}"></div>