0

私は数年間コーディングをしていませんでしたが、今はゲームに戻ろうとしています。非常に単純な scala プロジェクトHelloWorldをセットアップしようとしていますが、sbt コンソールからコンパイルしようとすると、次のエラー メッセージが表示されます。Eclipse プロジェクト設定を生成するためにsbteclipseプラグインを追加していました。

[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

私は、scalaバージョン2.11.8とbrewからインストールされたsbt 0.13.12を備えたmacOS Sierraを使用しています。

プロジェクトのディレクトリ構造

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!")
    }
}
4

1 に答える 1

0

この問題は、Scala 2.11.8 がインストールされているときに、Scala バージョン 2.10.x でコンパイルされた sbt バージョン 0.13.12 に関係しています。

削除することで機能しました

addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "4.0.0")

から

project_folder/project/plugins.sbt

そして入れる

~/.sbt/0.13/plugins/plugins.sbt file.
于 2016-09-21T09:34:16.693 に答える