jlleitschuh
01/11/2017, 7:25 PMconfigurations.all(delegateClosureOf<Configuration> {
val config = this
resolutionStrategy.apply {
val javaxServletApiVersion: String by rootProject.extra
val springVersion: String by rootProject.extra
// Really annoying helper functions to get around compilation issues with intellij/gradlescript kotlin
fun realEachDependency(dep: DependencyResolveDetails.() -> Unit) = eachDependency(dep)
fun realDependencySubstitution(subs: DependencySubstitutions.() -> Unit) = dependencySubstitution(subs)
realEachDependency {
fun resolver(group: String, version: String) {
if (requested.group == group) {
useTarget("${requested.group}:${requested.name}:$version")
}
}
resolver("org.springframework", springVersion)
resolver("org.slf4j", "1.7.2")
}
realDependencySubstitution {
substitute(module("javax.servlet:servlet-api")).with(module("javax.servlet:javax.servlet-api:$javaxServletApiVersion"))
}
}
})