2012-01-30 95 views
0

我正在运行Lift in Action设置我的第一个电梯网络应用程序。当我运行SBT后运行码头命令,我得到如下:启动电梯时出现故障

[[email protected] 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

由于某些原因,规格库不在存储库中了。

除非你绝对需要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 
} 

兼评出来,SBT将很好地跟着哼唱。

从大卫·波拉克(从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/ 
1

我想你需要在SBT中使用update命令先下载电梯JAR文件。

+0

第一次尝试运行更新。这是一个版本控制问题。 – Ramy 2012-02-01 17:31:51