Running a (Lift) web-application with jetty-run without the need to re-prepare webapp?

205 views
Skip to first unread message

trond...@gmail.com

unread,
Jun 8, 2011, 2:31:01 PM6/8/11
to simple-build-tool
Hi.

I am trying to setup a new Lift-project using sbt 0.10, and I can't
figure out how to set up my environment so I can edit a resource
(html, js, css, whatever) and instantly reload the file in my browser.
The settings I used on 0.7.x (running with JRebel) was:

override def scanDirectories = Nil
override def jettyWebappPath = webappPath

How should I replicate this using 0.10.0?
My full build.sbt is:
###

seq(WebPlugin.webSettings :_*)

scalaVersion := "2.9.0-1"

libraryDependencies ++= Seq(
"net.liftweb" %% "lift-webkit" % "2.4-M1" % "compile" withSources(),
"ch.qos.logback" % "logback-classic" % "0.9.26"
)

libraryDependencies ++= Seq(
"org.scalaquery" % "scalaquery_2.9.0" % "0.9.4" withSources(),
"com.h2database" % "h2" % "1.3.155"
)

libraryDependencies ++= Seq(
"org.eclipse.jetty" % "jetty-webapp" % "7.3.0.v20110203" % "jetty",
"org.specs2" %% "specs2" % "1.4" % "test" withSources()
)
###


Thanks,
Trond Marius

Raphael

unread,
Jun 14, 2011, 4:04:42 AM6/14/11
to simple-build-tool
I am need of exactly the same...did you perhaps found the answer yet?

On Jun 8, 8:31 pm, "tr...@ovstetun.no" <trondmar...@gmail.com> wrote:
> Hi.
>
> I am trying to setup a new Lift-project using sbt0.10, and I can't
> figure out how to set up my environment so I can edit a resource
> (html, js, css, whatever) and instantly reload the file in my browser.
> The settings I used on 0.7.x (running withJRebel) was:

Trond Marius Øvstetun

unread,
Jun 14, 2011, 4:16:35 AM6/14/11
to simple-b...@googlegroups.com
Don't know if this is the best solution, but I just this morning tried the following (which seems to work using sbt+jrebel):

in my build.sbt I have 
####
jettyScanDirs := Nil
####

And when running sbt I do:
jetty-run
~ prepare-webapp

Then it seems jetty detects the changes in my static files, as well as jrebel picking up my changed .class-files. Both without the need to reload the webapp in jetty (if you remove the line from build.sbt jetty will restart the webapp on each change).

Hope this helps, and if anyone has better solutions please do tell :)

Regards,
/trondmarius

--
You received this message because you are subscribed to the Google Groups "simple-build-tool" group.
To post to this group, send email to simple-b...@googlegroups.com.
To unsubscribe from this group, send email to simple-build-t...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/simple-build-tool?hl=en.




--
TronD

Raphael Parree

unread,
Jun 14, 2011, 4:53:58 AM6/14/11
to simple-b...@googlegroups.com
i can confirm this works indeed ( thanks, I did not think to try the obvious)...

2011/6/14 Trond Marius Øvstetun <tr...@ovstetun.no>



--
Raphael


drwho

unread,
Jul 4, 2011, 11:23:52 AM7/4/11
to simple-b...@googlegroups.com
this still requires a "~ prepare-webapp" to run which is not quite the same as running jetty out of source (as mentioned in the old sbt7.5 wiki) — to get that working you need to modify the jettyConfiguration task. i've posted a blog entry at http://bit.ly/mt3Pqu, describing how to do this. have fun.
Message has been deleted

Alex Siman

unread,
Sep 28, 2011, 7:25:20 AM9/28/11
to simple-b...@googlegroups.com
UPD: I succeeded with next lines in build.sbt:

temporaryWarPath <<= (sourceDirectory in Runtime) / "webapp"
jettyScanDirs := Nil
Reply all
Reply to author
Forward
0 new messages