build.gradle 使用 ShadowJar 打包带有依赖的 Jar

主要就是这两个地方

plugins {
    id 'java'
    id 'com.github.johnrengelman.shadow' version '7.1.2'
}
shadowJar {
    manifest.attributes.put("Implementation-Version", archiveVersion)
    manifest.attributes.put("Main-Class", "main 函数所在类")
}
posted @ 2022-02-14 11:31  博麗靈夢  阅读(1282)  评论(0编辑  收藏  举报