Skip to content

Decide on Java 9 module name #202

@remkop

Description

@remkop

TBD (separate question): modularize by adding manifest attribute "Automatic-Module-Name": "<module-name>" or by adding module-info.class? Note that picocli wants to stay binary compatible for Java 5 users. (It may be possible to compile the module-info.java file once manually with Java 9 and include it as a binary resource for automated builds going forward.)

Option 1: project-name-prefix convention

Keep current picocli package name, and use it (the "super-package") as the module name.

Drawbacks: does not match published Maven Central group id.

Advantages: package name matches module name. But unclear why this would be a good thing.

// module-info.java
module picocli {
    exports picocli;
    exports picocli.groovy;
}

Option 2: reverse DNS module, keep current package name

Module name does not match super package name.

Drawbacks: unclear. (In JDK 9 itself, module name and the packages they hold are only loosely related.)

Advantages: follows reverse-DNS naming and matches published Maven Central group id (avoiding potential global clashes).

module info.picocli {
    exports picocli;
    exports picocli.groovy;
}

Option 3: reverse DNS module, rename package to match module name

Rename package to match reverse-DNS module name.

Drawbacks: renaming the package breaks binary backwards compatibility for existing users. New package name is less aesthetically attractive.

Advantages: pretty much guaranteed to be unique, follows all of Remi Forax's and Stephen Colebourne's recommendations.

module info.picocli {
    exports info.picocli;
    exports info.picocli.groovy;
}

References:

  1. Mark Reinhold seems to have a preference for project-name-prefix convention
  2. Remi Forax's recommendation that existing module on Maven Central should use a name that starts with the Maven Central group id
  3. Stephen Colebourne's recommends that
    ** Module names must be reverse-DNS, just like package names
    ** The module name must be related to the package names
    ** Module names are strongly recommended to be the same as the name of the super-package

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions