为什么在com.typesafe.slick中出现UNRESOLVED DEPENDENCIES错误#slick_2.11; 2.0.2:未找到?

时间:2014-08-24 19:31:15

标签: scala sbt slick

我试图从类型安全激活器运行hello光滑的示例我在sbt中创建一个项目,当我键入run它给我以下错误

warn]   ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: com.typesafe.slick#slick_2.11;2.0.2: not found
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[trace] Stack trace suppressed: run last *:update for the full output.
[error] (*:update) sbt.ResolveException: unresolved dependency: com.typesafe.slick#slick_2.11;2.0.2: not found
[error] Total time: 1 s, completed Aug 25, 2014 12:20:42 AM

这是我的build.sbt文件

name :="hellos"

version :="1.0"

scalaVersion := "2.11.1"

mainClass in Compile := Some("HelloSlick")

libraryDependencies ++= List(
  "com.typesafe.slick" %% "slick" % "2.0.2",
  "org.slf4j" % "slf4j-nop" % "1.6.4",
  "com.h2database" % "h2" % "1.3.170"
)

我使用ubuntu 12.04并且在光滑的网站上没有jar文件可供下载,所以就像它不在我的系统路径变量中,如java和akka是

1 个答案:

答案 0 :(得分:5)

您需要解压缩到类型安全存储库:

libraryDependencies ++= List(
  "com.typesafe.slick" %% "slick" % "2.0.2",
  "org.slf4j" % "slf4j-nop" % "1.6.4",
  "com.h2database" % "h2" % "1.3.170"
)

resolvers += "typesafe" at "http://repo.typesafe.com/typesafe/releases/"

编辑:

对于scala 2.11,您需要将光滑版本指定为2.1:

"com.typesafe.slick" %% "slick" % "2.1.0"