2

I am creating local app to create DynamoDBLocal and test against it.

I am using Spring Boot app with gradle on Mac OS X

However, while compiling, I get following error:

error: package com.amazonaws.services.dynamodbv2.local.embedded does not exist

I have following code:

testCompile group: 'com.amazonaws', name: 'DynamoDBLocal', version: '1.11.119'

task copyNativeDeps(type: Copy) {
    from(configurations.compile + configurations.testCompile) {
        include '*.dll'
        include '*.dylib'
        include '*.so'
    }
    into 'build/libs'
}

test {
    dependsOn copyNativeDeps
    systemProperty "java.library.path", 'build/libs'
}
@Bean
public AmazonDynamoDB builAmazonDynamoDBClient() {
   return DynamoDBEmbedded.create().amazonDynamoDB();
}

Can someone please help me in understanding that why this is not being loaded ?

I can see the dependency being downloaded in my .gradle⁩ ▸ ⁨caches⁩ ▸ ⁨modules-2⁩ ▸ ⁨files-2.1⁩ ▸ ⁨com.amazonaws⁩

And I can see all the classes in it too.

However, in eclipse, all the classes have Source Not Found and terminal ./gradlew clean build fails with above error.

Any help appreciated.

Mayoor
  • 21
  • 3

1 Answers1

0

Not sure if it would help now. I also faced a similar issue, and you would need to use compile instead of testCompile, if creating the Bean or calling DynamoDBEmbedded.create() outside of Test files.

compile group: 'com.amazonaws', name: 'DynamoDBLocal', version: '1.11.119'
akshay
  • 131
  • 2
  • 11