spotify / completable-futures

Utilities for working with futures in Java 8
Apache License 2.0
393 stars 51 forks source link

add Automatic-Module-Name to JAR #85

Closed mattnworb closed 3 years ago

mattnworb commented 3 years ago

If the JAR for this repo is used in a project where the module system is active, Java treats any "plain JAR" without a module descriptor as an "automatic module" and allows it to be used by other modules in the application.

For instance, a module in an application using JPMS can depend on this project like

module com.mattnworb.jpms {
  requires com.spotify.completablefutures;
}

Defining an Automatic-Module-Name allows for explicitly controlling the name that modules use when loading your automatic module, rather JPMS guessing at the automatic module name for the JAR based on the JAR's filename.

Alternatively we could add a module-info.java to this project to enable it to be loaded as a regular (not automatic) module but that would also require increasing the compiler target from 8 to 9.

Closes #82

mattnworb commented 3 years ago

I was curious to learn more about JPMS so when I saw the related issue I thought it would be a good excuse to finally do that :)