FasterXML / jackson-dataformats-binary

Uber-project for standard Jackson binary format backends: avro, cbor, ion, protobuf, smile
Apache License 2.0
310 stars 133 forks source link

JPMS Avro - Static #171

Closed GedMarc closed 5 years ago

GedMarc commented 5 years ago

to allow dependency to name properly, and allow implementor to define and change as need be

cowtowncoder commented 5 years ago

Ok so for Avro it makes sense (as use of Apache Avro is optional). But is the same true for Ion? I don't think there is currently any way to avoid loading Ion codec.

Also wrt Avro -- I hope to soon upgrade Apache Avro dep to 1.9 which will change things a bit here, as it drops Jackson 1.x (relies now on 2.x). But until then change makes sense of course.

GedMarc commented 5 years ago

Ion will be looked for on the UNNAMED module section, and lets consumers specify the module for requirement :) As long as the dependency is included (any version) the packages will pick up,

I did something very similar here (https://github.com/GedMarc/guice-servlet/blob/master/moditect/module-info.java) on the guice module, which has classes for both servlet 2.5 and 3 -

this allows the consumer to load either of them and not crash on building jlink or something like that

cowtowncoder commented 5 years ago

Ok so looks like Avro 1.9 upgrade is not as easy as I hoped (things compile fine, but fail lots of unit tests -- and unit test contributions use great-jazzy test matrix features which means I can not figure out what even fails... which is not that great, but I digress), so it's probably best to prepare for 1.8.x being the implementation for Jackson 2.10.

So I'll merge this: not much Ion usage, and I suspect their module info ... does not exist? In which case someone probably has to repackage it, so static makes sense to allow users to work around that gap.