Package org.gradle.api.artifacts
Interface DependencySubstitution
public interface DependencySubstitution
Provides means to substitute a different dependency during resolution.
- Since:
- 2.5
- 
Method SummaryModifier and TypeMethodDescriptionvoidartifactSelection(Action<? super ArtifactSelectionDetails> action) Configures the artifact selection for the substitution.The requested dependency, before it is resolved.voidThis method can be used to replace a dependency before it is resolved, e.g.voidThis method can be used to replace a dependency before it is resolved, e.g.
- 
Method Details- 
getRequestedComponentSelector getRequested()The requested dependency, before it is resolved. The requested dependency does not change even if there are multiple dependency substitution rules that manipulate the dependency metadata.
- 
useTargetThis method can be used to replace a dependency before it is resolved, e.g. change group, name or version (or all three of them), or replace it with a project dependency. Accepted notations are:- Strings encoding group:module:version, like 'org.gradle:gradle-core:2.4'
- Maps like [group: 'org.gradle', name: 'gradle-core', version: '2.4']
- Project instances like project(":api")
- Any instance of ModuleComponentSelectororProjectComponentSelector
 - Parameters:
- notation- the notation that gets parsed into an instance of- ComponentSelector.
 
- 
useTargetThis method can be used to replace a dependency before it is resolved, e.g. change group, name or version (or all three of them), or replace it with a project dependency and provides a human readable reason for diagnostics. Accepted notations are:- Strings encoding group:module:version, like 'org.gradle:gradle-core:2.4'
- Maps like [group: 'org.gradle', name: 'gradle-core', version: '2.4']
- Project instances like project(":api")
- Any instance of ModuleComponentSelectororProjectComponentSelector
 - Parameters:
- notation- the notation that gets parsed into an instance of- ComponentSelector.
- Since:
- 4.5
 
- 
artifactSelectionConfigures the artifact selection for the substitution. This is a convenience method which allows selecting, typically, different artifact classifiers for the same component. Artifact selection matters for components which are not published with Gradle Module Metadata and therefore do not provide proper variants to reason with.- Parameters:
- action- the artifact selection configuration action
- Since:
- 6.6
 
 
-