Optional dependencies
Ali Ebrahimi
ali.ebrahimi1781 at gmail.com
Fri Dec 4 17:07:18 UTC 2015
Hi,
On Fri, Dec 4, 2015 at 8:23 PM, Stephen Colebourne <scolebourne at joda.org>
wrote:
> I've been pondering whether -addReads is sufficient for this use case.
>
> While type 1 of my classification below (annotations) would work using
> compile-time -addReads, I don't think types 2 and 3 would. (Type 2 is
> reflection based, type 3 is usage based)
>
> Here is the setup:
>
> module user {
> requires org.joda.beans
> requires com.google.guava
> }
> module org.joda.beans {
> // optionally requires com.google.guava
> }
>
> Proposed solution:
> compile module with -addReads=com.google.guavea
>
> The proposed solution would allow the Joda-Beans module to be
> successfully compiled. But it seems that it would not be able to see
> the Guava code at runtime (as the module does not have the
> dependency). Note that there is source code in Joda-Beans that
> actively calls Guava clases in addition to checking they exist by
> reflection.
>
I don't think this is optional dependency if you have static references to
Guava's types in source code.
--
Best Regards,
Ali Ebrahimi
More information about the jigsaw-dev
mailing list