title: How to set JAR version with variable in Gradle?
body: <p>How to set JAR version with variable in Gradle?</p>
  
  <p>If I write</p>
  
  <pre><code>ext.nd4j_version = "1.0.0-beta2"
  ext.nd4j_backend = "nd4j-native-platform"
  
  dependencies {
  
      compile group: 'org.nd4j', name: '${nd4j_backend}', version: '${nd4j_version}' 
  </code></pre>
  
  <p>it is unable to find artifacts. </p>
  
  <p>And if I write</p>
  
  <pre><code>nd4j_version = "1.0.0-beta2"
  nd4j_backend = "nd4j-native-platform"
  
  dependencies {
  
      compile group: 'org.nd4j', name: '${nd4j_backend}', version: '${nd4j_version}' 
  </code></pre>
  
  <p>then it is able to find artifact, but issues a warning</p>
  
  <pre><code>Could not set unknown property 'nd4j_version' for root project 
  </code></pre>
  
  <p><strong>UPDATE</strong></p>
  
  <p>The following also doesn't work</p>
  
  <pre><code>ext.nd4j_version = "1.0.0-beta2"
  ext.nd4j_backend = "nd4j-native-platform"
  
  
  dependencies {
  
      compile group: 'org.nd4j', name: '${project.ext.nd4j_backend}', version: '${project.ext.nd4j_version}' // works
  </code></pre>
  
  <p>and the following</p>
  
  <pre><code>ext.nd4j_version = "1.0.0-beta2"
  ext.nd4j_backend = "nd4j-native-platform"
  
  
  dependencies {
  
      compile group: 'org.nd4j', name: '${rootProject.ext.nd4j_backend}', version: '${rootProject.ext.nd4j_version}' 
  </code></pre>
  
  <p>and the following</p>
  
  <pre><code>ext {
      nd4j_version = "1.0.0-beta2"
      nd4j_backend = "nd4j-native-platform"
  }
  
  
  dependencies {
  
      compile group: 'org.nd4j', name: '${project.nd4j_backend}', version: '${project.ext.nd4j_version}'
  </code></pre>
  
  <p>Please give an answer with an explanation, not just random working syntax.</p>