title: How to make use of variables in Wildfly configuration file?
body: <p>I am setting up a common <code>standalone-full.xml</code> file for all server environments, and therefore need to have variables for database URL's (and such), instead of hard coding them.</p>
  
  <p>One such section in the configuration file might look like this:</p>
  
  <pre><code>&lt;datasource jta="true" jndi-name="java:/somename" pool-name="somename" enabled="true" use-ccm="false"&gt;
                  &lt;connection-url&gt;jdbc:mysql://${SOMENAME_DB_URL}&lt;/connection-url&gt;
                  &lt;driver-class&gt;com.mysql.jdbc.Driver&lt;/driver-class&gt;
                  &lt;driver&gt;mysql&lt;/driver&gt;
                  &lt;pool&gt;
                      &lt;min-pool-size&gt;5&lt;/min-pool-size&gt;
                      &lt;max-pool-size&gt;15&lt;/max-pool-size&gt;
                  &lt;/pool&gt;
                  &lt;security&gt;
                      &lt;user-name&gt;${DB_USERNAME}&lt;/user-name&gt;
                      &lt;password&gt;${DB_PASSWORD}&lt;/password&gt;
                  &lt;/security&gt;
                  &lt;validation&gt;
                      &lt;validate-on-match&gt;false&lt;/validate-on-match&gt;
                      &lt;background-validation&gt;false&lt;/background-validation&gt;
                  &lt;/validation&gt;
                  &lt;statement&gt;
                      &lt;share-prepared-statements&gt;false&lt;/share-prepared-statements&gt;
                  &lt;/statement&gt;
              &lt;/datasource&gt;
  </code></pre>
  
  <p>However, upon starting the server with this config file it simply throws an "Unable to resolve expression" error for all such sections.</p>
  
  <p>I've tried putting the variables in <code>/etc/environment</code>, as well as in the <code>.jbossclirc</code> file in <code>/bin</code> using <code>set DB_USERNAME=mydbusername</code>, but to no avail. </p>
  
  <p>As you can see I'm fumbling a bit in the dark here since I haven't been able to find any proper documentation on how to do this. I'm not even sure if it's actually possible. Any help is greatly appreciated.</p>