我正在通过Lift in Action设置我的第一个电梯网络应用程序。当我在运行sbt后运行jetty命令时,我得到以下内容:
[root@localhost lift-app]# sbt
[info] Building project lift-travel 1.0 against Scala 2.8.0
[info] using LiftProject with sbt 0.7.7 and Scala 2.7.7
> jetty
[info]
[info] == copy-resources ==
[info] == copy-resources ==
[info]
[info] == compile ==
[info] Source analysis: 1 new/modified, 0 indirectly invalidated, 0 removed.
[info] Compiling main sources...
[error] /home/Ramy/lift-app/src/main/scala/bootstrap/liftweb/Boot.scala:5: value liftweb is not a member of package net
[error] import net.liftweb._
[error] ^
[error] one error found
[info] == compile ==
[error] Error running compile: Compilation failed
[info]
[info] Total time: 3 s, completed Jan 29, 2012 8:11:59 PM
如果需要,我可以发布我的配置,但我希望这已经足够了。
答案 0 :(得分:1)
我认为您需要在SBT中使用update
命令首先下载电梯JAR文件。
答案 1 :(得分:1)
使用 sbt重装,问题已为我解决。
答案 2 :(得分:0)
由于某种原因,specs库不再存在于存储库中。
除非您绝对需要规范单元测试,否则您可以注释掉依赖项。只需转到此行val specs = "org.scala-tools.testing" %% "specs" % "1.6.6" % "test->default"
:
import sbt._
class LiftProject(info: ProjectInfo) extends DefaultWebProject(info) {
val liftVersion = "2.1"
/**
* Application dependencies
*/
val webkit = "net.liftweb" %% "lift-webkit" % liftVersion % "compile->default"
val logback = "ch.qos.logback" % "logback-classic" % "0.9.26" % "compile->default"
val servlet = "javax.servlet" % "servlet-api" % "2.5" % "provided->default"
val jetty6 = "org.mortbay.jetty" % "jetty" % "6.1.22" % "test->default"
val junit = "junit" % "junit" % "4.5" % "test->default"
//val specs = "org.scala-tools.testing" %% "specs" % "1.6.6" % "test->default"
val mapper = "net.liftweb" %% "lift-mapper" % liftVersion
/**
* Maven repositories
*/
lazy val scalatoolsSnapshots = ScalaToolsSnapshots
}
然后评论出来,并且会很好地哼唱。
来自David Pollak(来自liftweb @ goolegroups邮件列表):
Scala is very version fragile. That means that a version of a library must be compiled against the same version of Scala and any other dependent libraries.
Specs bumps its version number for each Scala release. So, if you change the version of Scala, the particular version of Specs will not be found because it does not match the given version of Scala. You can find the correct version of Specs for the given version of Scala on the Specs home page: http://code.google.com/p/specs/