Could we have --exclude-modules option?

Alan Bateman Alan.Bateman at oracle.com
Mon Aug 1 08:53:45 UTC 2022


On 21/07/2022 14:24, Andrejus Chaliapinas wrote:
> Hi,
>
> 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.
>
> 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?
>
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?

One option to be aware of is the --limit-modules option [1] but I 
suspect it won't be useful to you right now.

-Alan

[1] https://openjdk.org/jeps/261#Limiting-the-observable-modules
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/jigsaw-dev/attachments/20220801/7bab674d/attachment.htm>


More information about the jigsaw-dev mailing list