title: How do I make gradle's build task generate the shadow jar _instead_ of the "regular" jar?
body: <p>(this is using gradle 2.4)</p>
  
  <p>For one of my projects, split into several submodules, I use the <a href="https://github.com/johnrengelman/shadow" rel="noreferrer">shadow plugin</a> which works very well for my needs; it has a main, and as recommended by the plugin's README, I use the application plugin in conjuction with it so that the Main-Class is generated in the manifest, all works well.</p>
  
  <p>Now, this is a SonarQube plugin project, and I also use (successfully!) the <a href="https://github.com/iwarapter/gradle-sonar-packaging-plugin" rel="noreferrer">gradle sonar packagin plugin</a>. And what this plugin does is, when you <code>./gradlew build</code>, generate the sonar plugin instead of the "regular" jar.</p>
  
  <p>I wish to do the same for my subproject here, except that I want it to generate only the shadow jar plugin instead of the "regular" plugin... Right now I generate both using this simple file:</p>
  
  <pre><code>buildscript {
      repositories {
          jcenter();
      }
      dependencies {
          classpath(group: "com.github.jengelman.gradle.plugins",
              name:"shadow", version:"1.2.1");
      }
  }
  
  apply(plugin: "application");
  apply(plugin: "com.github.johnrengelman.shadow");
  
  dependencies {
      // whatever
  }
  
  mainClassName = //whatever
  
  artifacts {
      shadowJar;
  }
  
  // Here is the hack...
  
  build.dependsOn(shadowJar);
  </code></pre>
  
  <p>How do I modify this file so that only the shadow jar is generated and not the regular jar?</p>