title: How to specify the entry point, Main-Class, for a FatJar using Gradle Kotlin DSL?
body: <p>How do I specify the <code>Main-Class</code> <a href="https://docs.oracle.com/javase/tutorial/deployment/jar/appman.html" rel="nofollow noreferrer">attribute</a> in the <code>ShadowJar</code> once it's <a href="https://stackoverflow.com/q/48659849/262852">imported</a>?</p>
  
  <pre><code>import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
  import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
  
  plugins {
      kotlin("jvm") version "1.2.51"
      id("com.github.johnrengelman.shadow") version "2.0.4"
  }
  
  group = "xxx.yyy"
  version = "1.0-SNAPSHOT"
  
  repositories {
      mavenCentral()
  }
  
  dependencies {
      implementation(kotlin("stdlib-jdk8"))
  }
  
  tasks.withType&lt;KotlinCompile&gt; {
      kotlinOptions.jvmTarget = "1.8"
  }
  
  tasks.withType&lt;ShadowJar&gt; {
      baseName = "app"
      classifier = "inajar"
      version = "9"
      //main-class = "foobar"
  }
  </code></pre>
  
  <p>Also, this build file might be out of date:</p>
  
  <pre><code>thufir@dur:~/NetBeansProjects/HelloKotlinWorld$ 
  thufir@dur:~/NetBeansProjects/HelloKotlinWorld$ gradle clean ShadowJar
  
  Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
  Use '--warning-mode all' to show the individual deprecation warnings.
  See https://docs.gradle.org/5.0/userguide/command_line_interface.html#sec:command_line_warnings
  
  BUILD SUCCESSFUL in 2s
  4 actionable tasks: 4 executed
  thufir@dur:~/NetBeansProjects/HelloKotlinWorld$ 
  thufir@dur:~/NetBeansProjects/HelloKotlinWorld$ java -jar build/libs/app-9-inajar.jar 
  no main manifest attribute, in build/libs/app-9-inajar.jar
  thufir@dur:~/NetBeansProjects/HelloKotlinWorld$ 
  </code></pre>
  
  <p>project:</p>
  
  <p><a href="https://github.com/THUFIR/HelloKotlinWorld" rel="nofollow noreferrer">https://github.com/THUFIR/HelloKotlinWorld</a></p>