Gradle version
Gradle 8.2.1文章来源:https://www.toymoban.com/news/detail-607372.html
build.gradle.kts
tasks.jar {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
manifest.attributes["Main-Class"] = "zht.indi.Main"
from(configurations.runtimeClasspath.get().filter { it.name.endsWith("jar") }.map { zipTree(it) })
exclude("LICENSE.txt", "NOTICE.txt", "rootdoc.txt")
exclude("META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA")
exclude("META-INF/NOTICE", "META-INF/NOTICE.txt")
exclude("META-INF/LICENSE", "META-INF/LICENSE.txt")
exclude("META-INF/DEPENDENCIES")
}
参考
https://blog.csdn.net/setlilei/article/details/123173339文章来源地址https://www.toymoban.com/news/detail-607372.html
到了这里,关于Gradle Kotlin DSL 打包带上依赖的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!