Using SBT

SBT can be used to to manage a Lift project. The SBT documentation is the best place to get familiar with all of the options available with sbt.

To get started however you can just go to the getting started page which contains links to both .tar and .zip files that contain several examples are empty sbt based lift projects. The lift_basic project is a good place to start, your first time using lift.

Simply unzip/tar the downloaded file. cd into the directory and type sbt to get started.

Get dependencies

Get the dependencies listed in your project file by running the update command from the sbt console.

Note: It can take several minutes for SBT to download all the dependencies. Future updates won't take as long.

Test with Jetty

You can run your webapp with the included Jetty server. Start it with the jetty-run command from the sbt console. Your webapp will be running at http://localhost:8080. This port can be configured with e.g. override val jettyPort = 8081 The webapp can be stopped with jetty-stop.

If you want a console with access to classpath dependencies, console (this can be used while jetty is running). To run any SBT command continuously while scanning for changes, prefix it with ~: ~compile, ~test, ~test-only some.test.class, ~jetty, etc. For ~jetty, you will still have to hit return at the SBT shell to restart jetty in order to see changes. To avoid this:

override def jettyWebappPath = webappPath

If you're running with JRebel, avoid unnecessary redeploys with

override def scanDirectories = Nil

The package action will create a WAR file for when you are ready to deploy your webapp on a production server.

If everyone working on the project is using eclipse, you can put the definition in a build.sbt file in the project/plugins folder of your project.

When you have set up the plugin you can use the command eclipse with-sources in an SBT session to create Eclipse project files and then import the project into Eclipse using the Import Wizard i.e. Eclipse menu File-->Import... to import Existing Projects into Workspace. Use the same command to update your project files if you change your build.sbt to have new dependencies.