install lift with scala 2.8, sbt & jrebel 30. Aug 2010

Here’s how to get Lift running with Scala 2.8, SBT and JRebel on Mac OS X:

1) Download and install the JRebel nightly

$ wget --referer \
  http://www.zeroturnaround.com/jrebel/next-releases/ \
  http://www.zeroturnaround.com/downloads/jrebel-nightly-nosetup.zip
$ sudo unzip -d /usr/share/java jrebel-nightly-nosetup.zip
$ cd /usr/share/java
$ export JREBEL=jrebel-nightly-`date "+%Y-%m-%d"`
$ sudo mv jrebel $JREBEL
$ sudo ln -s $JREBEL/jrebel.jar jrebel.jar

2) Request a JRebel Scala license and copy it to the JRebel directory

$ sudo cp javarebel.lic /usr/share/java/$JREBEL

3) Install the Simple Build Tool via MacPorts.

$ sudo port install sbt

4) Edit the SBT launcher script (at /opt/local/bin/sbt)

JREBELJAR="/usr/share/java/jrebel.jar"
JAVA_OPTS="-Xmx512M -noverify"
exec java $JAVA_OPTS -javaagent:"$JREBELJAR" \
-jar "$LAUNCHJAR" $QUOTED_ARGS

5) Clone the SBT prototype of Lift to your development directory

$ git clone http://github.com/lift/lift_21_sbt.git

6) Comment in the following line in project/build/LiftProject.scala

override def scanDirectories = Nil

7) Change to the project root directory and start SBT with automatic redeployment

$ sbt
> update
> jetty-run
> ~ prepare-webapp

8) Open http://localhost:8080/ in your favorite browser

9) Make a change to src/main/webapp/index.html and refresh your browser

10) Enjoy productivity!