2013-04-26 116 views
0

我已經開始與演員的工作,並在之後的Getting Started Guide.阿卡遷移從2.0到2.1

規格一個簡單的例子如提及: 斯卡拉版本:2.9.2

阿卡版本:2.0

我跑過這個例子,它運行良好。然後,我改變由sbt構建腳本:

name := "PracAkka"

scalaVersion := "2.9.2"

resolvers += "Typesafe Repository" at " http://repo.typesafe.com/typesafe/releases/ "

libraryDependencies += "com.typesafe.akka" % "akka-actor_2.10" % "2.1.2"

即我開始使用Akka 2.1.2。有一些小的變化,並根據migration guide,我做出了各自的變化。但我仍然得到以下錯誤:

class file needed by Props is missing. reference type ClassTag of package reflect refers to nonexisting symbol.

我需要改變什麼?

回答

1

從SBT documentation

If you use groupID %% artifactID % revision rather than groupID % artifactID % revision (the difference is the double %% after the groupID), sbt will add your project's Scala version to the artifact name. This is just a shortcut. You could write this without the %%:

libraryDependencies += "org.scala-tools" % "scala-stm_2.9.1" % "0.3"

Assuming the scalaVersion for your build is 2.9.1, the following is identical:

libraryDependencies += "org.scala-tools" %% "scala-stm" % "0.3"

The idea is that many dependencies are compiled for multiple Scala versions, and you'd like to get the one that matches your project.

你的腳本似乎在"akka-actor_2.10"越來越阿卡斯卡拉2.10嘗試重命名爲您的斯卡拉版本。