Hi Simon,
a feature can contain (it's your choice):
- <config/> element to update a configuration. For instance:
<config name="my.config.pid">
key=value
</config>
will create or update the my.config.pid configuration (so
etc/my.config.pid.cfg if the file exists).
- <configfile/> element to directly provision a configuration file. For
instance:
<configfile finalname="/etc/myfile.cfg">URL</configfile>
will create (not overwrite by default) the etc/myfile.cfg file by
copying from the given URL (a file:, http:, mvn: URL).
You can find details in the user guide:
http://karaf.apache.org/manual/latest/users-guide/provisioning.html
In Karaf 3.0.0 (it will change in 3.0.1 as it was in 2.x), the creation
of a config doesn't create the corresponding cfg file. The config has to
contain the felix.fileinstall.file property to be flush back to the
configuration file.
Regards
JB
On 04/09/2014 01:32 PM, siwatson wrote:
Hi, I've been experimenting with referencing configuration key-values pair in
my own feature file. I would like to be able to update config data when
deploying a new version of a feature (uninstalling old feature version first
if required).
I've tried a few approaches - copying a .cfg file into Karaf's /etc dir,
putting <config> tags in my feature XML, and referencing a .cfg maven
artefact in my feature.
Using the console config commands, I seem to see a feature's config data
persisting after the feature is uninstalled. I'm guessing this then causes
updated config data to not be picked up when I subsequently install a new
version of the feature.
When I either manually deploy a .cfg file in /etc or reference a maven
config artefact which results in a local file being created (but not removed
after feature uninstall), deleting the local cfg file does remove the config
data.
Is this a bug or expected behaviour?
Thanks,
Simon.
--
View this message in context:
http://karaf.922171.n3.nabble.com/Can-config-values-be-updated-when-installing-a-new-feature-version-tp4032653.html
Sent from the Karaf - User mailing list archive at Nabble.com.
--
Jean-Baptiste Onofré
[email protected]
http://blog.nanthrax.net
Talend - http://www.talend.com