这是用于大型构建上的Maven到Gradle构建转换。想想罗丹,吉多拉,哥斯拉等等。那么大。
给定如下所示的依赖关系:
ext.jbossBom = [ ... ]// This is in the root project.
compile (rootProject.ext.jbossBom) //This is not in the root project如何从上述项目中排除项目?我试过以下几种变体:
compile (rootProject.ext.jbossBom) {
exclude group: "some.group", module: "some.module"
}发布于 2016-02-12 01:15:41
jbossBom是一个集合。删除要消除的元素:
compile (rootProject.ext.jbossBom.findAll{ !it.startsWith('some.group')})要从全局上排除特定的传递依赖(不管哪种依赖带来它),您可以这样做:
configurations {
compile.exclude group: 'commons-math3', module: 'commons-math3'
compile.exclude group: 'commons-pool2', module: 'commons-pool2'
}要从jbossBom的每个内容中排除特定的传递依赖关系,可以这样做:
dependencies{
jbossBom.each{
compile (it){exclude group:'foo', module:'bar'}
}
}https://stackoverflow.com/questions/35348157
复制相似问题