// spring boot构建任务
bootJar {
classifier = 'srv'
mainClassName = 'com.**.Application'
launchScript()
}
dependencyManagement {
// 导入maven依赖管理的bom
imports {
mavenBom org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES
}
}
jar.doFirst {
manifest {
def manifestFile = "${projectDir}/META-INF/MANIFEST.MF"
if (new File(manifestFile).exists())
from (manifestFile)
}
}
jar{
enabled = true
manifest{
// manifest 文件声明主程序入口
attributes "Main-Class":"com.**.Application"
}
}