Uploaded image for project: 'Karaf'
  1. Karaf
  2. KARAF-2453

Using features to extend existing configuration

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.4.0, 3.0.2, 4.0.0.M3
    • Component/s: karaf
    • Labels:
      None

      Description

      for me it looks like that there is currently no way to extend an existing configuration file by installing a feature. But this is, what I would need for my use case and what would be great IMHO for other users as well.

      Here is my idea.

      If a property already exists within a configuration file this property should not be changed. But if a configuration file does not contain a certain key, this key=value should be added at the end of the configuration file.

      Example:
      <config name="com.foo.bar">
      myProperty = myValue
      </config>

      If com.foo.bar.cfg does not contain myProperty before the feature containing this example was installed, then myProperty=myValue should be added to com.foo.bar.cfg file.

      This would make it possible to extend existing configuration files for custom needs. A general use-case could be logging. My application would like to add a logger configuration in case this logger is not configured already.

      2. Example
      <config name="org.ops4j.pax.logging">
      log4j.logger.org.apache.activemq.broker.util.LoggingBrokerPlugin=INFO, stdout, osgi:VmLogAppender
      </config>

        Attachments

          Activity

            People

            • Assignee:
              achim_nierbeck Achim Nierbeck
              Reporter:
              jan4talend Jan Bernhardt
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: