允许修改依赖软件组件的元数据。
示例
dependencies {
modules {
//Configuring component module metadata for the entire "google-collections" module,
// declaring that legacy library was replaced with "guava".
//This way, Gradle's conflict resolution can use this information and use "guava"
// in case both libraries appear in the same dependency tree.
module("com.google.collections:google-collections") {
replacedBy("com.google.guava:guava")
}
}
}
| 方法 | 描述 |
module(moduleNotation, rule) | 启用配置组件模块元数据。此元数据适用于整个组件模块(例如“group:name”,如“org.gradle:gradle-core”),无论组件版本如何。 |
void module(Object moduleNotation, Action<? super ComponentModuleMetadataDetails> rule)
Action<? super ComponentModuleMetadataDetails>启用配置组件模块元数据。此元数据适用于整个组件模块(例如“group:name”,如“org.gradle:gradle-core”),无论组件版本如何。
//declaring that google collections are replaced by guava //so that conflict resolution can take advantage of this information: dependencies.modules.module('com.google.collections:google-collections') { replacedBy('com.google.guava:guava') }