Spring Boot 2 Gradle plugin without executable jar

前端 未结 5 2649
感情败类
感情败类 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:24

    This kotlin DSL version of @panser answer works for me (disable spring-boot bootJar task and enable jar task):

    import org.springframework.boot.gradle.tasks.bundling.BootJar
    
    tasks.getByName("bootJar") {
        enabled = false
    }
    
    tasks.getByName("jar") {
        enabled = true
    }
    

提交回复
热议问题