In our Gradle project, we want to add a new module for functional-tests that needs to be able to access dependencies from other subprojects but still not be run as
You can't exclude the subproject, but you can disable subproject tasks:
gradle.taskGraph.whenReady { gradle.taskGraph.allTasks.each { if(it.project == project) { it.onlyIf { false } } } }