title: IntelliJ run configuration for Grails environment
body: <p>In IntelliJ, I want to create a run configuration that will execute <code>run-app</code> in a custom environment named "demo". The following works fine on the command-line</p>
  
  <pre><code>grails run-app -Dgrails.env=demo
  </code></pre>
  
  <p>But inside IntelliJ, if I enter either</p>
  
  <pre><code>run-app -Dgrails.env=demo
  </code></pre>
  
  <p>or</p>
  
  <pre><code>-Dgrails.env=demo run-app
  </code></pre>
  
  <p>in the "Command line" field of the "Run/Debug Configuration" dialog, neither of them start the app in the correct environment.</p>