-
-
Notifications
You must be signed in to change notification settings - Fork 795
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
Fix #1340 by adding missing "provides" in module-info.java
#1339
Conversation
if we have a src/main/resources/META-INF/services/com.fasterxml.jackson.core.JsonFactory this works in projects that have no module-info.java, but if a project does have module-info.java then we need to also add the java modules way of provides
Would it be possible to provide something to test this with? Even a standalone project. |
Or even links to docs that describe this issue and/or fix generally. |
to test you can run here is a simple project that fails when run: https://github.com/user-attachments/files/17117454/arangodb-java-driver-demo.zip |
it is standard java to Always put the ServiceLoader loaded class in BOTH the "META-INF/services" AND module-info.java, you can see in the other jackson module this is the case: |
Ideally this should be backported also to older branches. |
This will likely be merged but can't users who need this today create their own jar that has a module-info.class in like described in #1341. The workaround jar might also need the META-INF/services/com.fasterxml.jackson.core.JsonFactory file. The same users who think this is needed yesterday could also build their own jackson-core with this amendment in it. |
I can backport to, say, 2.16 and 2.17 but unlikely to release new patches for pre-2.17. I assume this has been tested to work? (even if just manually) |
module-info.java
Backport in 2.16 and 2.17 in case new versions might be released. But the next version that has the fix will be 2.18.0. |
Hi @cowtowncoder , |
(Fixes #1340)
if we have a src/main/resources/META-INF/services/com.fasterxml.jackson.core.JsonFactory
this works in projects that have no module-info.java, but if a project does have module-info.java
then we need to also add the java modules way of provides
this fixes
ServiceLoader<JsonFactory> sl = ServiceLoader.load(JsonFactory.class);
not working (returning empty)for projects that have a module-info.java