title: how to execute a built fat JAR as a gradle task?
body: <p>How would I utilize the gradle <strong>application</strong> plugin to execute the fat JAR from gradle as so:</p>
  
  <pre><code>thufir@doge:~/NetBeansProjects/selenium$ 
  thufir@doge:~/NetBeansProjects/selenium$ gradle clean fatJar;java -jar build/libs/selenium-all.jar 
  
  BUILD SUCCESSFUL in 23s
  4 actionable tasks: 4 executed
  Jul 18, 2017 7:47:49 PM net.bounceme.dur.web.selenium.Main main
  INFO: running..
  1500432473386   geckodriver INFO    Listening on 127.0.0.1:30879
  1500432475320   geckodriver::marionette INFO    Starting browser /usr/lib/firefox/firefox with args ["-marionette"]
  1500432488971   addons.xpi  WARN    Add-on langpack-en-ZA@firefox.mozilla.org is not compatible with application version.
  1500432488978   addons.xpi  WARN    Add-on langpack-en-ZA@firefox.mozilla.org is not compatible with application version.
  1500432489767   addons.xpi  WARN    Add-on langpack-en-GB@firefox.mozilla.org is not compatible with application version.
  1500432489769   addons.xpi  WARN    Add-on langpack-en-GB@firefox.mozilla.org is not compatible with application version.
  ^Cthufir@doge:~/NetBeansProjects/selenium$ 
  </code></pre>
  
  <p>build.gradle:</p>
  
  <pre><code>plugins {
      id 'com.gradle.build-scan' version '1.8' 
      id 'java'
      id 'application'
  }
  
  mainClassName = 'net.bounceme.dur.web.selenium.Main'
  
  buildScan {
      licenseAgreementUrl = 'https://gradle.com/terms-of-service'
      licenseAgree = 'yes'
  }
  
  repositories {
      jcenter()
  }
  
  jar {
      manifest {
          attributes 'Main-Class': 'net.bounceme.dur.web.selenium.Main'
          attributes 'Class-path': 'selenium-java-3.4.0.jar'
      }
  }
  
  task fatJar(type: Jar) {
      baseName = project.name + '-all'
      from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
      with jar
      manifest {
          attributes 'Implementation-Title': 'Gradle Quickstart', 'Implementation-Version': '3.4.0'
          attributes 'Main-Class': 'net.bounceme.dur.web.selenium.Main'
      }
  }
  
  dependencies {
       compile group: 'org.seleniumhq.selenium', name: 'selenium-java', version: '3.4.0'
       compile group: 'org.seleniumhq.selenium', name: 'selenium-server', version: '3.4.0'
  
      compile group: 'org.seleniumhq.selenium', name: 'selenium-firefox-driver', version: '3.4.0'
      compile group: 'org.seleniumhq.selenium', name: 'selenium-chrome-driver', version: '3.4.0'
      compile group: 'org.seleniumhq.selenium', name: 'selenium-ie-driver', version: '3.4.0'
      compile group: 'org.seleniumhq.selenium', name: 'selenium-safari-driver', version: '3.4.0'
      compile group: 'org.seleniumhq.selenium', name: 'selenium-edge-driver', version: '3.4.0'
  
  }
  </code></pre>
  
  <p>with the proviso that I want the fat JAR to actually build and want to execute the <strong>actual</strong> JAR file <em>itself</em>.  In the <a href="https://stackoverflow.com/questions/26707403/how-to-execute-jar-file-in-gradle">context</a> of running a fatJAR from the CLI.</p>
  
  <p>Reference:</p>
  
  <p><a href="https://docs.gradle.org/current/userguide/userguide_single.html" rel="nofollow noreferrer">https://docs.gradle.org/current/userguide/userguide_single.html</a></p>
  
  <p><a href="https://stackoverflow.com/questions/20728621/running-an-executable-jar-file-built-from-a-gradle-based-project">Running an executable jar file built from a gradle based project</a></p>
  
  <p><a href="https://stackoverflow.com/questions/29643973/run-jar-with-parameters-in-gradle">Run jar with parameters in gradle</a></p>
  
  <p><a href="https://stackoverflow.com/questions/26707403/how-to-execute-jar-file-in-gradle">How to execute jar file in gradle?</a></p>