title: Gradle How to build several versions of a jar with different dependencies
body: <p>If somebody tried to solve similar problem before, please share your solution. In my gradle file I have different subproject. As of right now I am able to build rest-client with core, but there could be situation when rest-client should be also be build with db-client subproject. Basically the idea is I need to be able to build rest-client with different dependency. Let say one task builds rest-client with dependency to one project and another task build rest-client with  dependency on two subproject. </p>
  
  <pre><code>project(':core') {
      apply plugin: "groovy"
      repositories {
          mavenCentral()
      }
      dependencies {
          compile 'org.codehaus.groovy:groovy-all:2.4.5'
          testCompile "org.testng:testng:6.8.21"
      }
  }
  
  //rest-client Project specific stuff
  project(':rest-client') {
      apply plugin: "groovy"
      repositories {
          mavenCentral()
      }
  
      dependencies {
          compile 'org.codehaus.groovy.modules.http-builder:http-builder:0.7.1'
          compile project(':core')
          compile 'org.codehaus.groovy:groovy-all:2.4.5'
          testCompile "org.testng:testng:6.8.21"
  
      }
      jar {
          from configurations.runtime
      }
  }
  
  //db-client Project specific stuff
  project(':db-client') {
      apply plugin: "groovy"
      repositories {
          mavenCentral()
      }
      dependencies {
          compile project(':core')
          compile 'org.codehaus.groovy:groovy-all:2.4.5'
          compile 'mysql:mysql-connector-java:5.1.37'
          //compile 'org.elasticsearch:elasticsearch:2.3.1'
          compile 'org.elasticsearch:elasticsearch-client-groovy:0.10.0'
      }
  }
  </code></pre>