r2dbc-spi icon indicating copy to clipboard operation
r2dbc-spi copied to clipboard

Add full JPMS module descriptor

Open A248 opened this issue 3 years ago • 13 comments

Feature Request

Add a full module descriptor for improved use with JPMS. See also https://github.com/reactive-streams/reactive-streams-jvm/issues/531

Is your feature request related to a problem? Please describe

r2dbc-spi doesn't have a full module descriptor. At the moment, it only has a stable automatic module name.

A full module descriptor is a requirement for some tools, like JLink. The module system in general has better support for full modules – for example, compiling requires transitive r2dbc.spi currently produces a warning about automatic modules.

Describe the solution you'd like

A module descriptor is added to the R2DBC-Spi jar, either at the root of the jar, or in a multi-release directory.

Describe alternatives you've considered

Continue to use the Automatic-Module-Name manifest entry. This has the drawbacks mentioned previously.

Teachability, Documentation, Adoption, Migration Strategy

Users don't have to do anything. The module name would stay the same, but instead of being an automatic module, R2DBC-Spi would become a full JPMS module.

The feature would ideally be mentioned in the release notes.

A248 avatar Jun 27 '21 02:06 A248

Adding module-info.java would mean that R2DBC is no longer compatible with JDK 8.

Oracle R2DBC is already modular, and requires JDK 11 or newer, so it wouldn't be effected by this change.

So what about the other drivers and frameworks that consume R2DBC? Are we all ready to leave JDK 8 behind?

Michael-A-McMahon avatar Nov 11 '21 17:11 Michael-A-McMahon

So what about the other drivers and frameworks that consume R2DBC?

The jOOQ Open Source Edition has JDK 11 as a baseline already, so jOOQ could live with that.

lukaseder avatar Nov 11 '21 18:11 lukaseder

It isn't true that adding a module descriptor necessitates dropping Java 8 compatibility. There are a few ways to create a modular jar which is compatible with JDK 8.

A248 avatar Nov 11 '21 20:11 A248

Oh, I see, you're right!

Creating a multi-release jar seems like a nice approach: https://openjdk.java.net/jeps/238#Modular-multi-release-JAR-files

Michael-A-McMahon avatar Nov 11 '21 20:11 Michael-A-McMahon