Gradle Kotlin DSL 打包带上依赖

Gradle version

Gradle 8.2.1

build.gradle.kts

tasks.jar.configure {
    duplicatesStrategy = DuplicatesStrategy.INCLUDE
    manifest.attributes["Main-Class"] = "com.pub.Main"
    from(configurations.runtimeClasspath.get().filter { it.name.endsWith("jar") }.map { zipTree(it) })
}

参考

https://blog.csdn.net/setlilei/article/details/123173339

你可能感兴趣的:(Gradle,kotlin,gradle)