如何在 Karaf 中设置 jetty.xml 片段包 属性

How to set jetty.xml fragment bundle property in Karaf

我为 org.ops4j.pax.web.pax-web-jetty 创建了一个片段宿主,其中包含一个 jetty.xml 文件,该文件在 Karaf 中完美获取。

这个 jetty.xml 文件包含这样一行:

<Set name="host"><Property name="jetty.ssl.host" deprecated="jetty.host" /></Set>

你能告诉我在哪里设置 jetty.ssl.host 以便我可以设置一个值吗?

最好的, 杰罗姆

Afaik,在当前版本的 pax-web 中是不可能的。

source 中,XmlConfiguration 没有任何 属性 集:

XmlConfiguration configuration = new XmlConfiguration(jettyResource);
// configuration.configure(m_server);
Method method = XmlConfiguration.class.getMethod("configure", Object.class);
method.invoke(configuration, server);

这种属性(<Property ../>)一般是用XmlConfiguration.getProperties()的方式设置的,这里不使用

您可能应该使用另一种方式来提供外部配置(例如 systemProperty,或者在此 jetty.xml 文件中创建您自己的 bean)。