title: How to give System property to my test via Gradle and -D
body: <p>I have a a Java program which reads a System property</p>
  
  <pre><code>System.getProperty("cassandra.ip");
  </code></pre>
  
  <p>and I have a Gradle build file that I start with </p>
  
  <pre><code>gradle test -Pcassandra.ip=192.168.33.13
  </code></pre>
  
  <p>or </p>
  
  <pre><code>gradle test -Dcassandra.ip=192.168.33.13
  </code></pre>
  
  <p>however <strong>System.getProperty</strong> will always return <strong>null</strong>.</p>
  
  <p>The only way I found was to add that in my Gradle build file via</p>
  
  <pre><code>test {
      systemProperty "cassandra.ip", "192.168.33.13"
  }
  </code></pre>
  
  <p>How Do I do it via -D</p>