-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add full JPMS module descriptor #232
Comments
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? |
The jOOQ Open Source Edition has JDK 11 as a baseline already, so jOOQ could live with that. |
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. |
Oh, I see, you're right! Creating a multi-release jar seems like a nice approach: |
Ran into this today where I can't use JOOQ w/ jlink on account of this. |
Unfortunately r2dbc-spi has a dependency on the jsr305 annotations jar. |
Thats an annoying thing for a library that has its own nullability annotations anyways. Just writing this down
The paths forward are
This isn't my first time dealing with this BS - I even republished jsr305 under a GAV i own - but god is it frustrating. |
jOOQ itself has a |
jsr305 isn't required, however, it appears in the Can you help me understand what trouble the |
Can you talk about the downstream effects you anticipate? I've heard of some people putting a I.E. they did this
Instead of
or
And that tripped up tooling that just scanned all class files.
This issue better job of explaining than I can google/guava#2960 |
We've encountered various behavioral changes in tools once modules are used. Another aspect here is that the minority of our maintainers use modules regularly so there's not sufficient proficiency to work through issues coming from the module system. We have a similar case with OSGi metadata as well that some folks would like to see a smoother integration while maintainers can't afford to maintain these things. Arguably, the sentiment would be a different one if the maintainer team would be different. |
I'm going to clarify matters here, because it's important not to lose track of context. R2DBC-Spi is a service-provider interface designed as a low-level building block for nonblocking database APIs. It defines an API. It has no implementation. It has no runtime dependencies. Adding a module descriptor breaks no contracts. It merely enhances module metadata for use with the Java Platform Module System added in 2017. R2DBC came later, in 2019, with its first stable release in 2022 But old software is broken and fragile, there are lots of "downstream effects" due to not properly implementing support for a feature introduced 6 years ago. A class file under META-INF/versions is somehow supposed to be a valid Java 8 class. Tools are broken, outdated IDEs are buggy. Plus, adding a module creates "hassle" for the community. R2DBC was released after JPMS without JPMS. The maintainers don't use modules -- except for the fully-modularized JDK itself -- so we shouldn't expect them to know anything about the module system or its benefits. Once created, the module-info file might be easy to maintain, but someone who has barely worked with the module system, or has only experienced the ill effects of interactions with broken legacy software, will never know that. I'm sorry if I sound cynical; I decided that a dose of hard reality (at least, according to my perspective) was what this discussion needed. |
I think this pretty much sums it up and your summary reflects the current state properly. |
Feature Request
Add a full module descriptor for improved use with JPMS. See also reactive-streams/reactive-streams-jvm#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.
The text was updated successfully, but these errors were encountered: