module name convention

mark.reinhold at oracle.com mark.reinhold at oracle.com
Mon Oct 5 18:48:23 UTC 2015


2015/9/19 10:02 -0700, forax at univ-mlv.fr:
> Mani from AdoptAJSR has a very good question at the end of this document:
>   https://docs.google.com/document/d/1KlumN74IGt-TU-Md3Fn5h4sXHa75RApWNLszUTVp-DE/edit
> 
> ...
> 
> Both Eclipse and Maven use package name or at least package prefix as
> convention to name module and as Mani said it really confusing when you
> write a module-info file.
> 
> Given that the name of the JDK modules doesn't respect that convention
> but still use '.' to separate the different components, I wonder if we
> should not try to come with a convention for module name that allow to
> easily disambiguate between package name and module name.

Yes, I think that's worth exploring.

> By example,
>   java_base,
>   java-base,
>   java~base ...

Quick reactions:

  java_base is still a Java identifier, which is nice.

  java-base corresponds usefully to how JAR files are typically named
  (e.g., java-base-1.2.3.jar).

  java~base is pretty ugly (especially with longer names, e.g.,
  jdk~scripting~nashorn~shell).

I'm sure there are other possibilities ...

> Obviously the other solution is to prefix a name by "package" or
> "module".

As in, `requires module com.foo` and `exports package com.foo`?

- Mark


More information about the jpms-spec-experts mailing list