Modules and build time
David M. Lloyd
david.lloyd at redhat.com
Wed Oct 21 11:21:00 UTC 2015
I have a problem with the premise that modules should be directly
consumable by the build in the same way they are consumed at run time.
Building a typical Java artifact today generally entails the Maven
approach, which, roughly translated into modularisms, would look
something like this:
* We build artifacts, not modules
* The build consumes (specific versions of) modules for build tasks such
as resource processing, descriptor generation, annotation processing, etc.
* The build consumes (specific versions of) artifacts for the build
class path; these artifacts generally correspond to a minimum version of
a module that is expected to be mandatorily or optionally present at run
time, but also may correspond only to specific APIs expected to be
present at run time
* The run time environment may consist of a set of modules that does not
have a direct correspondence to the artifacts used for build
* The test time environment may consist of a set of modules that does
not have a direct correspondence to the artifacts used for build
To me there is no sensible way to reconcile these facts against the
proposed Jigsaw methodology of having javac reference modules directly.
This would mean that all build artifacts have to be packaged as
modules and transported to the user for build, which further means that
every user would need to define a complete, build-specific modular
environment, for little or no gain that I can understand.
Can we walk through a few cases where people are expected to build
real-world applications, and discuss ways that they could do so?
More information about the jpms-spec-experts