Can we specify environment variable in Wildfly standalone.xml and module.xml file for some runtime configuration? we can do this in tomcat like this, i tried slimier by using JAVA_OPTS in wildly but its not working.
Asked
Active
Viewed 1,096 times
0
-
why do it via standalone.xml and not in standalone.bat? – Yoav Gur Feb 22 '17 at 11:16
-
i am using docker and module.xml file need to have some tag which need to set from environment variable. – Varun Jain Feb 22 '17 at 11:32
1 Answers
3
You can set all the environment variables in standalone.conf.bat(Windows) and standalone.conf(linux) present under WILDFLY_HOME/bin directory.
You can also call them in standalone.xml file using ${env.variable_name}
.
for example:
I have an environment variable DB_CONNECTION_URL and I want to use it in Wildfly. So, I will specify ${env.DB_CONNECTION_URL}
for database connection URL in my wildfly configuration file.

James R. Perkins
- 16,800
- 44
- 60

Atul
- 1,536
- 3
- 21
- 37