layout | title | date | comments | categories | description | tags | |
---|---|---|---|---|---|---|---|
post |
Set environment from command line |
2014-12-02 08:48:45 -0800 |
true |
This post describes how to change Alfresco environment for DB connection using command line arguments. |
|
In module-context.xml
add following bean:
{% highlight xml %} classpath:alfresco/module/${artifactId}/${alfresco.env}.properties {% endhighlight xml %}
Datasource:
{% highlight xml %}
{% endhighlight xml %}.properties files. In my case I have two files prod.properties
and dev.properties
. Basically you just pass the name of the properties file.
{% highlight properties %} host=someHost username=someUser password=somePassword {% endhighlight properties %}
Now you just need to pass custom VM option parameter when you start alfresco. For instance in Intellij IDEA you can create maven run configuration and specify this parameter there:
![Screenshot]({{ site.url }}/images/EnvVar.jpg){:.center-image}