RuoYi-Cloud/build-config/build-boot-jar.gradle

29 lines
1.1 KiB
Groovy

//该产品的构建基本配置,公司统一模板,禁止开发人员开发过程中修改。
apply plugin: "org.springframework.boot"
// 清除现有的lib目录
task clearJar(type: Delete) {
delete "$buildDir\\libs\\lib"
}
// 将依赖包复制到lib目录
task copyJar(type: Copy, dependsOn: "clearJar") {
from configurations.compileClasspath
into "$buildDir\\libs\\lib"
}
bootJar {
// excludes = ["file/WaveAnalysis", "*.jar", "*.properties", "*.yaml", "config", "*.conf"]
manifest {
attributes "Main-Class": "org.springframework.boot.loader.PropertiesLauncher"
attributes "Manifest-Release-Version": version + "-" + getGitVersion()
// attributes "Class-Path": configurations.runtime.files.collect { "../lib/$it.name" }.join(" ")
attributes "releaseVersion": version + "-" + getGitVersion()
attributes "vendor": "GRIDNT山东网聪信息科技有限公司"
attributes "buildTime": new Date().format("yyyy-MM-dd HH:mm:ss", TimeZone.getTimeZone("GMT+08:00"))
}
// launchScript()
} dependsOn(clearJar, copyJar, copyConfig, copySql)