![](/img/trans.png)
[英]Calling getRegionName() on a awsS3Client backed by minio throws IllegalStateException
[英]How to add AwsS3Client to spring boot project
我正在使用Spring Boot 2.4.1
和Spring Cloud 2020.0.0
但我找不到spring-cloud-starter
、 spring-cloud-starter-aws
、 spring-cloud-aws-messaging
这个启动器在哪里?
如何将这些依赖项添加到我的项目中?
我需要在我的 spring-boot 项目中获取AwsS3Client
。
您可以将以下依赖项包含到您的项目中,即 pom.xml 文件。
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-aws</artifactId>
<version>2.2.5.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-aws-messaging</artifactId>
<version>2.2.5.RELEASE</version>
</dependency>
我假设您使用的是 maven,如果是这种情况,您可以在 pom.xml 文件中添加以下内容;
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-aws</artifactId>
<version>2.2.5.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-aws</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-aws-messaging</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency> <!-- test is optional, it is based on your requirements -->
</dependencies>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.