title: How to set spring boot active profile in Gradle 4.7
body: <p><strong>Overall:</strong><br>
  I'm trying to run gradle build task for a specific spring profile but I've got an  error in passing following test:</p>
  
  <pre><code>au.com.mnpd.security.JwtTokenUtilTest &gt; generateToken_succeeds FAILED
  java.lang.IllegalStateException
      Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException
          Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException
              Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException
                  Caused by: org.springframework.beans.factory.BeanCreationException
                      Caused by: java.lang.IllegalArgumentException
  </code></pre>
  
  <p>The test is using some properties from spring <strong>development</strong> profile (<em>located in application-development.yaml</em>). But I couldn't find any way to pass active profile to gradle build command. 
  I tried followings but again the same issue: </p>
  
  <pre><code>- gradlew -Dspring.profiles.active=development build
  
  - gradlew -Pdevelopment build
  </code></pre>
  
  <p><strong>Question:</strong><br>
  Is there anyway to pass active profile to gradle (v 4.7) <strong>build</strong> task like what is applicable for <strong>bootRun</strong> task as follows: </p>
  
  <pre><code>bootRun {
          bootRun.systemProperty 'spring.profiles.active', 'development'
  }
  </code></pre>
  
  <p><strong>Note:</strong> I tried the same for build but <strong>build.systemProperty</strong> method does not exist for build task. </p>
  
  <p>As I'm new in gradle, I'd be grateful is you could share your genuine solutions with me.   </p>