Skip to content

Make dependency to Okhttp as optional #427

@dstoch

Description

@dstoch

I reopen an issue from #404.

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)?

BTW:
Generally, using a 3rd party library in such a fairly generic library as Moneta, which in practice provides the appropriate data types, is a bit problematic, if it is not some very standard library. And Okhttp is not a standard one, especially since there are many different http client libraries. If we use different dependencies of this type in the application, such as moneta-core, then in the end it turns out that they transitively pull many different libraries and it often ends with our application suddenly having several different types of libraries for the same purpose (e.g. http client).
I do not know which feature in moneta-core requires http client and whether every application of this library uses it (I suspect it is not necessary). It would probably be better if such http client, if necessary, was pluggable via some interface and we could plug-in any implementation or none at all, if our application does not use this feature.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions