Search code examples
jettyapache-karafkarafpax-web

How to set jetty.xml fragment bundle property in Karaf


I created a fragment host for org.ops4j.pax.web.pax-web-jetty which contains a jetty.xml file which is perfectly picked up inside Karaf.

This jetty.xml file contains a line like this:

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

Could you tell me where to set jetty.ssl.host so that I can set a value please ?

Best, Jerome


Solution

  • Afaik, it's not possible in the current version of pax-web.

    In the source, the XmlConfiguration doesn't have any property set :

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

    This kind of property (<Property ../>) is normally set using the XmlConfiguration.getProperties() method, which isn't used here.

    You should probably use another way to provide an external configuration (like systemProperty for example, or creating your own bean in this jetty.xml file).