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.

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

1 Answers1

6

@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).

reinouts
  • 384
  • 3
  • 14