title: Run gradle task with Spring Profiles (Integration tests)
body: <p>Need to run tests via gradle with spring profiles.</p>
  
  <pre><code>gradle clean build
  </code></pre>
  
  <p>I've added task:</p>
  
  <pre><code>task beforeTest() {
      doLast {
        System.setProperty("spring.profiles.active", "DEV")
      }
  }
  
  test.dependsOn beforeTest
  </code></pre>
  
  <p>And my test definition is:</p>
  
  <pre><code>@RunWith(SpringRunner.class)
  @SpringBootTest
  @ActiveProfiles("TestProfile")
  public class SomeTest {
  </code></pre>
  
  <p>But this construction doesn't work for me.</p>
  
  <p>Gradle runs tests.</p>