How to exclude transitive dependency

Thanks it worked.

Here is my working example if anyone is interested .

dependencies {
 compile (
   [group: 'org.slf4j', name: 'jcl-over-slf4j', version: '1.6.2'],
   [group: 'ch.qos.logback', name: 'logback-core', version: '1.0.0']
     )
   compile('ch.qos.logback:logback-classic:1.0.0') {
  exclude group: 'org.slf4j', module: 'slf4j-api' //by both name and group
 }
}

so we will have two compile block.