karaf-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bengt Rodehav <be...@rodehav.com>
Subject Re: Using system properties in config.properties
Date Thu, 12 Jan 2012 12:23:40 GMT
Hello JB,

No, in this case I want to be able to specify a directory that is not
related to where Karaf is installed. I get the directory from a system
property defined in either karaf.bat or in karaf-wrapper.conf depending on
whether I run Karaf from the command line or as a service.

The way I've done it currently is to set a fixed directory structure that
every installation must follow. It looks like this:

+- <applicationRoot>
    |  +- <application-version>
    |  |  \- apache-karaf-2.2.5
    |  |
    |  \- common
    |     +- etc
    |     \- log

   - <applicationRoot> is the base directory for the application
   - <applicationVersion> is the version of the application. An upgrade is
   done by creating a new directory named after the new version and installing
   my custom server into that directory.
   - Everything that needs to be preserved when upgrading the application
   is stored under the common directory

The above structure makes it easy to create customised configurations of a
standard application and still make it easy to upgrade the application.

Anyway, some customer would like the "common" directory to reside somewhere
else (not related to where Karaf is installed). This would be easier if I
could feed that location into config.properties using system properties.


2012/1/12 Jean-Baptiste Onofré <jb@nanthrax.net>

> Hi Bengt,
> you should be able to use ${karaf.home} and ${karaf.base} variables.
> Is it OK for you ?
> Regards
> JB
> On 01/11/2012 08:36 PM, Bengt Rodehav wrote:
>> I'm using Karaf 2.2.5 and the new possibility to specify ${optionals} in
>> config.properties. It's a great functionality which allows our clients
>> to optionally override the configuration that is part of our custom
>> distribution.
>> I now have another request. Currently I have this line in my
>> config.properties:
>> ${optionals} =  ../../../common/etc/custom.**properties
>> This works in a fixed directory hierarchy. I would like to be able to
>> use system properties when definining the location of my
>> custom.properties, like this:
>> ${optionals} =  ${commondir}/etc/custom.**properties
>> Currently this is not possible. Can I create a JIRA for this or is there
>> another way I can accomplish this?
>> /Bengt
> --
> Jean-Baptiste Onofré
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com

View raw message