问题
I wonder what does "all*.exclude" mean in Gradle transitive dependency ?
configurations {
compile.exclude group: 'org.hamcrest', module: 'hamcrest-core'
all*.exclude group: 'org.mockito', module: 'mockito-all'
}
Is "all*.exclude" in the code above syntax of Gradle or some else.
回答1:
In this context, all*.
refers to all configurations
...
and it applies exclude group: 'org.mockito', module: 'mockito-all'
to all of them.
This all*.
syntax this is the short-handed notation of:
configurations {
all.collect { configuration ->
configuration.exclude group: 'org.mockito', module: 'mockito-all'
}
}
This *.
syntax is called "spread-dot operator", which is Groovy syntax (see paragraph 8.1
).
来源:https://stackoverflow.com/questions/55441430/what-does-this-all-exclude-means-in-gradle-transitive-dependency