xsbt-web-plugin and sbt 1.0.0

103 views
Skip to first unread message

Andrew Bucknell

unread,
Aug 2, 2017, 9:06:40 AM8/2/17
to Lift
I know its not strictly a lift question, but I'm trying ti figure out how to use xsbt-web-plugin with sbt 1.0.0 and was wondering if anyone had any pointers to working examples? Currently all I have is confusion and a broken build so any pointers appreciated.

Matt Farmer

unread,
Aug 2, 2017, 9:48:10 AM8/2/17
to Lift
@Joe: Didn't you get this working recently?

On Wed, Aug 2, 2017 at 9:06 AM Andrew Bucknell <andrew....@gmail.com> wrote:
I know its not strictly a lift question, but I'm trying ti figure out how to use xsbt-web-plugin with sbt 1.0.0 and was wondering if anyone had any pointers to working examples? Currently all I have is confusion and a broken build so any pointers appreciated.

--
--
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.
Message has been deleted

Andrew Bucknell

unread,
Aug 3, 2017, 7:24:45 AM8/3/17
to lif...@googlegroups.com
Thanks for sharing Dave. Did you have to include the plugin in project/plugins.sbt?

On Thu, Aug 3, 2017 at 3:56 AM, Dave Price <david...@outlook.com> wrote:
Hi Andrew:

I believe 3.X is the current version of xsbt-web-plugin.  However, if I correctly recall, 1.0.0 was when the major changes happened.  Here is part of my build.sbt that is using xsbt-web-plugin 3.0.0:

name := "webapp"

organization := "com.myorg"

version := "0.4.5"

scalaVersion := "2.11.11"

scalacOptions ++= Seq(
  "-target:jvm-1.8",
  "-encoding", "UTF-8",
  "-feature",
  "-unchecked",
  "-deprecation",
  "-Xfuture",
  "-Yno-adapted-args",
  "-Ywarn-dead-code",
  "-Ywarn-numeric-widen",
  "-Ywarn-unused",
  "-Ywarn-unused-import"
)

libraryDependencies ++= Dependencies.webApp

// enable Jetty for xsbt-web-plugin
enablePlugins(JettyPlugin)

// Control version of Jetty used by xsbt-web-plugin
containerLibs in Jetty := Seq(Library.jettyRunner intransitive())

containerMain in Jetty := "org.eclipse.jetty.runner.Runner"

// xsbt-web-plugin - copy css and js assets to Web App Directory
webappPostProcess := {
	webAppDir =>
		IO.copyFile(
      target.value / "web" / "less" / "main" / "public" /"css" / "styles.min.css",
      webAppDir / "public" / "css" / "styles.min.css"
    )
}


https://gist.github.com/davenatx/580d64684dde7a89a3dbea9fa94eaa28


Dave


On Wednesday, August 2, 2017 at 8:06:40 AM UTC-5, Andrew Bucknell wrote:
I know its not strictly a lift question, but I'm trying ti figure out how to use xsbt-web-plugin with sbt 1.0.0 and was wondering if anyone had any pointers to working examples? Currently all I have is confusion and a broken build so any pointers appreciated.

--
--
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 a topic in the Google Groups "Lift" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/liftweb/9EiF74X0TBA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to liftweb+unsubscribe@googlegroups.com.

Dave Price

unread,
Aug 3, 2017, 7:53:58 AM8/3/17
to Lift
Hi Andrew:

I apologize. I misread your post and saw xsbt-web-plugin and thought you were asking about the 0.X to 1.0 version of that.  As soon as I replied on the group I realized my mistake and removed my response.  However, it obviously went out via email ;).   Unfortunately, I have not had the pleasure of moving my projects to SBT 1.0 yet.  Sorry about the confusion.

Dave
To unsubscribe from this group and all its topics, send an email to liftweb+u...@googlegroups.com.

Andrew Bucknell

unread,
Aug 3, 2017, 8:56:35 AM8/3/17
to lif...@googlegroups.com
Thanks Dave. I suspect most of my problems are actually related to xsbt-web-plugin 0.x -> 1.0 issues as I was still on 0.9.0. What you shared was useful so im glad it made it  out :) 

To unsubscribe from this group and all its topics, send an email to liftweb+unsubscribe@googlegroups.com.

j...@joescii.com

unread,
Aug 21, 2017, 9:58:55 AM8/21/17
to Lift
Andrew,

Did you get everything figured out? I'm pretty sure this project uses a modern version of xsbt-web-plugin. I just can't tell because the eclipse brought on some issues at github it seems.

Joe

Matt Farmer

unread,
Aug 21, 2017, 10:28:58 AM8/21/17
to Lift
FYI I also modernized our xsbt-web-plugin usage in the giter8 templates when I released them too. :)

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.

Henrik Härkönen

unread,
Sep 7, 2017, 5:09:21 AM9/7/17
to Lift
Hi Joe!

Very nice example of using the native packager, I like it!

Just one question, how do you implicate for the plugin to find the bootstrap.liftweb.Start as the main entry point? Or is it automatic through the signature, "extends App"?

-Henrik

j...@joescii.com

unread,
Sep 14, 2017, 8:07:25 AM9/14/17
to Lift
Henrik,

Have you figured out your question? In my experience with native packager, it will dump a launch script for every entry point it finds in the source. So extending App with Start should be sufficient.

You can tip sbt to know what your primary main class is, but it doesn't change native packager's behavior: 
mainClass in Compile := Some("bootstrap.liftweb.Start")

Also make sure you are configuring native packager to set the run mode for your app:
com.typesafe.sbt.packager.Keys.bashScriptExtraDefines += """addJava "-Drun.mode=development""""


Joe

Henrik Härkönen

unread,
Sep 14, 2017, 8:17:43 AM9/14/17
to lif...@googlegroups.com
Hi Joe!

Yes, I kind of assumed so, because when I tried it, it just magically worked. :) But good to know that if I would have more such entry points, there will be separate startup scripts for them as well! Thanks!

-Henrik


Reply all
Reply to author
Forward
0 new messages