AWS SDK for Java
Developer Guide

Using the SDK with Gradle

To use the AWS SDK for Java in your Gradle project, use Spring's dependency management plugin for Gradle, which can be used to import the SDK's Maven Bill of Materials (BOM) to manage SDK dependencies for your project.

To configure the SDK for Gradle

  1. Add the dependency management plugin to your build.gradle file

    buildscript { repositories { mavenCentral() } dependencies { classpath "io.spring.gradle:dependency-management-plugin:1.0.0.RC2" } } apply plugin: "io.spring.dependency-management"
  2. Add the BOM to the dependencyManagement section of the file

    dependencyManagement { imports { mavenBom 'com.amazonaws:aws-java-sdk-bom:1.10.77' } }
  3. Specify the SDK modules that you'll be using in the dependencies section

    dependencies { compile 'com.amazonaws:aws-java-sdk-s3' testCompile group: 'junit', name: 'junit', version: '4.11' }

Gradle will automatically resolve the correct version of your SDK dependencies using the information from the BOM.


For more detail about specifying SDK dependencies using the BOM, see Using the SDK with Apache Maven.