0

I am trying to use scala to access Amazon's DynamoDB and found this great package on github https://github.com/piotrga/async-dynamo

so I downloaded the code as a zip file , unzipped it and then did "sbt clean test" and getting the following error

error sbt.ResolveException: unresolved dependency: asyncdynamo#async-dynamo;1.6.0: not found

Questions : is this the correct way to generate a jar file that I can include in my Scala program or is there a better way? thanks in advance.

EDIT:

just for the benefit of others, the SCALA SBT documentation provides lots of information regarding the build process.

CruncherBigData
  • 1,112
  • 3
  • 14
  • 34
  • Are you using sbt as the build tool of your project? The Readme.md on the github project page tells you how to set the dependencies in your build.sbt. There should be no need to create a jar "manually". – Matthias Schlaipfer May 12 '13 at 08:09
  • possible duplicate of [How can sbt pull dependency artifacts from git?](http://stackoverflow.com/questions/7550376/how-can-sbt-pull-dependency-artifacts-from-git) – Jacek Laskowski Dec 28 '13 at 20:48
  • Duplicate of http://stackoverflow.com/q/7550376/1305344 and http://stackoverflow.com/q/19832655/1305344 and http://stackoverflow.com/q/20083564/1305344 – Jacek Laskowski Dec 28 '13 at 20:48

2 Answers2

1

Instead of generating a jar file, you can just run 'sbt publish-local' and then include the lines for the managed dependency in the other project. Sbt/ivy will see you have the artifact that way you don't need to add the jar to the other project which is much cleaner. Then for example if you need to update the other project you don't need to replace the jar again - just publish-local again and clean and run your other project!

JasonG
  • 5,794
  • 4
  • 39
  • 67
0

You are not the only one to have problems with this it seems, see github issues page: https://github.com/piotrga/async-dynamo/issues

The command 'sbt clean test' will run the tests sbt detects. If you want a .jar file you could use 'sbt clean package', which produces a .jar in the target/ folder.

I cloned the repo and was able to run sbt package after changing release.sbt a bit. I had to change the 'publishTo'-variable as it seemed to depend on the repository creators local environment variable, so I just commented it away.

I did not get the dependency problem, so I suppose it is correctly declared. The tests it tries to run do fail though, but sbt package compiles produces the .jar just fine.

EDIT: As Matthias Schlaipfer pointed out in the comments, the more elegant way(and much easier) would just be to add this as an depency in your build.sbt. From the readme, this is what you need to add:

resolvers += "piotrga" at "https://github.com/piotrga/piotrga.github.com/tree/master/maven-repo"

libraryDependencies += "asyncdynamo" % "async-dynamo" % "1.6"

Zavior
  • 6,412
  • 2
  • 29
  • 38
  • Great thanks I read was able to Getty it to work after commenting the publishTo variable. – CruncherBigData May 12 '13 at 11:49
  • A cleaner solution would be, as pointed out, to use it as an dependency in sbt, but happy to help! Please accept the answer if it worked. – Zavior May 12 '13 at 11:52