If you are like me an eternal beginner on the Lift Web Framework, after starting a few attempts you probably think that perhaps maven lift archetypes are sometimes really slow process to start a liftweb project, and also that you need something more intuitive as Rails or Grails. Most of the time, when I am using maven, I need to look on the documentation again and again. So I have decided that I would like to use other option such as the Simple Build Tool.

First, we are going to install sbt. I have already made a small tutorial of how to install sbt for Mac OS X Leopard users, which is located here

Once the SBT tool has finally been installed, we proceed to create the lift project structure, there are 2 ways to create a Lift Project, the first one to create a new project by the traditional means using maven:

Then use sbt to manage the rest. We later build the sbt project. However, this way of working is precisely what I want to avoid.

The other option is to use git and download the lift-sbt-prototype from the LiftWeb Prototype Site. If you have not downloaded git, I would suggest two options or either find at Google a good tutorial of how to do it or the other option is to wait for new tutorial where we explain how we install it in Eclipse.

We clone the project repository using the following command:

git clone git://github.com/lift/lift_sbt_prototype.git

git clone git://github.com/lift/lift_sbt_prototype.git

But there is a better option, which is using Lifty. Lifty is a SBT processor for generating files associated with the Lift framework. It is a open source project created by Mads Hartmann, which is based on a sbt framework called Lifty engine, which we will describe another day.

Lifty site

mkdir lifty_test
cd lifty_test
sbt

mkdir lifty_test
cd lifty_test
sbt

Once we enter the sbt command the following message will appear:

SBT Project Creation Line

If we select the option Y and we then to enter commands to fill the parameters appear:

Name:liftytest

Organization:org.lifty

Version [1.0]:1

Scala version [2.7.7]: 2.8.0

sbt version [0.7.4]: 0.7.4

Here we can see an screenshot of the process:

Screenshot from sbt project creation process

This means that we have created a normal scala project, where we have filled the necessary fields
We then enter the following command at the sbt prompt which are located on this page: http://lifty.github.com/Lifty/:

*lifty is org.lifty lifty 1.3

This command download the lifty processor.

To test it, we are going to enter the following command.

lifty help

The lifty processor is quite simple, supporting the following commands:

help: This will list all of the available commandstemplates: This will list all of the available templatescreate: This will attempt to create on of the templates

lifty create project

This command creates all the structure needed to execute the project. Even it creates the command.

As a tip, I would recommend adding are going to add the following dependencies which I consider very valuable.

"net.liftweb"%%"lift-widgets"% liftVersion %"compile->default",

"net.liftweb" %% "lift-widgets" % liftVersion % "compile->default",

Once we add it we have to save the file and use the sbt reload command again.
To summarize:
a) We create the folder with the name of the project we want to create
b) We access to the folder and we then use the sbt command
c) Instead of filling it

3 thoughts on “Create a LiftWeb project with Simple Build Tool”

Thanks, I’m a lift beginner and I was confused about maven and sbt when using lift. Your blog was very informative. But just to clarify, I would have to install sbt, then the lifty plugin for sbt, then use lifty to create the project.. right?Does that mean that one does not have to install maven or download the liftweb prototype when using sbt+lifty?

You could alternative use maven or sbt. Lifty is a sbt plugin which add a usability layer. Best thing about Maven is that is a more mature application and it is used for building Java projects. Sbt initially was more straight forward to use for building lift compared with Maven.