Oracle GlassFish Server 3.0.1 Scripting Framework Guide

Chapter 4 Scala and Lift

Scala is a general purpose programming language designed to express common programming patterns in a concise, elegant, and type-safe way. It smoothly integrates features of object-oriented and functional languages. It is also fully interoperable with Java. For details, see http://www.scala-lang.org/.

Lift is an expressive and elegant framework for writing web applications using Scala. Lift stresses the importance of security, maintainability, scalability, and performance, while allowing for high levels of developer productivity. For details, see http://liftweb.net/.

Using Scala and Lift

It is common practice to start a Lift web application using Maven. Maven is a software project management and comprehension tool. Based on the concept of a project object model (POM), Maven can manage a project's build, reporting, and documentation from a central information source. For details, see http://maven.apache.org/.

To create a new Lift project, use Maven interactively in one of the following three ways:


mvn archetype:generate -DarchetypeCatalog=http://scala-tools.org/

Or:


mvn org.apache.maven.plugins:maven-archetype-plugin:1.0-alpha-7:create \ 
 -DarchetypeGroupId=net.liftweb                             \
 -DarchetypeArtifactId=lift-archetype-blank                 \
 -DarchetypeVersion=0.7.1                                   \
 -DremoteRepositories=http://scala-tools.org/repo-releases  \
 -DgroupId=__my.liftapp__ -DartifactId=__liftapp__

Or:


mvn org.apache.maven.plugins:maven-archetype-plugin:1.0-alpha-7:create \ 
 -DarchetypeGroupId=net.liftweb                             \
 -DarchetypeArtifactId=lift-archetype-basic                 \
 -DarchetypeVersion=0.7.1                                   \
 -DremoteRepositories=http://scala-tools.org/repo-releases  \
 -DgroupId=__my.liftapp__ -DartifactId=__liftapp__

After coding your application, build the WAR file using the mvn package command. Then deploy the WAR file to the Oracle GlassFishTM Server as you would any other web application.