开发者

How to declare a project dependency in SBT 0.10?

I use SBT 0.10.0.

How do I download/retrieve project depen开发者_StackOverflow中文版dencies?

For example, for slf4s only this line is mentioned:

val slf4s = "com.weiglewilczek.slf4s" %% "slf4s" % "1.0.6

Where do I need to put this line, and how do I get the library?


I presume you're using SBT 0.10.0, because earlier versions will put your deps in lib_managed automatically.

In build.sbt, put the following line:

retrieveManaged := true


You create a project/build subdirectory in your project and put a scala file with the above content there.

Then when you start sbt from your project root directory the

update

command will retrieve your dependencies.

Note that it will only analyse your project configuration once by default. If you change it, you have to call reload

UPDATE:

let the project class extend DefaultProject:

class SomeProjectName(info: ProjectInfo) extends DefaultProject(info)


I don't know which version of sbt you are using.

For 0.10, Daniel C. Sobral made a blog post about creation of an sbt project: dcsobral-project-creation-guide

Maybe this helps.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜