Multiple versions of a non-exported dependency

cowwoc cowwoc at
Wed Aug 31 17:56:25 UTC 2016


I recently became aware of the fact that the Jigsaw specification declared
"version-selection" as a non-goal. While I understand how we ended up here,
I am hoping that you were able to support the following (very common)

* Module "HelloWorld" depends on modules "Guava" and "JSoup".
* Module "Guava" depends on module slf4j version 1 (requires but does not
export it).
* Module "JSoup" depends on module slf4j version 2 (requires but does not
export it).
* slf4j version 2 and is not backwards-compatible with version 1.

What happens at runtime? Will Jigsaw (out of the box, without 3rd-party
tools like Maven or OSGI) be smart enough to provide different versions of
slf4j to "Guava" and "JSoup"?

I hope that you did not drop version numbers altogether when dropping
version-selection. Jigsaw should be able to map fixed version numbers
(string literals) to different JAR files without having to understand the
underlying versioning rules behind each string literal. Maven/OSGI could use
their proprietary version-selection algorithms to select a specific version,
generate a containing that fixed version, and pass that to
the JDK at build time. Would that not work?

If "requires" no longer takes a version number, I fear that you will never
be able to add versioning support in the future...


View this message in context:
Sent from the jigsaw-dev mailing list archive at

More information about the jigsaw-dev mailing list