minio Unsupported OkHttp library found. Must use okhttp >= 4.8.1
Asked Answered
H

1

8

after using minio as instructions and fixing it with ways below, I failed.what can i do to solve this bug

        <dependency>
        <groupId>io.minio</groupId>
        <artifactId>minio</artifactId>
        <version>8.3.5</version>
        <exclusions>
            <exclusion>
                <artifactId>okhttp</artifactId>
                <groupId>com.squareup.okhttp3</groupId>
            </exclusion>
        </exclusions>
    </dependency>
    <!-- https://mvnrepository.com/artifact/com.squareup.okhttp3/okhttp -->
    <dependency>
        <groupId>com.squareup.okhttp3</groupId>
        <artifactId>okhttp</artifactId>
        <version>4.9.3</version>
    </dependency>
</dependencies>
Hartzke answered 30/1, 2022 at 12:38 Comment(0)
C
4

I also experienced this issues with io.minio:minio:8.3.6, but was able to force a newer version of okhttp, which works with the MinIO client library. Here is the snippet of build.gradle (should work similar with Maven):

implementation("io.minio:minio:8.3.6")    
implementation("com.squareup.okhttp3:okhttp:4.9.3")

In my case it was probably caused by spring-boot-dependencies coming with the spring dependency plugin, which manages a lot of dependencies containing also okhttp and thus forces the downgrade.

See also:

Update

With Spring Boot 2.7.0, the fix is no longer required, since the version requirements for okhttp have been updated. The MinIO dependency should work now out of the box.

Claimant answered 9/2, 2022 at 13:41 Comment(4)
thanks a lot, I've solved this issue!Hartzke
Hi, will it have problems since this method violates the spring boot dependencies?Llovera
I just tried it with Spring Boot 2.6.6 combined with MinIO 8.3.8 and it still works without problems using the described method.Claimant
Hi, I have tried with above specified to connect minio azure s3 bucker using springboot 2.7.8 combined with Minio 8.3.6. i'm getting null object. below is my code can any one suggest what wrong i'm doing here. ` MinioClient client = MinioClient.builder() .endpoint(HttpUrl.parse(minioUrl)) //.httpClient(httpClient) .credentials(accessKey, accessSecret) .build(); `Weak

© 2022 - 2024 — McMap. All rights reserved.