Re: Using different velocity.properties depending on the environment
Nathan Bubna <[email protected]> Fri, 13 Sep 2013 13:02:37 -0700
| Newsgroups | gmane.comp.jakarta.velocity.user |
|---|---|
| Message-ID | <CAFyaDjEC1LfA3rucwwTSY3NpmXVKY6pdjMiM+41dqGTM4fQFbA@mail.gmail.com> |
VelocityView (from VelocityTools) has abilities like this, but the
core engine does not. But, you can always put the check into your own
code where you create your VelocityEngine:
String propsFilePath = System.getProperty("org.apache.velocity.properties");
VelocityEngine engine;
if (propsFilePath == null) {
engine = new VelocityEngine();
} else {
engine = new VelocityEngine(propsFilePath);
}
On Tue, Sep 10, 2013 at 11:52 PM, Paul Wellner Bou <[email protected]> wrote:
> Good morning,
>
> is it possible to point to the velocity.properties file using
> environment variables?
>
> we have a velocity.properties in our classpath, this should be used as
> default and in production environments. Then, we have another one,
> named, for example velocity-dev.properties (or in another directory,
> like dev/velocity.properties), which has different settings for
> logging, caching and refreshing as the production file.
>
> Is it possible to start the container or the war file with something
> like -Dorg.apache.velocity.properties=velocity-dev.properties, similar
> as it is done with the log4j configuration file?
>
> Thanks and regards
> Paul.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>