允許修改相依軟體組件的 metadata。
範例
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) | 允許設定組件模組 metadata。此 metadata 適用於整個組件模組 (例如 "group:name",如 "org.gradle:gradle-core"),無論組件版本為何。 |
void
module
(Object
moduleNotation, Action
<? super ComponentModuleMetadataDetails
>
rule)
Action
<? super ComponentModuleMetadataDetails
>允許設定組件模組 metadata。此 metadata 適用於整個組件模組 (例如 "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') }