I would like to use the Java AWS SDK only for S3 at the moment. So, instead of importing the entire AWS SDK jar file I wanted to only import the necessary packages for accessing my S3 bucket into my web application (IDE: Netbeans).
To do this, I read that I should use Maven to build the jar I need.
I have tried two approaches but can't seem to also include all of the aws-java-sdk-s3 dependencies in the jar that I am building.
First approach
1) I download the zipped aws-sdk-java folder from https://github.com/aws/aws-sdk-java
2) I unzip to a local folder.
3) I navigate to the aws-java-sdk-s3 (ie: where the pom is located) folder in my console, then type "mvn clean install".
While this builds a jar file (located in aws-java-sdk-s3/target
), the jar does not contain the dependencies specified in the POM file (eg: it does not include the BasicAWSCredentials class in the core package which I need).
Second Approach Change the POM file located in the aws-java-sdk-master folder so that it imports the BOM and specifying my requirement (S3) by adding:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-bom</artifactId>
<version>1.10.67</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-s3</artifactId>
</dependency>
</dependencies>
and removing all other dependencies listed in the POM (eg: junit).
This approach fails while building the DynamoDB package, which I don't even need it to be building (I want to specify that it only needs S3).
Any suggestions as to what I'm doing wrong? Perhaps the main issue here is that I'm new to Maven.
Thank you
core
classes (I was under the impression that it should because thecore
package is a dependency ofs3
but maybe I'm misunderstanding something)...I am familiar with the second link you provide, I couldn't get it working properly. – theyuv