Proposal: #VersionsInModuleNames

Mark Reinhold mark.reinhold at
Mon Sep 12 15:11:01 UTC 2016

Issue summary

  #VersionsInModuleNames --- Some have argued that library maintainers
  will be tempted to encode major version numbers, or even full version
  numbers, in module names.  Is there some way we can guide people away
  from doing that? [1]


Make two small changes:

  - Revise the automatic-module naming algorithm implemented by `javac`
    at compile time and the `ModuleFinder::of` method [2] at run time.
    It will now strip any trailing digits and period characters that
    remain after removing the version component, if any, from the name
    of the original JAR file.  Thus `foo-bar-1.2.3.jar` becomes the
    automatic module named `` with the version string `1.2.3`,
    and `foo-bar42.jar` becomes the automatic module named ``
    with no version string.

  - Revise `javac` to emit a lint warning, enabled by default, when a
    module-declaration compilation unit mentions a module name that
    ends with one or more digit characters, whether it is the name of
    the module being declared or the name of a module referenced in a
    `requires` directive or a qualified `exports` directive.


More information about the jpms-spec-experts mailing list