Transitive dependency rules when configurations depend on each other

I have a configuration “hdp” defined for a set of jars. This configuration has transitive set to false. If i add this configuration as a part of the standard compile configuration, all of the dependencies for the hdp jars get loaded as well. Is there a way to enforce this transitive value of false while still using the configuration as part of the compile?

buildscript {
    repositories {
    dependencies {

apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'spring-boot'

jar {
    baseName = 'sentinel-rest-service'
    version =  '0.1.0'

//Vendor versions
def hive_version=""
def hadoop_version=""
def oozie_version=""

sourceCompatibility = 1.7
targetCompatibility = 1.7

dependencies {


configurations.hdp {
    transitive = false


task printDependencies << {
    configurations.hdp.dependencies.each { dep -> println }

    configurations.compile.dependencies.each { dep -> println }

    configurations.compile.allDependencies.each { dep -> println }


List hdpJarList = [

dependencies {
    hdp hdpJarList
    compile (configurations.hdp){
        transitive = false


task wrapper(type: Wrapper) {
    gradleVersion = '2.7'

The transitive flag on the configuration is not passed along when you add the configuration to another configuration (i.e. this essentially just makes the dependencies part of both configurations). What you can do, however, is set each dependency to not be transitive and this will get passed to the other configuration because it’s a setting on the dependency itself. For example:

dependencies {
    hdpJarList.each { hdp(it) { transitive = false } }
    compile configurations.hdp

Thanks a lot!! That was exactly what i was looking for! :sunglasses: