简体   繁体   中英

Adding a Gradle dependency on AWS SDK for Java v2

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM