title: Publish test jar with dependencies in gradle
body: <p>I wrote the tests for my project under src/integTests directory and now I have to build and publish only jar generated out of integ tests. Here is my code:</p>
  
  <pre><code>apply plugin: 'java'
  apply plugin: 'maven-publish'
  
  sourceSets {
      integTest {
          java.srcDir file('src/integTest/java')
          resources.srcDir file('src/integTest/resources')
          compileClasspath += main.output + test.output
          runtimeClasspath += main.output + test.output
      }
  }
  
  configurations {
      integTestCompile.extendsFrom testCompile
      integTestRuntime.extendsFrom testRuntime
  }
  
  task integTestJar (type:Jar) {
      from sourceSets.integTest.output
          appendix = 'integ-tests'
  }
  
  publishing {
        publications {
            myPublicationName(MavenPublication) {
                artifactId "client-security-internal-integ-tests"
                from components.java            
            }
        }
        repositories {
            maven {
                url ="${artifactory_contextUrl}"
                credentials {
                    username = "${artifactory_user}"
                    password = "${artifactory_password}"
                }
            }
        }
  }
  </code></pre>
  
  <p>In the above, when I have <code>from components.java</code>, it publishes the product's jar with name as specified in artifact-id. Instead when I use <code>artifact integTestJar.archivePath</code>, it publishes the right jar but does not include the dependencies info in the pom file.</p>
  
  <p>I tried <code>from components.integTest</code>, but that fails with error <code>Could not find property 'integTest' on SoftwareComponentInternal set</code></p>
  
  <p>How do I publish the integ-test jar with all its dependencies included in pom file ?</p>