Ideally, I would like to
have self serving .war with embedded jetty, so that each app is self
contained and has its own container - preferably jetty 8. Also I
noticed when running jetty from sbt, webapp takes much less memory
(not sure why) and my current vps is "economy class" so
this matters. This is pretty big difference. I run same app through
xsbt and it claimed about 100MB ram. In standalone
jetty-hightide-8.1.1.v20120215 it was over 1GB, maybe I messed
something up, or default config is bloated. Anyway, I would like to
have independent containers to gain flexibility. There is some info
on the net on embedding jetty, but I found no working example. I
found this plugin for sbt, but it doesn't build and seems a bit
outdated too: https://github.com/glenford/xsbt-war-plugins
Maybe
someone here already has some experience, how best to do that?
Another approach that comes to my mind, is that I could use sbt
on my server, to run each app from independent sbt instance with
xsbt-web-plugin, but this adds sbt to the stack (maybe it's nothing
wrong). Is it wise to use sbt this way in production (I don't have
big traffic) ? I already figured out, how to enforce production mode
from the Boot and how to change port number for sbt jetty instance,
so maybe it would be ok. I would have to make different proxy pass
settings in nginx for each sbt instance, but I guess this can't be
avoided with self contained war too. Any hint will be greatly
appreciated. Please share your opinions.
--
--
Lift, the simply functional web framework: http://liftweb.net
Code: http://github.com/lift
Discussion: http://groups.google.com/group/liftweb
Stuck? Help us help you: https://www.assembla.com/wiki/show/liftweb/Posting_example_code
// This resolver declaration is added by default SBT 0.12.x
resolvers += Resolver.url(
"sbt-plugin-releases",
new URL("http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-releases/")
)(Resolver.ivyStylePatterns)
What was left to have one-jar work was to add in build.sbt
seq(com.github.retronym.SbtOneJar.oneJarSettings: _*)
mainClass in oneJar := Some("com.selfserve.Start")
Thanks for this!
Does this bypass the lift bootstrap?
--
You can avoid the zip step by adding this to your build.sbt file:
resourceGenerators in Compile <+= (resourceManaged, baseDirectory) map
{ (managedBase, base) =>
val webappBase = base / "src" / "main" / "webapp"
for {
(from, to) <- webappBase ** "*" x rebase(webappBase, managedBase /
"main" / "webapp")
} yield {
Sync.copy(from, to)
to
}
}
then assembly will include the webapp folder in the jar (just tried it)
I'll play around with this a bit more and then I'll add it to the
wiki, thanks Olek for looking into it!
Cool, about logback, it is not lift, but logback itself the one who decides which xml to read, maybe they use a different-D option
Diego
Diego
Sent from my android cell
--
One thing I haven't figured out yet is a way to modify a props file after I made my jar file. I know I can read system properties, but I would like to just modify my file, until I find the option I like.
Thanks
Diego
Sent from my android cell