-
1. Re: Application settings
lehvolk Oct 18, 2012 7:49 AM (in response to hwangarias)Hi.
One of my application has huge configuration stored in xml and this configuration depends on deployment enviroment (on test servers, local machines, production etc). Main idea was to store configuration outside deployment (for example into {JBOSS_HOME}/standalone/conf/app_conf/ folder). Problem was to manage configuration inside different enviroments. Solution was to manage this configuration during application building. So sources contatains all kind off configuration and when someone wants to deploy application, he runs build in special profile and specified profile configuration overrides default (build result was the configuration folder and deployment). I think it's best solution for some kind of problems.
-
2. Re: Application settings
hwangarias Oct 18, 2012 9:31 AM (in response to lehvolk)In order other people could come here I'll expose how did I manage...
In each EAR artifact I have (I have a base core but many distributions parametrized):
- under src/main/application I have all the typical that maven-ear plugin will include as part of the ear
- I have src/main/resources/settings/... <hierarchy of distribution-related-settings>
I have used assembly plugin in prepare-package to compress as a settings.jar (zip-file) all content of src/main/resources/settings/ to <EAR>/lib/settings.jar, and once as part of the classpath I use VFS to deal with the hierarchy, for example, getReports() looks in classpath://settings/reports/ all files contained in settings.jar and returns pointers to all of them
This combined with a custom "classpath concept" allows me to create outside the EAR a replica of the structure and allow to override internal resources with external ones.
This is flexible in the way I send my application with basic customizations and parametrize that is as simple as substitute internal files by external ones
If anyone wants more details... here we are
Thx!
-
3. Re: Application settings
jaikiran Oct 18, 2012 9:41 AM (in response to hwangarias)I would like to understand what exactly you are doing there. Could you please create a wiki article here https://community.jboss.org/en/jbossas7?view=documents explaining those details?
-
4. Re: Application settings
hwangarias Oct 24, 2012 10:35 AM (in response to jaikiran)Ok, as soon as I have a couple of minutes I'll write a paper. Basically I embed a dir of the EAR as a jar-lib inside the ear as my "internal resource root". Outside of jboss, in my APPLICATION_HOME I have a replic where I can overwrite all or part of those resources.
Case of use: reports
I embed with each of my bundles a basic set of "standar reports" but I allow override them as well as append new ones