DynamoDBLocal in sbt dependencies

2019-07-13 01:16发布

问题:

I've added "com.amazonaws" % "dynamodb-titan100-storage-backend" % "1.0.0" to my dependencies and the build broke because of com.amazonaws#DynamoDBLocal;[1.10.5.1, 2.0.0): not found. I've fixed this by adding mavenLocal resolver(I have built dynamodb-titan100-storage-backend localy earlier) but it is not the best solution, I think.

dynamodb-titan100-storage-backend has additional repository called "AWS DynamoDB Local Release Repository" in pom.xml pointing to http://dynamodb-local.s3-website-us-west-2.amazonaws.com/release but adding it as sbt resolver doesn't fix the problem.

My question is: why this repostiry works with maven but does not with sbt?

Link to pom.xml

Part of sbt log:

[info] Resolving com.amazonaws#DynamoDBLocal;[1.10.5.1, 2.0.0) ...
[warn]  module not found: com.amazonaws#DynamoDBLocal;[1.10.5.1, 2.0.0)
[warn] ==== local: tried
[warn]   /home/wpitula/.ivy2/local/com.amazonaws/DynamoDBLocal/[revision]/ivys/ivy.xml
[warn] ==== fedora: tried
[warn]   file:/usr/share/sbt/ivy-local/com.amazonaws/DynamoDBLocal/[revision]/ivy.xml
[warn] ==== public: tried
[warn]   https://repo1.maven.org/maven2/com/amazonaws/DynamoDBLocal/[revision]/DynamoDBLocal-[revision].pom
[warn] ==== sonatype-snapshots: tried
[warn]   https://oss.sonatype.org/content/repositories/snapshots/com/amazonaws/DynamoDBLocal/[revision]/DynamoDBLocal-[revision].pom
[warn] ==== DynamoDbLocal: tried
[warn]   http://dynamodb-local.s3-website-us-west-2.amazonaws.com/release/com/amazonaws/DynamoDBLocal/[revision]/DynamoDBLocal-[revision].pom
[info] Resolving jline#jline;2.12.1 ...
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: com.amazonaws#DynamoDBLocal;[1.10.5.1, 2.0.0): not found
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::

回答1:

The problem was likely in a wrong type of the SBT resolver. You should use a Maven-repository resolver like this:

resolvers += "DynamoDBLocal" at "https://s3-us-west-2.amazonaws.com/dynamodb-local/release"