gradle添加依赖关系最佳实践group-name-version vs string

时间:2018-04-05 05:26:01

标签: gradle

可以使用

添加

gradle依赖项

compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.7'

compile 'org.apache.commonse:commons-lang3: '3.7'

似乎没有真正的区别 哪一个被认为是更好的做法,为什么?

1 个答案:

答案 0 :(得分:1)

完全没有区别。

如果您在Maven Central中搜索了jar,则依赖关系格式与第一个相同,而如果您在Bintray中搜索它,则格式将是第二个。由于简单,我更喜欢后者。