5

I'd like to add the latest AWS SDK for Java v2 to my project's Gradle dependencies. In my case I'd like to add a dependency for software.amazon.awssdk:core. According to the docs I need to add these lines to the dependencies block:

  implementation platform('software.amazon.awssdk:bom:2.10.86')
  implementation 'software.amazon.awssdk:core'

However, this gives me:

Execution failed for task ':compileJava'.
> Could not resolve all files for configuration ':compileClasspath'.
   > Could not find software.amazon.awssdk:core:.
     Required by:
         project :

When I make the version number for the core artifact explicit, the build works. But this defeats the point of importing a BOM via the platform directive.

I did find this post but as far as I understand Gradle, I am already adding the platform to the implementation configuration when I follow the Amazon docs.

Currently I am using Gradle 5.6.3. Any hints on making this work are appreciated.

3
  • 3
    Looking at the BOM (Maven's Bill-of-Material) file that you are referencing. repo1.maven.org/maven2/software/amazon/awssdk/bom/2.10.86/…, core was likely split into 3 libraries. aws-core, protocol-core, sdk-core Commented Mar 16, 2020 at 21:19
  • do you have IMPROVED_POM_SUPPORT enabled? Commented Mar 16, 2020 at 21:54
  • I haven't heard about IMPROVED_POM_SUPPORT before so probably not. :) Commented Mar 17, 2020 at 15:15

1 Answer 1

9

@SGM1 pointed me in the right direction. The following works:

implementation platform('software.amazon.awssdk:bom:2.10.86') 
implementation 'software.amazon.awssdk:aws-core'

Obviously, the import statements need to be changed to software.amazon.awssdk.(etc).

Sign up to request clarification or add additional context in comments.

2 Comments

This worked for me too, thanks! you should mark this as the accepted answer.
@molholm Marked as accepted, even though it was SGM1 who came up with it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.