【MinIO】SpringBoot引入MinIO依赖遇到的一些问题:okhttp、kotlib-stdlib
MinIO 基于Apache V2 license 100% 开放源代码 。虽然轻量,却拥有着不错的性能。它兼容亚马逊S3云存储服务接口。可以很简单的和其他应用结合使用,例如 NodeJS、Redis、MySQL等。
centos上docker安装MinIO参考:https://blog.csdn.net/u014698745/article/details/122025423
参考官方文档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设置依赖下载地址
<repositories>
<repository>
<id>public</id>
<name>aliyun nexus</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>public</id>
<name>aliyun nexus</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
【异常2】Caused by: java.lang.RuntimeException: Unsupported OkHttp library found. Must use okhttp >= 4.8
解决办法:maven引入minio排除okhttp依赖并添加高版本的okhttp依赖,如okhttp 4.9.0
<!-- 对象存储 MinIO -->
<dependency>
<groupId>io.minio</groupId>
<artifactId>minio</artifactId>
<version>8.3.4</version>
<exclusions>
<exclusion>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>4.9.0</version>
</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>
更多推荐


所有评论(0)