Gradle cyclic dependency with compileIntegTestJava and integTestClasses

My project is a Functional Test Project, so we do not have a main source-set in our gradle, just integTest source-set (which acts as the main) and test .

My Project structure is


with a single build.gradle for the parent-p project.

We are using gradle 2.0 version (upgrade still not done yet due to organisation policies). The build.gradle looks like follows

subprojects {

    buildscript { repositories { //usual repository code } } 

    apply plugin: 'java'
    apply from: "../common-dependencies.gradle"
    sourceCompatibility = 1.8

    sourceSets {
        test {
            java { srcDir 'src/test/java' }
            resources { srcDir 'src/test/resources' }
        integTest {
            java { srcDir 'src/integTest/java' }
            resources { srcDir 'src/integTest/resources' }

    test { useTestNG() }

    configurations {
        integTestCompile.extendsFrom loggers, json
        //loggers, json etc are some configuration & dependencies defined in a common gradle file 
        testCompile.extendsFrom integTestCompile
        // the test sourceSet is used to write test for the code in integTest sourceSet

    dependencies {
        integTestCompile sourceSets.integTest.output
        testCompile sourceSets.test.output

When I run the build, it’s failing with cyclic dependency for the first sub-project as follows

* What went wrong:
Circular dependency between the following tasks:
\--- :parent-a:child-a:integTestClasses
     \--- :parent-a:child-a:compileIntegTestJava (*)

Any inputs on how could this be resolved ?