configurations {
    compile
}
dependencies {
    repositories {
        add(new org.apache.ivy.plugins.resolver.FileSystemResolver()) {
            name = 'resolver'
            addArtifactPattern(projectDir.absolutePath + '/[module]-[revision].jar')
        }
    }
    compile module('test:projectA:1.2') {
        module('test:projectB:1.5') {
            dependencies('test:projectC:2.0')
        }
    }
}

defaultTasks 'listJars'

file("projectA-1.2.jar").text = ''
file("projectB-1.5.jar").text = ''
file("projectC-2.0.jar").text = ''

task listJars << {
    List jars = configurations.compile.collect { it.name }
    assert jars == ['projectA-1.2.jar', 'projectB-1.5.jar', 'projectC-2.0.jar']
}