JavaMoney / jsr354-ri

JSR 354 - Moneta: Reference Implementation
Other
334 stars 100 forks source link

Hard dependency on okhttp, osgi? #404

Closed hrstoyanov closed 7 months ago

hrstoyanov commented 7 months ago

If read the POM correctly moneta-core has hard (compile) dependency on okhttp? What is the reason for a this (java has its own Java http client API since Java 11). Also not sure why are Jakarta Annotations also used? Some OSGI?

keilw commented 7 months ago

Because Moneta is still backward-compatible with Java 8. Maybe 1.5.x could raise the bar to Java 11, but for now it's still Java 8.

Also the JDK HttpClient is less powerful than OkHttp, e.g. it just offers a single connectTimeout (https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpClient.Builder.html) and not multiple, similar to the old HTTPConnection. So while 1.5 using Jakarta EE 10 will mean, we also have to use Java 11 as the minimum JDK, we'll see, whether we switch to the JDK version already or deprecate some settings in the javamoney.properties first before making that switch.

Jakarta Annotations are used for the Priority of services.

hrstoyanov commented 7 months ago

Thanks, ok, I see the reasoning... Hard pass from me due to the above issue at this point, but if you want this library to be truly versatile and non-intrusive, please consider removing Jakarta EE requirements (so it is useful in Micronaut, Helidon SE, Spring) and prefer core Java SE over external libraries. Maybe a smaller core that can be useful by anyone, with Jakarta EE entanglements in a higher layer?

keilw commented 7 months ago

It's a standard library that was refactored from javax (just like JavaMoney) to jakarta, but it's a single standalone library, used by pretty much all the mentioned frameworks anyway (https://mvnrepository.com/artifact/jakarta.annotation/jakarta.annotation-api)