You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Christoper Blunck <ch...@thebluncks.com> on 2010/10/21 22:49:15 UTC

Overriding configurations from within a feature file

Hello,

I'm upgrading from Karaf 1.4.0 to 2.1.0 and I've encountered a behavior that
appears to be inconsistent. I wanted to write and if I understand the
intended behavior.

I have a feature file that looks like this:
<features>
  <feature name="myfeature" version="1.0.0">
    <config name="myconfig">
      a=b
    </config>
    <config name="org.ops4j.pax.url.mvn">
      c=d
      org.ops4j.pax.url.mvn.repositories=http://myserver/maven2/repository
    </config>
  </feature>
</features>


Under Karaf 1.4.0 when I installed the above feature I'd see 2
configurations:  myconfig and org.ops4j.pax.url.mvn.  The contents of my
org.ops4j.pax.url.mvn configuration were overlayed on top of the
configurations found in ${karaf.home}/etc/org.ops4j.pax.url.mvn.cfg.  That
is, when I ran config:list and examined org.ops4j.pax.url.mvn I saw all of
the configurations in ${karaf.home}/etc/org.ops4j.pax.url.mvn.cfg EXCEPT the
org.ops4j.pax.url.mvn.repositories value was set to the value I specified in
my feature file.  In summary ... the configurations from my feature file
overlayed the configurations from ${karaf.home}/etc.

Under Karaf 2.1.0 this does not seem to be the case.  When I install the
above feature I indeed see "myconfig" (so I know the feature configuration
setter/loader is doing it's job) but when I look at org.ops4j.pax.url.mvn I
do not see c=d and I do not see org.ops4j.pax.url.mvn.repositories pointing
towards myserver.  The value of org.ops4j.pax.url.mvn.repositories is the
same value as what is stored in ${karaf.home}/etc/org.ops4j.pax.url.mvn.cfg
(the public maven repositories).

Was this an intentional change?

Is there a way to change the behavior of Karaf so that configurations from
my feature files override configurations from ${karaf.home}/etc ?

I'd really like to run my application inside an unmodified Karaf 2.1.0
container and perform as many of my overrides as possible in my feature
file.  That would be significantly easier than fielding a feature file along
with several configuration changes to Karaf that need to be made in
${karaf.home}/etc and that would possibly pollute the container for the next
application that comes along.


Thank you for your time,

-c

-- 
Christopher Blunck
chris@thebluncks.com