Build: Allow deps to be a direct jar
Currently the code which disable transitive dependencies assumes all
deps are a "module dependency" in gradle. But a jar file dep is not.
This commit relaxes the closure signature to allow any dependency and
only enforce the transitive disabling for module dependencies.
@@ -32,6 +32,7 @@ import org.gradle.api.Project
import org.gradle.api.Task
import org.gradle.api.XmlProvider
import org.gradle.api.artifacts.Configuration
+import org.gradle.api.artifacts.Dependency
import org.gradle.api.artifacts.ModuleDependency
import org.gradle.api.artifacts.ModuleVersionIdentifier
import org.gradle.api.artifacts.ProjectDependency
@@ -274,8 +275,9 @@ class BuildPlugin implements Plugin<Project> {
})
// force all dependencies added directly to compile/testCompile to be non-transitive, except for ES itself
- Closure disableTransitiveDeps = { ModuleDependency dep ->
- if (!(dep instanceof ProjectDependency) && dep.group.startsWith('org.elasticsearch') == false) {
+ Closure disableTransitiveDeps = { Dependency dep ->
+ if (dep instanceof ModuleDependency && !(dep instanceof ProjectDependency)
+ && dep.group.startsWith('org.elasticsearch') == false) {
dep.transitive = false
// also create a configuration just for this dependency version, so that later
