Customizing resolution of a dependency directly
use variant define attributes
1 2 3 4 5 6 7 8 9
| configurations.all { resolutionStrategy.dependencySubstitution { substitute(variant(module("com.google.guava:guava:28.2-jre")) { attributes { attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.REGULAR_PLATFORM)) } }).using(module("com.google.guava:guava:28.2-jre")) } }
|
specify capabilities
1 2 3 4 5 6 7 8 9
| configurations.testCompileClasspath { resolutionStrategy.dependencySubstitution { substitute(module("com.acme:lib:1.0")).using(variant(module("com.acme:lib:1.0")) { capabilities { requireCapability("com.acme:lib-test-fixtures") } }) } }
|