Scala 如何为xsbt web插件指定jetty.xml配置文件

Scala 如何为xsbt web插件指定jetty.xml配置文件,scala,scalatra,xsbt-web-plugin,Scala,Scalatra,Xsbt Web Plugin,我有一个使用xsbt web插件的项目,但我希望能够定制jetty设置。有没有办法指定自己的jetty.xml文件?我找到了 PluginKeys.configurationFiles 设置并将其设置为所需的文件,但不起作用您可以使用config参数指定jetty.xml配置文件到jetty(): 如果需要指定多个配置文件,可以将其作为单个--config参数传递: jetty(args = Seq "--config", "jetty.xml" , "--config", "jet

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

PluginKeys.configurationFiles

设置并将其设置为所需的文件,但不起作用

您可以使用
config
参数指定jetty.xml配置文件到
jetty()

如果需要指定多个配置文件,可以将其作为单个
--config
参数传递:

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

查看更多信息。

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

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

我希望它能对您有所帮助。

但这是一个build.sbt。如果我有一个build.scala文件怎么办?对于build.scala文件,您可以将其添加到
项目的
设置中:
lazy val myProj=Project(…,settings=Seq(…)++com.earldouglas.xwp.XwpPlugin.jetty(config=…)
我已使用上述内容更新了自述文件。我正在scalatra项目中使用它,无法使用scalatra编译1.0.0版。见:
enablePlugins(JettyPlugin) 
containerConfigFile in Compile := Some(file("./src/main/webapp/WEB-INF/jetty-env.xml"))