我正在启动一个基于gradle的新项目,并且对这项技术是全新的。我一直在阅读文档和教程,但我不想理解依赖项部分的一个概念。我看到某些this one之类的github项目像这样编写其构建脚本:
extensions {
//version variables
}
dependencies {
testImplementation(
"com.google.guava:guava:$guavaVersion",
"io.netty:netty-codec-http:$nettyVersion",
"io.netty:netty-handler:$nettyVersion",
"com.fasterxml.jackson.core:jackson-databind:$jacksonVersion",
"org.apache.httpcomponents:httpclient:$httpComponentVersion",
"com.jayway.jsonpath:json-path:$jsonpathVersion",
"org.freemarker:freemarker:$freemarkerVersion",
"org.slf4j:slf4j-api:$slf4jVersion"
)
}
但是后来我在this github project上看到了这样的例子:
dependencies {
testImplementation 'ch.qos.logback:logback-classic:1.2.3'
testImplementation ("org.seleniumhq.selenium:selenium-java:3.141.59")
testImplementation ("org.testng:testng:6.14.3")
}
和更不同的是,在gradle网站上,我看到了这一点:
dependencies {
testImplementation group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.3'
testImplementation group: 'org.seleniumhq.selenium', name: 'selenium-java', version: '3.141.59'
testImplementation group: 'org.testng', name: 'testng', version: '6.14.3'
}
我看到
的巨大差异编写gradle脚本的最佳方法是什么?什么是企业标准和最佳实践?