This is a two-part issue:
- Exclusions do not provide a selection reason on their own
- Exclusions remove all other selection reasons from dependency insight
Scenario
Given a build file containing a dependency with a substitution and an exclusion:
dependencies {
compile 'io.netty:netty-all:4.1.20.FINAL'
}
def substitutionMessage = '✭ substitution io.netty:netty-all -> io.netty:netty-common:4.1.23.Final'
configurations.all {
resolutionStrategy.dependencySubstitution {
substitute module('io.netty:netty-all') because (substitutionMessage) with module('io.netty:netty-common:4.1.23.Final')
}
}
def exclusionMessage = '✭ exclusion io.netty:netty-all'
configurations.all {
exclude group: 'io.netty', module: 'netty-all'
}
when I run ./gradlew dependencyInsight --dependency netty
with Gradle 4.10-20180801000007+0000
then I should see no final version selected (which I do)
and I should see a selection reason as excluded (which I do not)
and I should see a selection reason as substitution (which I do not), letting me know that the substitution added to the selection, but was not the final chosen version
Note: See full output below
Example Project
Please see the whole example project at dependency-insight/docs/exclude/exclude-substitute-static/input
An example project with a force is at dependency-insight/docs/exclude/exclude-static-force/input
Current output for reference
> Task :dependencyInsight
No dependencies matching given input were found in configuration ':compileClasspath'
This is a two-part issue:
Scenario
Given a build file containing a dependency with a substitution and an exclusion:
when I run
./gradlew dependencyInsight --dependency nettywith Gradle 4.10-20180801000007+0000
then I should see no final version selected (which I do)
and I should see a selection reason as
excluded(which I do not)and I should see a selection reason as
substitution(which I do not), letting me know that the substitution added to the selection, but was not the final chosen versionNote: See full output below
Example Project
Please see the whole example project at dependency-insight/docs/exclude/exclude-substitute-static/input
An example project with a force is at dependency-insight/docs/exclude/exclude-static-force/input
Current output for reference