gradle - 无法排除依赖 gradle
问题描述
我需要从 io.confluent:kafka-schema-registry:5.3.0 中排除 slf4j 依赖项。我试过使用
implementation ('io.confluent:kafka-schema-registry:5.3.0') {
exclude(group='org.slf4j',module='slf4j-loh4j12')
}
但我不断收到错误
Cannot set the value of read-only property 'group' for DefaultExternalModuleDependency{group='io.confluent', name='kafka-schema-registry', version='5.3.0', configuration='default'} of type org.gradle.api.internal.artifacts.dependencies.DefaultExternalModuleDependency.
谁能告诉我如何实现这一目标。我尝试了多种方法但无法做到
解决方案
for 的语法exclude()
不正确。您必须使用:
而不是=
. exclude()
将 aMap
作为输入,因此,在 Groovy DSL 中,它必须写为:
implementation ('io.confluent:kafka-schema-registry:5.3.0') {
exclude(group: 'org.slf4j', module: 'slf4j-log4j12')
}
推荐阅读
- typescript - 将类型转换为类型元组的实用程序类型
- itext - itext7:定位签名的矩形
- reactjs - 使用带有 Material UI 的复选框来更改 redux 中属性的布尔值
- python - 绘制阈值后更改线条颜色
- javascript - 抓取嵌套页面 puppeteer
- javascript - 通过 jQuery 更改部分样式
- javascript - 赋值而不先声明变量
- python - 如何使打印语句保持在同一行,同时将我的输入输入到下一个
- javascript - 数据库 API 搜索并在列表中显示结果(React Native)
- python - Python - 从函数中转换列表结果?