有没有办法配置gradle的application plugin只包含重新打包的spring boot jar(boot gradle plugin)和其他资源(例如启动脚本)而没有其他依赖jar(因为它们已经被boot gradle重新打包)插件)?
答案 0 :(得分:0)
使用spring-boot-gradle-plugin,这是一个build.gradle示例:
ext {
mainClassName = 'com.x.x'
}
springBoot {
mainClass = 'com.x.x'
layout = 'ZIP'
}
task generateExecutableJar(type: Jar) {
appendix = 'boot'
from sourceSets.main.output
}
task repackage(type: BootRepackage, dependsOn: generateExecutableJar) {
executable = true
customConfiguration = 'customDependencies'
withJarTask = generateExecutableJar
}
configurations {
customDependencies
}