Spring Boot 2 Gradle plugin without executable jar

前端 未结 5 2580
感情败类
感情败类 2021-02-19 19:56

How do I configure Spring Boot Gradle plugin 2 to disable the Boot distribution in Gradle Script Kotlin.

The distribution i want is a assembly bundle zip with all depend

5条回答
  •  我寻月下人不归
    2021-02-19 20:23

    spring boot 2.x

    My project is multi-module, each module can execute jar

    root build.gradle

    subprojects{
      apply plugin: 'idea'
      apply plugin: 'java'
      apply plugin: 'org.springframework.boot'  
      }
    
     bootJar { enabled = true }
     jar {enabled = true} 
    }
    

    Sub-module build.gradle

    bootJar {
        mainClassName = 'space.hi.HelloApplication'
    }
    

    Then you can click the bootRun submodule in the 'Tasks/application or build' of the idea gradle plugin, or click bootJar to generate the jar.

提交回复
热议问题