2015-02-11 63 views
0

我有一個使用xsbt-web-plugin的項目,但我希望能夠自定義jetty設置。有沒有一種方法可以指定我自己的jetty.xml文件?我發現如何爲xsbt-web-plugin指定jetty.xml配置文件

PluginKeys.configurationFiles

設置,並設置到所需的文件,但它沒有任何效果

回答

0

可以使用config參數指定的jetty.xml配置文件到jetty()

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

如果您需要指定mul tiple配置文件,您可以將它們傳遞作爲單個--config參數:

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

退房the docs獲取更多信息。

+0

但是,這是一個build.sbt。如果我有build.scala文件怎麼辦? – user79074 2015-02-12 09:42:26

+0

對於* Build.scala *文件,您可以將其添加到'Project'的'settings':'lazy val myProj = Project(...,settings = Seq(...)++ com.earldouglas。 xwp.XwpPlugin.jetty(config = ...))' – earldouglas 2015-02-12 15:36:01

+0

我已經用[full-configuration example]更新了自述文件(https://github.com/earldouglas/xsbt-web-plugin#full-configuration-sbt - 項目)的上述。 – earldouglas 2015-02-12 16:17:30

0

我用在present.You xsbt-網絡插件2.0.2(最新版本),可以在build.sbt做到如下:

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

我希望能對你有所幫助。

相關問題