amir
amir

Reputation: 491

Maven dependencies for AWS S3 classes

Could anyone help me with maven and AWS? In the documentation, they explain that we need to add the following dependencies:

<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>

I did that. And I wanted to add dependencies to use S3 classes (like AmazonS3Client and such). In mavenrepository, I found the package S3 but when I add it in my pom.xml file, IntelliJ can not find it.

<!-- 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>

Could anyone help me and tell me what is wrong with what I'm doing? I've been trying so many option but I can't figure it out. All I want is to use S3 objects from a JAVA program (basically an aws lambda function)

Upvotes: 1

Views: 11491

Answers (1)

amitd
amitd

Reputation: 1532

if you would like to go with/use AWS SDK for Java 1.x, then you need to refer this maven as example. Else, if you opt for AWS SDK for Java 2.x, then use the below mentioned maven dependency configuration and refer this java example.

<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>

Upvotes: 0

Related Questions