scalalift

trouble starting lift


I'm running through setting up my first lift web-app from Lift in Action. When I run the jetty command after running sbt, I get the following:

[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

I can post my config if need be but i'm hoping this is enough.


Solution

  • For some reason the specs library isn't in the repository anymore.

    Unless you absolutely need specs unit testing you can comment out the dependency. Simply go to this line 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
    }
    

    And comment it out and sbt will hum along nicely.

    From David Pollak (from liftweb@goolegroups mailing list):

    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/