How Gradle package Spring Boot executable JAR

How to configure a project in Gradle can be packaged into an executable Jar Spring Boot?

 


The first thing you need to add to org.springframework.boot to plug-in:

For example the following code:

plugins {
    id 'maven-publish'
    id "org.asciidoctor.convert" version "2.3.0"
    id 'org.springframework.boot' version '2.1.4.RELEASE'
}

 

Then the application plug-in, use the following code:

apply plugin: 'io.spring.dependency-management'

Add bootJar parameters in the Build interface.

bootJar {
    baseName = 'reoc-mls-service'
    version = '0.1.0'
}

For example, the above parameters, after adding the above parameters, Jar our packers will be named:

reoc-mls-service-0.1.0.jar

https://blog.ossez.com/archives/3111

 

Guess you like

Origin www.cnblogs.com/huyuchengus/p/11697757.html