title: How to run bootRun with spring profile via gradle task
body: <p>I'm trying to set up gradle to launch the <code>bootRun</code> process with various spring profiles enabled.</p>
  
  <p>My current <code>bootRun</code> configuration looks like: </p>
  
  <pre><code>bootRun {
      // pass command line options from gradle to bootRun
      // usage: gradlew bootRun "-Dspring.profiles.active=local,protractor"
      if (System.properties.containsKey('spring.profiles.active')) {
          systemProperty "spring.profiles.active", System.properties['spring.profiles.active']
      }
  }
  </code></pre>
  
  <p>I'd like to set system properties with a <code>gradle</code> task, and then execute <code>bootRun</code>.</p>
  
  <p>My attempt looked like this:</p>
  
  <pre><code>task bootRunDev
  
  bootRunDev  {
      System.setProperty("spring.profiles.active", "Dev")
  }
  </code></pre>
  
  <p>A few questions:</p>
  
  <ol>
  <li>is <code>systemProperty</code> a part of the spring boot bootRun configuration?</li>
  <li>is it possible to set a system property in another task?</li>
  <li>What should my next step be? I need to get <code>bootRunDev</code> configuration to happen before <code>bootRun</code></li>
  <li>Is there another approach I should look into</li>
  </ol>
  
  <p>-Eric</p>