FasterXML / jackson-core

Core part of Jackson that defines Streaming API as well as basic shared abstractions
Apache License 2.0
2.27k stars 796 forks source link

Missing `JsonFactory` "provides" SPI with JPMS in `jackson-core` module #1340

Closed rashtao closed 1 month ago

rashtao commented 1 month ago

SPI does not work in Java projects using JPMS, since module-info.java does not contains any provides directive.

To reproduce, I created a Java project with:

cowtowncoder commented 1 month ago

Interesting, I thought provides was included as format modules do that.

My main/only concern is that in this case it'd be something like

provides com.fasterxml.jackson.core.JsonFactory with
        com.fasterxml.jackson.core.JsonFactory;

which I am not sure works as expected (JsonFactory is only sub-classed by format module implementations in 2.x, basic JsonFactory implements JSON support)

cowtowncoder commented 1 month ago

@rashtao Would it be possible for you to locally build from 2.18 branch, with modified src/moditect/module-info.java to add "provides" directive, and check if that'd work? I can make PR, change, but woudl need someone to validate proposed fix.

EDIT: looks like there is #1339 already, will follow up on that.

rashtao commented 1 month ago

Hi @cowtowncoder , I have manually checked that the changes work when building from 2.18. Thanks!

cowtowncoder commented 1 month ago

Thank you for confirming @rashtao ! I hope to release 2.18.0 by end of week.

GedMarc commented 1 month ago

Unrelated to https://github.com/FasterXML/jackson-databind/issues/4727