title: Override grails.serverURL and application specific grails.propname settings in application.properties file
body: <p>I need to override <code>grails.serverURL</code> at runtime <em>without</em> having to regenerate the application's WAR file. I have tried various ways of setting <code>grails.serverURL</code> in the <code>application.properties</code> file and cannot get it to work.</p>
  
  <p>Here is the environment specific portion of <code>Config.groovy</code>:</p>
  
  <pre><code>environments {
     prod
     {
        grails.serverURL = "http://nonexistentserver.somecompany.com:8080"
        grails.anotherappspecificURL = "xcc://user:password@server.somecompany.com"
     }
  </code></pre>
  
  <p>Basically, our <code>application.properties</code> looks like this:</p>
  
  <pre><code>grails.env=prod
  grails.war.deployed=true
  app.grails.version=1.0.4
  app.name=myapp
  </code></pre>
  
  <p>Below is one of the ways I have tried to override the settings. These are defined in <code>Config.groovy</code>:</p>
  
  <pre><code>grails.serverURL=http://webserver1.somecompany.com:8080
  grails.anotherappspecificURL=xcc://admin:xyzabc123@specificserver.somecompany.com
  </code></pre>
  
  <p>Any help with getting this to work without having to make code changes would be greatly appreciated!</p>