我试图在使用sbt-web-plugin(用于运行container:start
)时为jetty创建自定义配置。有two container settings允许指定自定义码头xml配置:configurationFiles
和configurationXml
(当customConfiguration
为true时)。sbt-web-plugin:使用configurationXml指定类路径为码头
但是,这完全覆盖了由sbt-web-plugin完成的jetty的内部配置,因此自定义配置应完全配置jetty。如果没有指定classpath到项目编译的.class文件和依赖关系,它将不起作用。
我试图做这样的事情:
configurationXml in container.Configuration <<= fullClasspath (
<Configure id="Server" class="org.eclipse.jetty.server.Server">
...
<Set name="handler">
<New class="org.eclipse.jetty.webapp.WebAppContext">
<Set name="resourceBase"><SystemProperty name="jetty.home" default="."/>/src/main/webapp</Set>
<Set name="descriptor"><SystemProperty name="jetty.home" default="."/>/src/main/webapp/WEB-INF/web.xml</Set>
<Set name="contextPath">/</Set>
<Set name="extraClasspath">{/* classpath should be here */}</Set>
</New>
</Set>
...
</Configure>
)
似乎这configurationXml
上fullClasspath
直接依赖是不可能的,因为configurationXml
is SettingKey
和fullClasspath
is TaskKey
:
的实际重要性这是因为您不能将任务作为非任务设置的依赖关系。
是否可以包含fullClasspath
设置configurationXml
参数?
如果没有,是否仍然可以将自定义配置设置添加到在container:start
上调用的jetty开发服务器?
此“env”设置在哪里记录? – aij
你可以在[文档0.9版本]找到它(https://github.com/earldouglas/xsbt-web-plugin/blob/master/docs/0.9.md#web-application-settings),但这很漂亮旧的和不赞成的。我会考虑更新2.1。 – earldouglas