将第三方库添加到Scala项目(带有SBT插件的Idea 12)

时间:2013-05-29 05:21:15

标签: scala intellij-idea sbt

我正在IntelliJ Idea 12中开发一个Scala应用程序。我已经安装了Idea的sbt插件(设置 - >插件 - >浏览存储库...)。现在我想为Scala使用一些额外的库,假设其中一个是https://github.com/stevej/scala-json。所以我从其github存储库的源代码中下载了zip文件。

接下来我该怎么办?使用Intelli Idea 12 安装SBT插件

将标准方法添加到Scala项目的标准方法是什么?

1 个答案:

答案 0 :(得分:2)

在.sbt文件中尝试这样的事情:

libraryDependencies ++= Seq(                            
    "com.typesafe.slick" %% "slick" % "1.0.0",
    "postgresql" % "postgresql" % "9.1-901-1.jdbc4",
    "org.scalatest" %% "scalatest" % "1.9.1",
    "net.sf.opencsv" % "opencsv" % "2.3",
    "org.apache.commons" % "commons-math3" % "3.0"              
)

如果没有.sbt文件,则必须在项目目录中创建.sbt文件。

这是sbt(和tutorial

上的快速another one