The situation is actually a bit worse. I just discovered that dependencies of any configuration in the subproject are also pulled in, even when not related to an artifact of the subproject.
IE, add:
subprojects {
configurations {
otherConfig3
}
dependencies {
otherConfig3 'jmock:jmock:1.1.0'
}
}
and now we get:
:useFiles
dep /home/cdore/.gradle/caches/modules-2/files-2.1/junit/junit/4.12/2973d150c0dc1fefe998f834810d68f278ea58ec/junit-4.12.jar
dep /home/cdore/gradle-configurationartifacts-test/subproject/build/libs/subproject-other2.jar
dep /home/cdore/gradle-configurationartifacts-test/subproject/build/libs/subproject.jar
dep /home/cdore/gradle-configurationartifacts-test/subproject/build/libs/subproject-other.jar
dep /home/cdore/.gradle/caches/modules-2/files-2.1/jmock/jmock/1.1.0/90e87194c8113e1901d7196b359e48f9eb9c63d/jmock-1.1.0.jar