How to package war with sbt 0.10.0 ?

1,268 views
Skip to first unread message

Peter Petersson

unread,
Jun 25, 2011, 5:41:33 AM6/25/11
to lif...@googlegroups.com
Hi

Can someone point me to a resource that shows how to set up sbt 0.10.0
to package a war file ? of if it's a simple thing just post a
description her. It would be highly appreciated.

I have a basic Lift 2.4-M2 up and running on scala 2.9.0-1 with sbt
0.10.0 ( see [Lift] Lift Examples using SBT 0.10.0 ) and all is good but
I have been scanning the sbt documents and google without finding out
how to package a sbt 0.10.0 project into a war file (currently package
just makes a .jar with no web/). jetty-run works perfectly from within sbt.

I am new to sbt (I'm a maven guy) but shouldn�t this be a simple task
(to config.) and run (sbt package) or at least easy to find out how to
do (using/setting up a plug-in or what ever).

The closest I have come to a "how to" is in the README on
https://github.com/siasia/xsbt-web-plugin (at least I thought it would
help but I am not sure what this plugin do).

This is my proj build.sbt and below you will also find a
plugins/project/build.sbt (as described at xsbt-web-plugin for sbt 0.10.0)
----------------------------------------------------------------------
organization := "Lift"
name := "Lift SBT Template"
version := "0.1"
scalaVersion := "2.9.0-1"
retrieveManaged := false
logLevel := Level.Warn
jettyScanDirs := Nil

seq(webSettings :_*)

libraryDependencies ++= {
val liftVersion = "2.4-M2"
Seq(
"net.liftweb" %% "lift-webkit" % liftVersion % "compile->default",
"net.liftweb" %% "lift-mapper" % liftVersion % "compile->default",
"org.mortbay.jetty" % "jetty" % "6.1.22" % "jetty",
"junit" % "junit" % "4.5" % "test->default",
"ch.qos.logback" % "logback-classic" % "0.9.26",
"org.scala-tools.testing" %% "specs" % "1.6.8" % "test->default",
"com.h2database" % "h2" % "1.2.138"
)
}

resolvers += "Jetty Repo" at
"http://repo1.maven.org/maven2/org/mortbay/jetty"
libraryDependencies += "org.mortbay.jetty" % "jetty" % "6.1.22" %
"test->default"

----------------------------------------------------------------------
plugins/project/build.sbt
----------------------------------------------------------------------
resolvers += "Web plugin repo" at "http://siasia.github.com/maven2"

//Following means libraryDependencies += "com.github.siasia" %%
"xsbt-web-plugin" % "0.1.0-<sbt version>""
libraryDependencies <+= sbtVersion("com.github.siasia" %%
"xsbt-web-plugin" % ("0.1.0-"+_))
----------------------------------------------------------------------

best regards
Peter Petersson

Peter Petersson

unread,
Jun 25, 2011, 6:03:03 AM6/25/11
to lif...@googlegroups.com
Hi (sry if this ended up being a double post)

Sergey Trofimov

unread,
Jun 25, 2011, 7:48:38 AM6/25/11
to lif...@googlegroups.com
Hello Peter.

There is a 'package-war' SBT command.

Peter Petersson

unread,
Jun 25, 2011, 9:16:56 AM6/25/11
to lif...@googlegroups.com, Sergey Trofimov
Thank you Sergey

That's logical ;) and with a little more imagination maybe I would have
found It out my self ...
I am new to sbt and what's surprises me is that I have been totally
unsuccessfully on finding this information nether on sbt:s home nor on
the xsbt-web-plugin pages or searching google to find this. I guess
information about this command is accessible from within sbt using some
command ? (I have not found it though)

best regards
Peter Petersson

On 2011-06-25 13:48, Sergey Trofimov wrote:
> Hello Peter.
>
> There is a 'package-war' SBT command.

> --
> You received this message because you are subscribed to the Google
> Groups "Lift" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/liftweb/-/6iuBtDIahhUJ.
> To post to this group, send email to lif...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+u...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.

Sergey Trofimov

unread,
Jun 25, 2011, 11:27:11 AM6/25/11
to lif...@googlegroups.com, Sergey Trofimov
Command 'help' lists basic commands.
Command 'tasks' lists project's available tasks.

Also you can start typing command and press TAB then SBT lists possible alternatives to complete the command (I searched for the 'package-war' in this way)

Gary Hewett

unread,
Dec 20, 2014, 1:32:08 PM12/20/14
to lif...@googlegroups.com, sergey....@gmail.com
... and command 'help' should display that command 'task' just might be the droid you're looking for.. 

Peter Petersson

unread,
Dec 21, 2014, 5:05:07 AM12/21/14
to lif...@googlegroups.com

Haha, yes thanks, but this thread is more than 3 and a half year old + so problem solved ;)

--from my cell
best regards Peter Petersson

> --
> --
> 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
>
> ---

> You received this message because you are subscribed to the Google Groups "Lift" group.

> To unsubscribe from this group and stop receiving emails from it, send an email to liftweb+u...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages