使用gradle-groovy,可以使用:
创建新的配置configurations {
explode
}
dependencies {
explode (group: 'org.apache.samza', name: 'samza-shell', ext: 'tgz', classifier: 'dist', version: "$SAMZA_VERSION")
}
,但我不知道如何使用Kotlin-DSL做到这一点。我尝试了:
val explode by configurations
dependencies {
explode(group = "org.apache.samza", name = "samza-shell", ext = "tgz", classifier = "dist", version = samzaVersion)
// "explode"(group = "org.apache.samza", name = "samza-shell", ext = "tgz", classifier = "dist", version = samzaVersion)
}
但没有成功。有什么想法吗?
您可以尝试:
val explode by configurations.creating
或:
val explode = configurations.create("explode")
以下build.gradle.kts
脚本正常工作:
repositories {
mavenCentral()
}
val explode by configurations.creating
dependencies {
explode("org.apache.samza:samza-shell:0.13.1")
}