Optional dependencies

Stephen Colebourne scolebourne at joda.org
Tue Dec 1 15:08:43 UTC 2015


I have reviewed the dependencies of the Open Source projects I
release, and a number of them have optional dependencies. It seems
that Jigsaw currently provides no easy way to convert these projects
to modular jar files:

Joda-Beans
http://www.joda.org/joda-beans/dependencies.html
4 optional dependencies (Joda-Collect, Guava, Freemarker, MongoDB)
1 mandatory dependency (Joda-Convert)

Joda-Time
http://www.joda.org/joda-time/dependencies.html
1 optional dependency (Joda-Convert)

Joda-Money
http://www.joda.org/joda-time/dependencies.html
1 optional dependency (Joda-Convert)

Joda-Convert
http://www.joda.org/joda-convert/dependencies.html
1 optional dependency (Guava)

ElSql
https://github.com/OpenGamma/ElSql/blob/master/pom.xml#L329
1 optional dependency (Spring)


A common "solution" to optional dependencies is to release a "core"
project and a second project that depends on "core" and the other
dependency. but as can be seen, doing that would probably more than
double the number of modules. I'm afraid there are limits to my open
source generosity, and more than doubling the modules I release simply
isn't going to happen. For Joda-Beans, you'd need around 16 modules to
provide the same degree of flexibility as optional.

The real problem here is that the variants of each of these projects
are not really significant. I want users to depend on the concept of
Joda-Time, and for them to pickup the benefits of Joda-Convert if they
decide to refer to the module directly. It seems like there should be
a way to represent this.

Are there any plans to address optional dependencies?

Stephen


More information about the jigsaw-dev mailing list