<div dir="auto"><div>> uses x.Plugin</div><div dir="auto"><br></div><div dir="auto">No it won't.</div><div dir="auto"><br></div><div dir="auto">The uses x.Plugin is in x. So the application does not have the uses clause.</div><div dir="auto"><br></div><div dir="auto">Hence the problem hete that it does not 'just work'.</div><div dir="auto"><br></div><div dir="auto"><br><br><div class="gmail_quote" dir="auto"><div dir="ltr" class="gmail_attr">On Mon, 24 Apr 2023, 8:06 pm Ron Pressler, <<a href="mailto:ron.pressler@oracle.com">ron.pressler@oracle.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



<div style="word-wrap:break-word;line-break:after-white-space">
<br>
<div><br>
<blockquote type="cite">
<div>On 23 Apr 2023, at 22:44, Rob Bygrave <<a href="mailto:robin.bygrave@gmail.com" target="_blank" rel="noreferrer">robin.bygrave@gmail.com</a>> wrote:</div>
<div>
<div dir="auto">
<div dir="auto"><span style="font-size:12.8px"><br>
</span></div>
<div dir="auto"><span style="font-size:12.8px">So if app module A uses Y it will have:</span></div>
<div dir="auto"><span style="font-size:12.8px"><br>
</span></div>
<div dir="auto"><span style="font-size:12.8px"> requires y.</span></div>
<div dir="auto"><span style="font-size:12.8px"><br>
</span></div>
<div dir="auto"><span style="font-size:12.8px">If app module A uses X and Y it will have:</span></div>
<div dir="auto"><span style="font-size:12.8px"><br>
</span></div>
<div dir="auto"><span style="font-size:12.8px">requires x;</span></div>
<div dir="auto"><span style="font-size:12.8px">requires y;</span></div>
<div dir="auto"><span style="font-size:12.8px">requires y.inject;</span></div>
<div dir="auto"><span style="font-size:12.8px"><br>
</span></div>
<div dir="auto"><span style="font-size:12.8px">We now need everyone using x and y together to explicitly know that y also provides a plugin and that they ALSO must remember to add the requires x.inject; (and x.inject has no exports, it only
 has the provides).</span></div>
<div dir="auto"><span style="font-size:12.8px"><br>
</span></div>
<div dir="auto"><span style="font-size:12.8px">Have I understood correctly? </span></div>
</div>
</div>
</blockquote>
</div>
<br>
<div>Not quite. If it uses X and Y it will have::</div>
<div><br>
</div>
<div>    requires x;</div>
<div>    requires y;</div>
<div>    uses x.Plugin;</div>
<div><br>
</div>
<div>which is exactly what you wanted, no? (You don’t even need `requires y` if Y’s other functionality is not used directly).</div>
<div><br>
</div>
<div>The y.inject module can be on the module path whether or not the application has X. It’s just not resolved unless some module `uses x.Plugin`, and to do that it must also `requires x` since that’s the module that defines the service interface
 `x.Plugin`.</div>
<div><br>
</div>
<div>— Ron</div>
<div><br>
</div>
<div><br>
</div>
</div>

</blockquote></div></div></div>