使用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)
}
但没有成功。有什么想法吗?
答案 0 :(得分:4)
请你试试:
val explode by configurations.creating
或:
val explode = configurations.create("explode")
以下build.gradle.kts
脚本可以正常运行:
repositories {
mavenCentral()
}
val explode by configurations.creating
dependencies {
explode("rg.apache.samza:samza-shell:0.13.1")
}