首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在spring引导分发版中添加src/dist

如何在spring引导分发版中添加src/dist
EN

Stack Overflow用户
提问于 2018-05-23 17:33:50
回答 1查看 1.1K关注 0票数 3

它看起来很像spring启动,gradle插件没有像应用插件那样打包src/dist的内容。如何将src/dist的内容添加到我的spring引导发行版zip和tar中?

代码语言:javascript
复制
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"

}
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-05-25 04:34:36

我可以解决这个问题。为了返回src/dist/文件夹,我只需要将其添加到build.gradle中。很遗憾,spring引导支持在配置文件夹中查找文件,但是分发插件忽略了它。

代码语言:javascript
复制
bootDistZip {
    into("${project.name}-boot-${project.version}") {
        from './src/dist/'
    }
}

bootDistTar {
    into("${project.name}-boot-${project.version}") {
        from './src/dist/'
    }
}
票数 5
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50494312

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档