title: How to place bundle configuration/property file in /etc karaf folder
body: <p>I want to deploy all the configuration files of the bundles deployed in karaf be placed in the karaf <code>etc</code> folder. I want that when the bundles conf files are change are notice by the karaf. </p>
  
  <p>I have a distribution which consist of several features an example of a feature of the XML.I already tried several things e.g. I add the conf file into the feature as below, but this dose not work. </p>
  
  <pre><code>&lt;feature name="gc-backbone-mqtt" version="${linksmart.gc.version}"&gt;
      &lt;feature version="${linksmart.gc.version}"&gt;gc-backbone-router&lt;/feature&gt;
      &lt;bundle&gt;mvn:org.eclipse.paho/org.eclipse.paho.client.mqttv3/1.0.0&lt;/bundle&gt;
      &lt;feature version="${linksmart.gc.version}"&gt;gc-type-tunnelled&lt;/feature&gt;
      &lt;configfile finalname="/etc/mqttBackboneProtocol.cfg"&gt;mvn:eu.linksmart.gc/backbone.mqtt.impl/${linksmart.gc.version}/mqttprotocol.properties&lt;/configfile&gt;
      &lt;bundle&gt;mvn:eu.linksmart.gc/backbone.mqtt.impl/${linksmart.gc.version}&lt;/bundle&gt;
  &lt;/feature&gt;
  </code></pre>
  
  <p>Some of the things I have tried: </p>
  
  <p><a href="http://karaf.922171.n3.nabble.com/OSGi-bundle-configuration-file-td4025438.html" rel="nofollow noreferrer">http://karaf.922171.n3.nabble.com/OSGi-bundle-configuration-file-td4025438.html</a></p>
  
  <p><a href="http://www.liquid-reality.de/display/liquid/2011/09/23/Karaf+Tutorial+Part+2+-+Using+the+Configuration+Admin+Service" rel="nofollow noreferrer">http://www.liquid-reality.de/display/liquid/2011/09/23/Karaf+Tutorial+Part+2+-+Using+the+Configuration+Admin+Service</a> </p>
  
  <p>I don't want to copy the file with a specific path as is shown here:</p>
  
  <p>have anyone an idea how to do this?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>To achieve that the configuration file get deployed in the <code>etc</code> folder so the bundle can be reconfigured externally,  I have done it in 3 steps:</p>
  
  <p>Building the configuration file: (<strong>Works</strong>)</p>
  
  <p>To make the config file addressable by Maven I added the following part in the bundle pom. In this way the config file is deploy on the repository:</p>
  
  <p>pom.xml</p>
  
  <pre><code> &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
                  &lt;artifactId&gt;build-helper-maven-plugin&lt;/artifactId&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;id&gt;attach-artifacts&lt;/id&gt;
                          &lt;phase&gt;package&lt;/phase&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;attach-artifact&lt;/goal&gt;
                          &lt;/goals&gt;
                          &lt;configuration&gt;
                              &lt;artifacts&gt;
                                  &lt;artifact&gt;
                                      &lt;file&gt;src/main/resources/mqttprotocol.properties&lt;/file&gt;
                                      &lt;type&gt;cfg&lt;/type&gt;
                                      &lt;classifier&gt;configuration&lt;/classifier&gt;
                                  &lt;/artifact&gt;
                              &lt;/artifacts&gt;
                          &lt;/configuration&gt;
                      &lt;/execution&gt;
                  &lt;/executions&gt;
              &lt;/plugin&gt;
  
          &lt;/plugins&gt;
      &lt;/build&gt;
  </code></pre>
  
  <p>Deploy the file in the karaf <code>etc</code> (<strong>Works</strong>)</p>
  
  <p>To deploy the config file in the karaf <code>etc</code>folder I added the <code>&lt;configfile&gt;</code>in the feature file as following:</p>
  
  <p>features.xml</p>
  
  <pre><code>    &lt;feature name="gc-backbone-mqtt" version="${linksmart.gc.version}"&gt;
          &lt;feature version="${linksmart.gc.version}"&gt;gc-backbone-router&lt;/feature&gt;
          &lt;bundle&gt;mvn:org.eclipse.paho/org.eclipse.paho.client.mqttv3/1.0.0&lt;/bundle&gt;
          &lt;bundle&gt;mvn:org.apache.felix/org.apache.felix.fileinstall/3.2.8&lt;/bundle&gt;
          &lt;configfile finalname="/etc/MQTTBackboneProtocol.cfg"&gt;mvn:eu.linksmart.gc/network.backbone.protocol.mqtt.impl/${linksmart.gc.version}/cfg/configuration&lt;/configfile&gt;
          &lt;feature version="${linksmart.gc.version}"&gt;gc-type-tunnelled&lt;/feature&gt;          &lt;bundle&gt;mvn:eu.linksmart.gc/network.backbone.protocol.mqtt.impl/${linksmart.gc.version}&lt;/bundle&gt;
      &lt;/feature&gt;
  </code></pre>
  
  <p>Capture configuration change: (<strong>not working</strong>)</p>
  
  <p>To capture the change of a config file I add the code you suggested (@Donald_W). The problem is that I get just notifications of files are on the folder <code>deploy</code> but not in <code>etc</code>. I debug this code and I find out that for the files in <code>etc</code>are called specifically the "listeners" of those files. I don't know then how I can become a listener of a file deployed in the <code>etc</code></p>