我已经运行了 gradlew
命令来获取 Gradle 依赖树:
gradlew.bat app:dependencies
在输出时,我得到了每个依赖项附带的不同类型的符号:
com.twotoasters.servos:util-otto:1.0.0
com.squareup.okhttp:okhttp:2.4.0 (*)
com.android.support:recyclerview-v7:23.2.0 -> 25.0.0
有些依赖没有任何符号,有些依赖有 (*)
和 ->
。
这些符号是什么意思?
我试图搜索这个,但没有找到任何帮助。
最佳答案
(*)
位于依赖项旁边,该依赖项已通过其他 Artifact 导入,因此导致重复。
在 ./gradlew :app:dependencies
输出的末尾,您可以看到:
->
位于依赖项旁边,该依赖项已通过其他 Artifact 导入,但版本较新。 Gradle 会更喜欢较新的版本。
因此,com.android.support:recyclerview-v7:23.2.0 -> 25.0.0
意味着 25.0.0
版本已经导入,但是特别是该 Artifact 依赖于较旧的 23.2.0
版本。
参见 Egor Andreevici 的解释来自他的 "Making the most of your Gradle Builds"来自 Droidcon Italy 2017 的演讲。
关于java - Gradle 依赖关系树中星号和箭头符号的含义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43656072/