我已经有几年没有编码了,现在正试图重新进入游戏。我正在尝试设置一个非常简单的 scala 项目HelloWorld并在尝试从 sbt 控制台编译时收到以下错误消息。我正在添加sbteclipse插件来生成 eclipse 项目设置。
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: com.typesafe.sbteclipse#sbteclipse-plugin;4.0.0: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn]
[warn] Note: Some unresolved dependencies have extra attributes. Check that these dependencies exist with the requested attributes.
[warn] com.typesafe.sbteclipse:sbteclipse-plugin:4.0.0 (scalaVersion=2.11, sbtVersion=0.13)
[warn]
[warn] Note: Unresolved dependencies path:
[warn] com.typesafe.sbteclipse:sbteclipse-plugin:4.0.0 (scalaVersion=2.11, sbtVersion=0.13) (/Users/michael/Development/Scala-Testings/HelloWorld/project/plugins.sbt#L3-4)
[warn] +- default:helloworld-build:0.1-SNAPSHOT (scalaVersion=2.11, sbtVersion=0.13)
sbt.ResolveException: unresolved dependency: com.typesafe.sbteclipse#sbteclipse-plugin;4.0.0: not found
我在 macOS Sierra 上,从 brew 安装了scala 版本 2.11.8和sbt 0.13.12。
项目目录结构
src
+- main
+- scala
+- HelloWorld.scala
project
+- plugins.sbt
build.sbt
build.sbt 的内容
name := "HelloWorld"
version := "1.0"
scalaVersion := "2.11.8"
plugins.sbt 的内容
logLevel := Level.Warn
addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "4.0.0")
HelloWorld.scala 的内容
object HelloWorld extends App {
def main (args Array[String]) : Unit = {
println ("HelloWorld!")
}
}