public interface DependencyResolveDetails
Modifier and Type | Method | Description |
---|---|---|
DependencyResolveDetails |
because(String description) |
Sets a human readable description for the reason the component is selected.
|
ModuleVersionSelector |
getRequested() |
The module, before it is resolved.
|
ModuleVersionSelector |
getTarget() |
The target module selector used to resolve the dependency.
|
void |
useTarget(Object notation) |
Allows to override the details of the dependency (see
getTarget() )
when it is resolved (see getRequested() ). |
void |
useVersion(String version) |
Allows to override the version when the dependency
getRequested() is resolved. |
ModuleVersionSelector getRequested()
void useVersion(String version)
getRequested()
is resolved.
Can be used to select a version that is different than requested.
Forcing modules via ResolutionStrategy.force(Object...)
uses this capability.
Configuring a version different than requested will cause getTarget()
method
return a target module with updated target version.
If you need to change not only the version but also group or name please use the useTarget(Object)
method.
version
- to use when resolving this dependency, cannot be null.
It is valid to configure the same version as requested.void useTarget(Object notation)
getTarget()
)
when it is resolved (see getRequested()
).
This method can be used to change the dependency before it is resolved,
e.g. change group, name or version (or all three of them).
In many cases users are interested in changing the version.
For such scenario you can use the useVersion(String)
method.notation
- the notation that gets parsed into an instance of ModuleVersionSelector
.
You can pass Strings like 'org.gradle:gradle-core:1.4',
Maps like [group: 'org.gradle', name: 'gradle-core', version: '1.4'],
or instances of ModuleVersionSelector.ModuleVersionSelector getTarget()
useVersion(String)
are used.@Incubating DependencyResolveDetails because(String description)
useVersion(String)
or useTarget(Object)
description
- a description of the selection reason