I am running into an issue wherein I want to use both the AWS Kotlin SDK and Moneta from this repository in the same project. Unfortunately, some other packages such as the AWS Kotlin SDK transitively depends on okhttp:5.0.0-alpha.11 on JVM, and so we end up with a dependency version conflict at runtime.
While the 5.x API is stable, and has been around over 3 years now, it is still "alpha", though only the APIs introduced in 5.x are unstable:
The alpha releases in the 5.0.0 series have production-quality code and an unstable API. We expect to make changes to the APIs introduced in 5.0.0-alpha.X. These releases are safe for production use and ‘alpha’ strictly signals that we’re still experimenting with some new APIs.
If it's possible to bump the dependency to 5.0.0-alpha.X, that would be nice. The okhttp3 interface has been stable for a while now.
I did a little feasibility exploration doing nothing but bumping the version in pom.xml to 5.0.0-alpha.12:
Build
I was able to successfully build with one warning. That warning is unrelated: Required filename-based automodules detected: [osgi.annotation-8.1.0.jar]. Please don't publish this project to a public artifact repository!
The aforementioned error, to give an example of where the incompatibility comes in. Seems to be only when a library uses one of the 5.x.x specific APIs.
An attempt was made to call a method that does not exist. The attempt was made from the following location:
aws.smithy.kotlin.runtime.http.engine.okhttp.OkHttpUtilsKt.toOkHttpRequest(OkHttpUtils.kt:51)
The following method did not exist:
'okhttp3.Request$Builder okhttp3.Request$Builder.tag(kotlin.reflect.KClass, java.lang.Object)'
The calling method's class, aws.smithy.kotlin.runtime.http.engine.okhttp.OkHttpUtilsKt, was loaded from the following location:
jar:file:/Users/dylan/.gradle/caches/modules-2/files-2.1/aws.smithy.kotlin/http-client-engine-okhttp-jvm/1.1.3/b0dd25c01125eea76b1ed62eda65c3181382bef5/http-client-engine-okhttp-jvm-1.1.3.jar!/aws/smithy/kotlin/runtime/http/engine/okhttp/OkHttpUtilsKt.class
The called method's class, okhttp3.Request$Builder, is available from the following locations:
jar:file:/Users/dylan/.gradle/caches/modules-2/files-2.1/com.squareup.okhttp3/okhttp/4.12.0/2f4525d4a200e97e1b87449c2cd9bd2e25b7e8cd/okhttp-4.12.0.jar!/okhttp3/Request$Builder.class
The called method's class hierarchy was loaded from the following locations:
okhttp3.Request.Builder: file:/Users/dylan/.gradle/caches/modules-2/files-2.1/com.squareup.okhttp3/okhttp/4.12.0/2f4525d4a200e97e1b87449c2cd9bd2e25b7e8cd/okhttp-4.12.0.jar
Thanks, but we won't use Okhttp 5.0.0 unless it has a Final release.
Feel free to build a snapshot or alpha release locally, but we cannot do something "dodgy" just because Amazon or someone else does.
I am running into an issue wherein I want to use both the AWS Kotlin SDK and Moneta from this repository in the same project. Unfortunately, some other packages such as the AWS Kotlin SDK transitively depends on
okhttp:5.0.0-alpha.11
on JVM, and so we end up with a dependency version conflict at runtime.While the 5.x API is stable, and has been around over 3 years now, it is still "alpha", though only the APIs introduced in 5.x are unstable:
If it's possible to bump the dependency to
5.0.0-alpha.X
, that would be nice. Theokhttp3
interface has been stable for a while now.I did a little feasibility exploration doing nothing but bumping the version in
pom.xml
to5.0.0-alpha.12
:Build
I was able to successfully build with one warning. That warning is unrelated:
Required filename-based automodules detected: [osgi.annotation-8.1.0.jar]. Please don't publish this project to a public artifact repository!
Test
The aforementioned error, to give an example of where the incompatibility comes in. Seems to be only when a library uses one of the 5.x.x specific APIs.