[英]Scala REPL import SBT file
我有一個包含以下內容的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"
)
另存為scala-playground.sbt。 我想在我的Scala REPL中使用它。 當我嘗試執行以下操作時:
sbt scala-playground.sbt
我收到以下錯誤:
[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] ^
我的sbt文件中看不到任何愚蠢的東西。 有人可以給它一些啟示嗎? 這是在我的Scala REPL中獲取依賴關系的正確方法嗎?
我要做的就是在Scala REPL中獲得一些依賴,以便我可以快速運行和評估某些庫。
命令行參數是sbt
命令,而不是您要使用的文件。 只需轉到帶有scala-playground.sbt
文件的目錄,然后從那里運行:
sbt console
sbt
應該從當前目錄自動加載scala-playground.sbt
文件並打開Scala控制台。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.