title: How to execute jar file in gradle?
body: <p>When I use the ant to build my android project , I need some task like this: </p>
  
  <pre><code>&lt;java jar="./build_tools/yuicompressor-2.4.8.jar" fork="true" failonerror="true"&gt;
      &lt;arg value="-o"/&gt;
      &lt;arg value="${out.dir}/all-min-mobile.js"/&gt;                         
      &lt;arg value="--charset"/&gt;
      &lt;arg value="utf-8"/&gt;
      &lt;arg value="${out.dir}/all-mobile.js"/&gt;
  &lt;/java&gt;
  </code></pre>
  
  <p>I need to do the process in my gradle build process.Then I put following script in my build.gradle file:</p>
  
  <pre><code>task (runCompressTool , dependsOn: jar, type: JavaExec) {
  
  classpath files('./build_tools/yuicompressor-2.4.8.jar')
  main 'com.yahoo.platform.yui.compressor.Bootstrap'
  args[0] = '-o'
  args[1] = '${buildDir}/all-min-web.js'
  args[2] = '--charset'
  args[3] = 'utf-8'
  args[4] = '--type'
  args[5]='js'
  args[6] = '${buildDir}/all-web.js'
  </code></pre>
  
  <p>}
    When I run this task , it failed and just told me the exit code is 1 and didn't tell me what is wrong. So is there any body who can help me?</p>