0

I have a project that uses the xsbt-web-plugin but I want to be able to customise the jetty settings. Is there a way I can specify my own jetty.xml file? I found the

PluginKeys.configurationFiles

setting and set that to the desired file but it had no effect

user79074
  • 4,937
  • 5
  • 29
  • 57

2 Answers2

0

You can specify a jetty.xml config file using the config argument to jetty():

jetty(config = "etc/jetty.xml")

If you need to specify multiple config files, you can pass them as individual --config arguments:

jetty(args = Seq
    "--config", "jetty.xml"
  , "--config", "jetty-https.xml"
  , "--config", "jetty-ssl.xml"
))

Check out the docs for more info.

earldouglas
  • 13,265
  • 5
  • 41
  • 50
  • But that is for a build.sbt. What if I have a build.scala file? – user79074 Feb 12 '15 at 09:42
  • For a *Build.scala* file, you can add it to the `settings` of the `Project`: `lazy val myProj = Project(..., settings = Seq(...) ++ com.earldouglas.xwp.XwpPlugin.jetty(config = ...))` – earldouglas Feb 12 '15 at 15:36
  • I have updated the readme with a [full-configuration example](https://github.com/earldouglas/xsbt-web-plugin#full-configuration-sbt-projects) of the above. – earldouglas Feb 12 '15 at 16:17
  • I am using it in the scalatra project and cannot get version 1.0.0 to compile with scalatra. See: http://stackoverflow.com/questions/25991296/xsbt-plugin-1-0-0-m7-and-scalatra – user79074 Feb 14 '15 at 11:53
0

I use xsbt-web-plugin 2.0.2(the latest version) at present.You can do in build.sbt as following:

enablePlugins(JettyPlugin) 
containerConfigFile in Compile := Some(file("./src/main/webapp/WEB-INF/jetty-env.xml"))

I hope it can be helpful for you.

lavenderx
  • 630
  • 6
  • 7