spa*_*rkr 3 scala sbt read-eval-print-loop
我有一个包含以下内容的 SBT 文件:
name := "Scala Playground"
version := "1.0"
scalaVersion := "2.11.6"
resolvers += "Typesafe Repo" at "http://repo.typesafe.com/typesafe/releases/"
libraryDependencies ++= Seq(
"com.netflix.rxjava" %% "rxjava-scala" % "0.19.1",
"com.typesafe.play" %% "play-json" % "2.2.1"
)
Run Code Online (Sandbox Code Playgroud)
保存为 scala-playground.sbt。我想在我的 Scala REPL 中使用它。当我尝试执行以下操作时:
sbt scala-playground.sbt
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
[info] Set current project to Scala Playground (in build file:/home/joe/Desktop/)
[error] Not a valid command: scala-playground
[error] Not a valid project ID: scala-playground
[error] Expected ':' (if selecting a configuration)
[error] Not a valid key: scala-playground (similar: scala-version, scalac-options, scala-binary-version)
[error] scala-playground
[error] ^
Run Code Online (Sandbox Code Playgroud)
我在 sbt 文件中看不到任何愚蠢的东西。有人可以对此有所了解吗?这是在我的 Scala REPL 中获取依赖项的正确方法吗?
我想要做的就是在我的 Scala REPL 中加入一些依赖项,以便我可以快速运行和评估某些库。
命令行参数是sbt命令,而不是您要使用的文件。只需转到包含scala-playground.sbt文件的目录并从那里运行:
sbt console
Run Code Online (Sandbox Code Playgroud)
sbt应该自动scala-playground.sbt从当前目录加载文件并打开 Scala 控制台。
| 归档时间: |
|
| 查看次数: |
430 次 |
| 最近记录: |