![](/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.