AWS S3类的Maven依赖项

u91tlkcl  于 7个月前  发布在  Maven
关注(0)|答案(1)|浏览(162)

有谁可以帮助我使用maven和AWS吗?在documentation中,他们解释说我们需要添加以下依赖项:

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

字符串
我这样做了。我想添加依赖项来使用S3类(如AmazonS3Client等)。在mavenrepository中,我找到了S3包,但当我将其添加到pom.xml文件中时,IntelliJ无法找到它。

<!-- https://mvnrepository.com/artifact/com.amazonaws/aws-java-sdk-s3 -->
<dependency>
    <groupId>com.amazonaws</groupId>
    <artifactId>aws-java-sdk-s3</artifactId>
    <version>1.11.923</version>
</dependency>


有没有人可以帮助我,告诉我我做的是什么错了?我一直在尝试这么多的选择,但我不能弄清楚。所有我想要的是使用S3对象从JAVA程序(基本上是一个aws lambda函数)

wfypjpf4

wfypjpf41#

如果您想使用AWS SDK for Java 1.x,则需要参考this maven作为示例。否则,如果您选择AWS SDK for Java 2.x,则使用下面提到的maven依赖配置并参考this java示例。

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

字符串

相关问题