You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@isis.apache.org by Jan-Willem Gmelig Meyling <ja...@youngmediaexperts.nl> on 2016/06/30 08:24:45 UTC

Using different database provider settings in production

Hi all,

Say I want to use a different configuration in development and production, and want to switch between the two easily, so that my IDE just works out of the box with the development settings, and with a simple Maven command I am able to create a functioning WAR.

Lots of the properties are stored in the properties files under resources. I know the Maven resources plugin can replace el-expressions with environment variables and Maven properties. This replacement is however only done in packaging phase, so the expressions are useless in “development”. 

Did someone figured out a good approach? Is there a way to load different configuration files in production?

Jan-Willem

I have also posted this question on StackOverflow, so points can be awarded appropriately ;) http://stackoverflow.com/questions/38117663/using-different-database-provider-settings-in-production <http://stackoverflow.com/questions/38117663/using-different-database-provider-settings-in-production>


Re: Using different database provider settings in production

Posted by Jeroen van der Wal <je...@stromboli.it>.
We currently override the defaults in context.xml to point to different
config files on dev, test and prod boxes:

<Context>
    <WatchedResource>WEB-INF/web.xml</WatchedResource>
    <Manager pathname="" />
    <Parameter name="shiroConfigLocations"
value="file:/var/isis-config/shiro.ini" override="false" />
    <Parameter name="isis.config.dir" value="/var/isis-config/"
override="false" />
    <Parameter name="wicket.configuration" value="deployment"
override="false" />
</Context>

The /var/isis-config folder contains the following files:

isis.properties
logging.properties
persistor.properties
persistor_datanucleus.properties
shiro.ini
viewer_wicket.properties



HTH


Jeroen

On 30 June 2016 at 08:24, Jan-Willem Gmelig Meyling <
jan-willem@youngmediaexperts.nl> wrote:

> Hi all,
>
> Say I want to use a different configuration in development and production,
> and want to switch between the two easily, so that my IDE just works out of
> the box with the development settings, and with a simple Maven command I am
> able to create a functioning WAR.
>
> Lots of the properties are stored in the properties files under resources.
> I know the Maven resources plugin can replace el-expressions with
> environment variables and Maven properties. This replacement is however
> only done in packaging phase, so the expressions are useless in
> “development”.
>
> Did someone figured out a good approach? Is there a way to load different
> configuration files in production?
>
> Jan-Willem
>
> I have also posted this question on StackOverflow, so points can be
> awarded appropriately ;)
> http://stackoverflow.com/questions/38117663/using-different-database-provider-settings-in-production
> <
> http://stackoverflow.com/questions/38117663/using-different-database-provider-settings-in-production
> >
>
>