如何为xsbt-web-plugin指定jetty.xml配置文件

时间:2015-02-11 12:30:37

标签: scala scalatra xsbt-web-plugin

我有一个使用xsbt-web-plugin的项目,但我希望能够自定义jetty设置。有没有办法可以指定自己的jetty.xml文件?我找到了

  

PluginKeys.configurationFiles

设置并将其设置为所需文件,但没有效果

2 个答案:

答案 0 :(得分:0)

您可以使用config的{​​{1}}参数指定 jetty.xml 配置文件:

jetty()

如果需要指定多个配置文件,可以将它们作为单独的jetty(config = "etc/jetty.xml") 参数传递:

--config

查看the docs了解详情。

答案 1 :(得分:0)

我目前使用xsbt-web-plugin 2.0.2(最新版本)。您可以在build.sbt中执行以下操作:

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

我希望它对你有所帮助。