This repository was archived by the owner on Dec 3, 2025. It is now read-only.

Description
And configuring additional dependency properties in a statically-typed/IDE friendly way:
dependencies {
default(group = "org.gradle", name = "foo", version = "1.0") {
isForce = true
}
compile(group = "org.gradle", name = "bar") {
exclude(module = "foo")
}
runtime("org.gradle:baz:1.0-SNAPSHOT") {
isChanging = true
isTransitive = false
}
testCompile(group = "junit", name = "junit")
testRuntime(project(path = ":core")) {
exclude(group = "org.gradle")
}
}
The current workaround is to cast the returned dependency to ModuleDependency and call exclude(Map<String, String>) which is not very convenient:
(compile("module-with-transitive-dependencies") as ModuleDependency).apply {
exclude(mapOf("module" to "excluded-module"))
}
See the relevant section in the user guide.