title: What is the best way to pass gradle properties from bamboo?
body: <p>As per <a href="https://docs.gradle.org/current/userguide/build_environment.html" rel="nofollow">Gradle Documentation for Build Environment</a> you can see there are several ways to do this.</p>
  
  <p>One important constraint is that I can't check in these properties into VCS.</p>
  
  <p>Additionally clarifying that these are project properties.</p>
  
  <p>I am invoking <code>gradlew</code> as a <code>bash</code> command on <code>Bamboo</code></p>
  
  <p>Various ways</p>
  
  <ol>
  <li>Set <code>GRADLE_OPTS</code> environment variable</li>
  <li>Set <code>JAVA_OPTS</code> environment variable</li>
  <li>Pass -D to <code>gradlew</code> but this don't seem to work for some reason</li>
  <li>Any other better ways...</li>
  </ol>
  
  <p>It is best to know the pitfalls upfront hence posting it here for your answers.</p>
  
  <p>I want to pass these as System properties that my unit tests can use and sometimes as project properties.  </p>