gpt4 book ai didi

scala - Intellij 中的 SBT 和外部库

转载 作者:行者123 更新时间:2023-12-04 01:02:32 24 4
gpt4 key购买 nike

我正在开始一个 Scala 项目,我使用 SBT 和 Intellij 13 作为我的 IDE。

我有以下 build.sbt 文件,但我似乎无法在运行“sbt update”后让 SBT“libraryDependencies”部分中的依赖项显示在“External Libraries”中。

以下是我的 build.sbt:

name := "myapp-scala"

version := "1.0"

scalaVersion := "2.10.3"

resolvers += "spray repo" at "http://repo.spray.io"

resolvers += "spray nightlies" at "http://nightlies.spray.io"

libraryDependencies ++= Seq(
"com.typesafe.akka" %% "akka-actor" % "2.2.0",
"com.typesafe.akka" %% "akka-slf4j" % "2.2.0",
"ch.qos.logback" % "logback-classic" % "1.0.13",
"io.spray" % "spray-can" % "1.2-20130712",
"io.spray" % "spray-routing" % "1.2-20130712",
"io.spray" %% "spray-json" % "1.2.3",
"org.specs2" %% "specs2" % "1.14" % "test",
"io.spray" % "spray-testkit" % "1.2-20130712" % "test",
"com.typesafe.akka" %% "akka-testkit" % "2.2.0" % "test",
"com.novocode" % "junit-interface" % "0.7" % "test->default",
"org.scalautils" % "scalautils_2.10" % "2.0",
"org.scalatest" % "scalatest_2.10" % "2.0" % "test"
)

scalacOptions ++= Seq(
"-unchecked",
"-deprecation",
"-Xlint",
"-Ywarn-dead-code",
"-language:_",
"-target:jvm-1.7",
"-encoding", "UTF-8"
)

任何人都可以指出我正确的方向吗?

enter image description here

最佳答案

开始使用 IDEA 13 和 sbt 的最佳方式项目是这样的:

  • 确保您拥有 sbt已安装插件

  • enter image description here
    enter image description here
    enter image description here
  • 如果你安装了它,那么只需启动一个 sbt 项目:

  • enter image description here
    enter image description here

    这应该会为您解决所有问题,您可以通过 sbt 控制台运行您的命令:

    enter image description here

    关于scala - Intellij 中的 SBT 和外部库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21208778/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com