Skip to content
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

Hard dependency on okhttp, osgi? #404

Closed
hrstoyanov opened this issue Feb 3, 2024 · 4 comments
Closed

Hard dependency on okhttp, osgi? #404

hrstoyanov opened this issue Feb 3, 2024 · 4 comments

Comments

@hrstoyanov
Copy link

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
Copy link
Member

keilw commented Feb 4, 2024

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.

@keilw keilw closed this as completed Feb 4, 2024
@hrstoyanov
Copy link
Author

hrstoyanov commented Feb 5, 2024

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
Copy link
Member

keilw commented Feb 6, 2024

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)

@dstoch
Copy link

dstoch commented Nov 28, 2024

While the dependency on jakarta.annotation-api is not very problematic, the dependency on okhttp is (these libraries do not have versions as OSGi bundles). Why the need to introduce this dependency from version 1.4.3, it was not there before?
Is it necessary to work always, or only for certain selected functions of moneta-core and could it be optional (Import-package optional)?

I cannot reopen this issue, should I create a new one for this problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants