gpt4 book ai didi

java - Maven 找不到 aws s3 sdk

转载 作者:行者123 更新时间:2023-11-29 04:13:00 25 4
gpt4 key购买 nike

尝试通过 Maven 使用 Amazon AWS Java SDK 设置一个新项目,显然 Maven 找不到 s3 包。

这是错误:

[ERROR] /X:/java/amazon/S3/s3shell/src/main/java/me/s3/S3Shell.java:[4,42] package software.amazon.awssdk.services.s3 does not exist

这些是 pom 文件中的依赖项:

<dependencyManagement>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>bom</artifactId>
<version>2.2.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>s3</artifactId>
<version>2.2.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

最佳答案

为了记录,解决方案是:

<dependencyManagement>
<dependencies>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>bom</artifactId>
<version>2.2.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>s3</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>

关于java - Maven 找不到 aws s3 sdk,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53933424/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com