我不能将scala-reflect添加为依赖项。我的project/build.sbt看起来是这样的:
//the name of the project, will become the name of the war file when you run the package command.
name := "Test-SBT"
version := "1.0"
//specify which Scala version we are using in this project.
scalaVersion := "2.10.3"
libraryDependencies <++= (scalaVersion)(sv =>
Seq(
"org.scala-lang" % "scala-reflect" % "2.10.3",
"org.scala-lang" % "scala-compiler" % "2.10.3"
)
)和project/build.properties
sbt.version=0.13.0这是我的主要课程:
object Main1 extends App {
import scala.reflect.runtime.universe
val runtimeMirror = universe.runtimeMirror(getClass.getClassLoader)
//......
}上面写着object runtime is not a member of package reflect。当然,我做了“世代想法”,“干净”和其他事情。这是怎么回事?
发布于 2014-03-06 17:23:54
猜这个问题是由“笑”引起的。
build.sbt应该在根目录中。假设您正在编写的项目是用test-sbt编写的,那么您应该得到类似于以下结构的结构:
test-sbt/build.sbt
test-sbt/project 否则,build.sbt将用于创建SBT使用的“内部编译项目”。
更深层次的解释可以在SBT的docs sbt is recursive上找到。
https://stackoverflow.com/questions/22226874
复制相似问题