Web app support plugin for XSbt using Jetty Web Server
Scala Shell
Switch branches/tags
Nothing to show
Pull request Compare This branch is 72 commits ahead, 609 commits behind earldouglas:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
project
src
web
.gitignore
LICENSE
README.md
set-sbt-test-plugin-version.sh

README.md

Usage

Setup SBT.

Add plugin to project in project/plugins/build.sbt:

resolvers += "Web plugin repo" at "http://siasia.github.com/maven2"    
	
//Following means libraryDependencies += "com.github.siasia" %% "xsbt-web-plugin" % "0.1.1-<sbt version>""
libraryDependencies <+= sbtVersion(v => "com.github.siasia" %% "xsbt-web-plugin" % ("0.1.1-"+v))

Artifacts are available for 0.10.1 SBT versions.

Inject plugin settings into project in build.sbt:

seq(webSettings :_*)

Add other required stuff like web.xml, properties and source code.

This will add commands required to run web application. Invoke jetty-run(as in sbt 0.7) to run web application:

> jetty-run
[info] jetty-7.3.0.v20110203
[info] NO JSP Support for /, did not find org.apache.jasper.servlet.JspServlet
[info] started o.e.j.w.WebAppContext{/,file:/home/siasia/work/sample-copy/target/webapp/},/home/siasia/work/sample-copy/target/webapp
[info] Started SelectChannelConnector@0.0.0.0:8080

Web application is now accesible on http://localhost:8080

Use jetty-stop to stop Jetty and prepare-webapp to build webapp after you've done some changes:

> prepare-webapp
[success] Total time: 1 s, completed 02.05.2011 17:08:43
> [info] Reloading web application...
17:08:44.595 [Scanner-0] DEBUG net.liftweb.http.LiftServlet - Destroyed Lift handler.
[info] stopped o.e.j.w.WebAppContext{/,file:/home/siasia/work/sample-copy/target/webapp/},/home/siasia/work/sample-copy/target/webapp
[info] NO JSP Support for /, did not find org.apache.jasper.servlet.JspServlet
[info] started o.e.j.w.WebAppContext{/,file:/home/siasia/work/sample-copy/target/webapp/},/home/siasia/work/sample-copy/target/webapp
[info] Reload complete.
	
> jetty-stop
17:09:21.739 [main] DEBUG net.liftweb.http.LiftServlet - Destroyed Lift handler.
[info] stopped o.e.j.w.WebAppContext{/,file:/home/siasia/work/sample-copy/target/webapp/},/home/siasia/work/sample-copy/target/webapp

Running Lift

Please note that Jetty dependencies should go to jetty configuration instead of test as it was in 0.7.x version.

Add Lift and Jetty to project dependencies:

libraryDependencies ++= Seq(
  "net.liftweb" %% "lift-webkit" % "2.3" % "compile",
  "org.mortbay.jetty" % "jetty" % "6.1.22" % "jetty",
  "ch.qos.logback" % "logback-classic" % "0.9.26"
)

or in case if you want to use Jetty 7:

libraryDependencies ++= Seq(
  "net.liftweb" %% "lift-webkit" % "2.3" % "compile",
  "org.eclipse.jetty" % "jetty-webapp" % "7.3.0.v20110203" % "jetty",
  "ch.qos.logback" % "logback-classic" % "0.9.26"
)

Check Lift Basic Sample for further examples.

License

This software is distributed under modified 3-clause BSD license. See LICENSE for more information.