【MinIO】SpringBoot引入MinIO依赖遇到的一些问题:okhttp、kotlib-stdlib

参考官方文档SDK:https://docs.min.io/docs/java-client-quickstart-guide.html

MinIO Java SDK is Simple Storage Service (aka S3) client to perform bucket and object operations to any Amazon S3 compatible object storage service.

MinIO依赖jar包下载地址:Central Repository: io/minio/minio

JDK最低要求:Java 1.8 或更高版本。

【异常1】maven仓库MinIO 8.3.4下载很慢

解决办法:maven设置依赖下载地址

复制代码
 1 <repositories>
 2     <repository>
 3         <id>public</id>
 4         <name>aliyun nexus</name>
 5         <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
 6         <releases>
 7             <enabled>true</enabled>
 8         </releases>
 9     </repository>
10 </repositories>
11 
12 <pluginRepositories>
13     <pluginRepository>
14         <id>public</id>
15         <name>aliyun nexus</name>
16         <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
17         <releases>
18             <enabled>true</enabled>
19         </releases>
20         <snapshots>
21             <enabled>false</enabled>
22         </snapshots>
23     </pluginRepository>
24 </pluginRepositories>
复制代码

【异常2】Caused by: java.lang.RuntimeException: Unsupported OkHttp library found. Must use okhttp >= 4.8

解决办法:maven引入minio排除okhttp依赖并添加高版本的okhttp依赖,如okhttp 4.9.0

复制代码
 1 <!-- 对象存储 MinIO -->
 2 <dependency>
 3     <groupId>io.minio</groupId>
 4     <artifactId>minio</artifactId>
 5     <version>8.3.4</version>
 6     <exclusions>
 7         <exclusion>
 8             <groupId>com.squareup.okhttp3</groupId>
 9             <artifactId>okhttp</artifactId>
10         </exclusion>
11     </exclusions>
12 </dependency>
13 
14 <dependency>
15     <groupId>com.squareup.okhttp3</groupId>
16     <artifactId>okhttp</artifactId>
17     <version>4.9.0</version>
18 </dependency>
复制代码

【异常3】NoSuchMethodError kotlin.collections.ArraysKt.copyInto([B[BIII)[B

解决办法:指定kotlib-stdlib的版本

复制代码
<!-- https://mvnrepository.com/artifact/org.jetbrains.kotlin/kotlin-stdlib -->
<dependency>
    <groupId>org.jetbrains.kotlin</groupId>
    <artifactId>kotlin-stdlib</artifactId>
    <version>1.3.70</version>
</dependency>
复制代码

 

posted @   小刘爱学习呀  阅读(735)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
点击右上角即可分享
微信分享提示