这个“all*.exclude”在 Gradle 传递依赖中意味着什么?

2023-11-27

我想知道 Gradle 传递依赖中的“all*.exclude”是什么意思?

configurations {
        compile.exclude group: 'org.hamcrest', module: 'hamcrest-core'
        all*.exclude group: 'org.mockito', module: 'mockito-all'
    }

上面代码中的“all*.exclude”是 Gradle 或其他语法中的。


在此背景下,all*.指所有configurations ...

它适用exclude group: 'org.mockito', module: 'mockito-all'对他们所有人。

The all*.语法是以下的简写符号:

configurations {
    all.collect { configuration ->
        configuration.exclude group: 'org.mockito', module: 'mockito-all'
    }
}

The *.语法称为“散点运算符”,它是Groovy语法(参见段落8.1).

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

这个“all*.exclude”在 Gradle 传递依赖中意味着什么? 的相关文章

随机推荐