On 08/08/2022 14:41, Andrejus Chaliapinas wrote:
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.
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.
Have you tried java --validate-modules? This option will scan the module
path split package for other issues so that you get a dump of all issues.
-Alan