【发布时间】:2015-02-11 12:30:37
【问题描述】:
我有一个使用 xsbt-web-plugin 的项目,但我希望能够自定义码头设置。有没有办法可以指定我自己的 jetty.xml 文件?我找到了
PluginKeys.configurationFiles
设置并将其设置为所需的文件,但没有效果
【问题讨论】:
标签: scala scalatra xsbt-web-plugin
我有一个使用 xsbt-web-plugin 的项目,但我希望能够自定义码头设置。有没有办法可以指定我自己的 jetty.xml 文件?我找到了
PluginKeys.configurationFiles
设置并将其设置为所需的文件,但没有效果
【问题讨论】:
标签: scala scalatra xsbt-web-plugin
您可以使用 config 参数指定 jetty.xml 配置文件到 jetty():
jetty(config = "etc/jetty.xml")
如果您需要指定多个配置文件,您可以将它们作为单独的--config 参数传递:
jetty(args = Seq
"--config", "jetty.xml"
, "--config", "jetty-https.xml"
, "--config", "jetty-ssl.xml"
))
查看the docs 了解更多信息。
【讨论】:
Project的settings:lazy val myProj = Project(..., settings = Seq(...) ++ com.earldouglas.xwp.XwpPlugin.jetty(config = ...))
我目前使用的是xsbt-web-plugin 2.0.2(最新版本)。你可以在build.sbt中做如下:
enablePlugins(JettyPlugin)
containerConfigFile in Compile := Some(file("./src/main/webapp/WEB-INF/jetty-env.xml"))
希望对你有帮助。
【讨论】: