Reputation: 73
Is there any way to configure gradle's application plugin to include only repackaged spring boot jar (by boot gradle plugin) and other resources (e.g. startup scripts) without other dependencies jars (as they already repackaged by boot gradle plugin)?
Upvotes: 2
Views: 2493
Reputation: 272
With spring-boot-gradle-plugin,here is a build.gradle example:
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
}
Upvotes: 1