<html><body><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #000000"><div><br></div><div><br></div><hr id="zwchr" data-marker="__DIVIDER__"><div data-marker="__HEADERS__"><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><b>From: </b>"Andrejus Chaliapinas" <andrejusc@yahoo.com><br><b>To: </b>"jigsaw-dev" <jigsaw-dev@openjdk.org><br><b>Sent: </b>Monday, August 8, 2022 3:41:06 PM<br><b>Subject: </b>Re: Could we have --exclude-modules option?<br></blockquote></div><div data-marker="__QUOTED_TEXT__"><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><div class="ydp5a264b8ayahoo-style-wrap" style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:13px;">
<div dir="ltr">Let me elaborate a bit - recent use case was when 2 jars were exporting same package (such was fine in old classpath use case, but not anymore for Java modules case). And challenge was to figure out which exactly jar needs to be excluded from Java modules resolution graph to make overall Java Modules validation work and not lead to a conflict.</div><div dir="ltr"><br></div><div dir="ltr">Presence of either of those jars would satisfy obviously compilation, so issue here is not about compilation itself. With proposed exclude approach it would be much easier to exclude jar1 - do various evaluations/tests and if anything failing - switch to jar2. And do all that yet not touching Maven (other build tool) dependencies aggregation inside some folder/local repo. And once reaching point of passing set - adjust later dependencies in other places.</div><div dir="ltr"><br></div><div dir="ltr">And in that regards mentioned --limit-modules would be longer path to achieve above fast evaluation of impact.</div></div></blockquote><div><br></div><div>It's perhaps easier to just merge the two jars into a unique one, this will resolve any split jar conflicts.<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>RĂ©mi<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><div class="ydp5a264b8ayahoo-style-wrap" style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:13px;"><br>
</div><div id="yahoo_quoted_0358560262" class="yahoo_quoted">
<div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;">
<div>
On Monday, August 1, 2022 at 09:53:53 AM GMT+1, Alan Bateman <alan.bateman@oracle.com> wrote:
</div>
<br>
<br>
<div><div id="yiv5547643889"><div>
On 21/07/2022 14:24, Andrejus Chaliapinas wrote:<br clear="none">
<div id="yiv5547643889yqt58699" class="yiv5547643889yqt9186746733"><blockquote>
Hi,
<div><br clear="none">
</div>
<div>While dealing with long list of Jar dependencies for complex
Maven project and trying to resolve some of Java Modules
conflicts - I'm finding that sometimes it could be useful to
exclude some modules without yet removing actual jar file from
aggregated directory of dependencies.</div>
<div><br clear="none">
</div>
<div>In that regards something like --exclude-modules would help
initially to evaluate impact and later allow adjust
build/dependencies resolution logic. What do you think?<br clear="none">
<div id="yiv5547643889ymail_android_signature"><br clear="none">
</div>
</div>
</blockquote></div>
I don't think this make sense as code will not compile or run if you
dependences are removed. Have you found modules where the author has
included `requires` clauses for modules that aren't actually
required, or maybe you are dealing with a module path with many
automatic modules and your module is being compiled with
--add-modules ALL-MODULE-PATH? <br clear="none">
<br clear="none">
One option to be aware of is the --limit-modules option [1] but I
suspect it won't be useful to you right now.<br clear="none">
<br clear="none">
-Alan<br clear="none">
<br clear="none">
[1] <a rel="nofollow noopener noreferrer" shape="rect" target="_blank" href="https://openjdk.org/jeps/261#Limiting-the-observable-modules" class="yiv5547643889moz-txt-link-freetext">https://openjdk.org/jeps/261#Limiting-the-observable-modules</a><br clear="none">
</div></div></div>
</div>
</div><br></blockquote></div></div></body></html>