I'm using Spring Boot (1.0.0.RELASE) and I want to create a distribution zip file containing the following:
Preferable I would like this zip file to be created when running "gradle build" (but another task is fine if this is hard to achieve). Is there nice way to achieve this?
The Spring Boot Gradle Plugin provides Spring Boot support in Gradle. It allows you to package executable jar or war archives, run Spring Boot applications, and use the dependency management provided by spring-boot-dependencies . Spring Boot's Gradle plugin requires Gradle 6.8, 6.9, or 7.
The Distribution Plugin facilitates building archives that serve as distributions of the project. Distribution archives typically contain the executable application and other supporting files, such as documentation.
bootJar on the other hand is a specific task added by Spring Boot Gradle plugin that, when the java plugin is present, attaches itself to the assemble lifecycle task. The assemble task is automatically configured to depend upon the bootJar task so running assemble (or build ) will also run the bootJar task.
Something like this?
task zip(type: Zip, dependsOn: bootRepackage) {
from('build/libs') {
include '*.jar'
}
from 'conf'
}
build.dependsOn(zip)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With