简体   繁体   English

下载的ScalaTest jar放在哪里,以便sbt在项目中使用它?

[英]Where to place downloaded ScalaTest jar so sbt uses it across projects?

I've downloaded the ScalaTest jar and have used it as in the example, but now I would like to start using it with sbt. 我已经下载了ScalaTest jar,并在示例中使用了它,但是现在我想开始在sbt中使用它。 Where do I place the downloaded jar so I can use it with sbt across multiple projects? 我应该将下载的jar放在哪里,以便可以在多个项目中与sbt一起使用?

You don't download dependencies like ScalaTest manually. 您无需手动下载像ScalaTest这样的依赖项。 The point of using sbt is to declare your project's dependencies and let sbt download them for you automatically. 使用sbt的目的是声明项目的依赖项,然后让sbt自动为您下载它们。

Add this line in your build.sbt file: build.sbt文件中添加以下行:

libraryDependencies += "org.scalatest" %% "scalatest" % "2.2.0" % "test"

For more details see official doc on setting this up. 有关更多详细信息,请参阅有关此设置的官方文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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