Hi,

If you want to always take config content from the features, you can user 
overwrite="true" flag.

You can override with -D (see http://blog.nanthrax.net/?p=1038 
<http://blog.nanthrax.net/?p=1038>).

I guess you are using Karaf 4.3.x right ? 

Regards
JB

> Le 20 mai 2021 à 16:33, João Assunção <[email protected]> a écrit :
> 
> Hello all,
> 
> I'm trying to use placeholders in configurations but I noticed some weird 
> behavior. Sometimes the placeholder is replaced by an empty string, in other 
> situations by the value of the property and in others not replaced at all.
> 
> One of my features contains the following configurations:
> ...
> <config name="com.atobe.ort.photo.repository.PhotoRepositoryServiceProvider" 
> append="false">
>         storageDirectory=${tzc.data}/photos
> </config>
> <config 
> name="pt.brisa.service.metrics.rrd.internal.RRDPersistenceServiceProvider" 
> append="false">
>             rrdDefFile = etc/tzc_metrics.xml
>             rrdRepository = ${tzc.data}/rrd
>             reportingInterval = 60
> </config>
> ..
>        
> When the feature is installed, with tzc.data set to "myData", sometimes i get 
> the following cfg files:
> == com.atobe.ort.photo.repository.PhotoRepositoryServiceProvider.cfg ==
> storageDirectory=${tzc.data}/photos
> org.apache.karaf.features.configKey = 
> com.atobe.ort.photo.repository.PhotoRepositoryServiceProvider
> 
> == pt.brisa.service.metrics.rrd.internal.RRDPersistenceServiceProvider.cfg ==
> rrdDefFile = etc/tzc_metrics.xml
> rrdRepository = myData/rrd
> reportingInterval = 60
> org.apache.karaf.features.configKey = 
> pt.brisa.service.metrics.rrd.internal.RRDPersistenceServiceProvider
> 
> I tried specifying the variable name in config.properties and using  the -D  
> flag
> 
> Ideally I would like the placeholder to be replaced by the actual value only 
> when the configuration is passed to the service.
> 
> What am I doing wrong ?
> 
> Thank you in advance.
> 
> Best regards,
> João Assunção
> 
> Email: [email protected] <mailto:[email protected]>
> Mobile: +351 916968984
> Phone: +351 211933149
> Web: www.exploitsys.com <http://www.exploitsys.com/>
> 
> 

Reply via email to