title: gradle runJar task?
body: <p>I am trying to make a task to run my Jar file in gradle.</p>
  
  <p>I have come up with the following:</p>
  
  <pre><code>task runJar(dependsOn:[jar]){
    ant.java(jar:,fork:true)
  }
  </code></pre>
  
  <p>However, I am unable to find the path to the jar file. Any help much appreciated. Thank you!</p>
  
  <p>Misha</p>
  
  <p>EDIT: OK this is rather odd. This task runs <em>before</em> compile, etc.???</p>
  
  <p>EDIT: Fixed. The key is in a doLast { } notation, or, in shorthand</p>
  
  <pre><code>task runJar(dependsOn:"jar")&lt;&lt;{
    ant.java(jar:"${libsDir}${File.separator}${archivesBaseName}.jar",fork:true)
  }
  </code></pre>
  
  <p>Misha</p>