Inside a gradle java Liferay REST API backend (created with blade create -t rest), we are trying to use an OkHttp client from within Liferay 7.2 to access another rest API which is external.
The build.gradle dependencies include this line :
implementation group: 'com.squareup.okhttp3', name: 'okhttp', version: '4.9.0'
The build goes ok, but when we deploy the jar to the Liferay server, we got an error that says :
org.osgi.framework.BundleException: Could not resolve module: backendapp [1177]_ Unresolved requirement: Import-Package: okhttp3_ [Sanitized]
at org.eclipse.osgi.container.Module.start(Module.java:444)
Is OkHttp OSGI-ready for Liferay? and if not what is an LR-friendly alternative to consume rest APIs from inside a java inside LR?
Thanks for any hints.