title: How to exclude transitive dependencies with gradle and substitute it with another
body: <p>I'm in situation similar with <a href="https://stackoverflow.com/questions/32058431/aws-java-sdk-aws-authentication-requires-a-valid-date-or-x-amz-date-header">this</a> 
  (bug between JodaTime and versions of Java greater then 1.8u60).</p>
  
  <p>So what I need is: </p>
  
  <ol>
  <li>Upgrading to JodaTime version 2.8.1 or later.</li>
  <li>The problem is: JodaTime is a transitive dependency in my project.</li>
  </ol>
  
  <p>Build automation tool used in it is gradle. Need help to handle it.</p>
  
  <p><strong>buildscript:</strong> <br/></p>
  
  <pre><code>buildscript {
      ext {
          springBootVersion = '1.2.4.RELEASE'
      }
      repositories {
          mavenCentral()
      }
      dependencies {
          classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") 
          classpath("io.spring.gradle:dependency-management-plugin:0.5.1.RELEASE")
          classpath("org.flywaydb:flyway-gradle-plugin:3.2.1")
      }
  }
  
  apply plugin: 'java'
  apply plugin: 'idea'
  apply plugin: 'eclipse'
  apply plugin: 'spring-boot' 
  apply plugin: 'io.spring.dependency-management' 
  apply plugin: 'org.flywaydb.flyway'
  
  jar {
      baseName = 'xxxx'
      version = 'alpha'
  }
  sourceCompatibility = 1.8
  targetCompatibility = 1.8
  
  repositories {
      mavenCentral()
  }
  
  dependencies {
  
      compile("org.springframework.boot:spring-boot-starter-data-jpa:1.2.4.RELEASE")
      compile("org.springframework.boot:spring-boot-starter-aop:1.2.4.RELEASE")
      compile("org.springframework.boot:spring-boot-starter-web:1.2.4.RELEASE")
      compile("org.springframework.boot:spring-boot-starter-freemarker:1.2.4.RELEASE")
      compile("com.amazonaws:aws-java-sdk:1.10.2")
      compile("com.stripe:stripe-java:1.33.0")
      compile("org.flywaydb:flyway-core:3.2.1")
      compile("com.jolbox:bonecp:0.8.0.RELEASE")
  
      runtime("org.postgresql:postgresql:9.4-1201-jdbc41")
  
      testCompile("org.springframework.boot:spring-boot-starter-test:1.2.4.RELEASE")
  }
  
  dependencyManagement {
      imports { 
          mavenBom "org.springframework.cloud:spring-cloud-starter-parent:1.0.2.RELEASE" 
      }
  }
  
  eclipse {
      classpath {
           containers.remove('org.eclipse.jdt.launching.JRE_CONTAINER')
           containers 'org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8'
      }
  }
  
  task wrapper(type: Wrapper) {
      gradleVersion = '2.3'
  }
  </code></pre>