Gradle 如何将src/dist添加到spring引导发行版

Gradle 如何将src/dist添加到spring引导发行版,gradle,spring-boot-gradle-plugin,Gradle,Spring Boot Gradle Plugin,看起来SpringBoots gradle插件不像应用程序插件那样包装src/dist的内容。如何将src/dist add的内容添加到我的spring boot发行版zip和tar中 plugins { id 'java' id 'application' id 'org.springframework.boot' version '2.0.2.RELEASE' id "io.spring.dependency-management" version "1.0.

看起来SpringBoots gradle插件不像应用程序插件那样包装src/dist的内容。如何将src/dist add的内容添加到我的spring boot发行版zip和tar中

plugins {
    id 'java'
    id 'application'
    id 'org.springframework.boot' version '2.0.2.RELEASE'
    id "io.spring.dependency-management" version "1.0.5.RELEASE"
}

version '1.0-SNAPSHOT'

repositories {
    jcenter()
    mavenCentral()
}

sourceCompatibility = 1.8
targetCompatibility = 1.8
mainClassName = "kic.data.server.Server"

dependencies {
    compile 'org.springframework.boot:spring-boot-starter'
    compile 'org.springframework.boot:spring-boot-starter-web'
    compile 'org.apache.commons:commons-lang3:3.7'

    testCompile group: 'junit', name: 'junit', version: '4.12'
    testCompile "org.springframework.boot:spring-boot-starter-test"

    testCompile 'org.spockframework:spock-core:1.1-groovy-2.4'
    testCompile 'org.hamcrest:hamcrest-core:1.3'
    testCompile "com.github.tomakehurst:wiremock-standalone:2.16.0"

}

我可以解决它。要添加回
src/dist/
文件夹,我只需要将它添加到我的build.gradle中。遗憾的是,SpringBoot支持在配置文件夹中查找文件,但是分发插件忽略了它

bootDistZip {
    into("${project.name}-boot-${project.version}") {
        from './src/dist/'
    }
}

bootDistTar {
    into("${project.name}-boot-${project.version}") {
        from './src/dist/'
    }
}

我可以解决它。要添加回
src/dist/
文件夹,我只需要将它添加到我的build.gradle中。遗憾的是,SpringBoot支持在配置文件夹中查找文件,但是分发插件忽略了它

bootDistZip {
    into("${project.name}-boot-${project.version}") {
        from './src/dist/'
    }
}

bootDistTar {
    into("${project.name}-boot-${project.version}") {
        from './src/dist/'
    }
}

那救了我一天!谢谢!那救了我一天!谢谢!