Hi devs,


Clemens fixed a bug at https://jira.xwiki.org/browse/XWIKI-15163 and while 
doing so inroduced a new system property to override the location of the 
xwiki.properties file. I commented at 

Even though it’s not necessary to introduce a new system property just for the 
need of this test (it’s easy to refactor the code to not need this IMO), it 
raises the question of what we want to do to make the configuration simpler in 
XWiki (simpler config, simpler upgrades, etc).


We discussed this a few times in the past:

* March 2010: http://markmail.org/message/6cvm5hocvtbqtgp6
* June 2012: https://markmail.org/message/3aq2bjrb6a2ip2ri

Note that the June 2012 proposal was agreed.

Globally this is what we implemented since the June 2012 proposal:

* XCOMMONS-187: The Permanent Data directory resolver should support System 
Property "xwiki.data.dir". More specifically the code is here: 
* XWIKI-13867: Search xwiki.cfg in /etc/xwiki/ first. Code is here: 
* XWIKI-13868: Search xwiki.properties in /etc/xwiki/ first. Code is here: 

I’d like to note that I don’t remember discussions/proposals for 
XWIKI-13867/XWIKI-13868 and I commented on 
http://jira.xwiki.org/browse/XWIKI-13867 and didn’t get any response from my 
various comments.

Current behavior

So right now the behavior is the following on config files (I’m excluding the 
recent change of Clements, see below in actions):

* If xwiki.cfg exists under the. "java:comp/env” JNDI key, then it’s used
* If not found, then search for it in /etc/xwiki/xwiki.cfg
* If not found, then default to WEB-INF/xwiki.cfg

* If /etc/xwiki.xwiki.properties exist then it’s used
* if not found, search in WEB-INF/xwiki.properties (as a ServletContext 
* If not found, then default to an empty configuration


* I think we should ask Clemens to rollback the introduction of the 
xwiki.properties.default.dir system property and to just make the test work 
without introducing any system property. I can help Clemens do that.
* I propose that instead we continue implementing the June 2012 proposal 
defined at https://markmail.org/message/3aq2bjrb6a2ip2ri and introduce the 
xwiki.config.dir system property.
* Right now I don’t like the solution introduced by /etc/xwiki/* because they 
don’t allow supporting several instances of XWiki on the same machine. However, 
the introduction of xwiki.config.dir system property would fix it.
* We could also introduce the user home dir location as a location where xwiki 
config files would be looked for.
* We also need to generalize the config files to hibernate.cfg.xml and 
clustering config files (jgroup files), and logback. See 



PS: Sorry for the long mail, I had to do a lot of archeology to research this… 
Took me a while ;)

Reply via email to