gpt4 book ai didi

spring-boot - Gradle Spring 启动 : Add folder at root to jar

转载 作者:行者123 更新时间:2023-12-03 03:07:46 25 4
gpt4 key购买 nike

所以我的 spring boot 项目的根目录下有一个文件夹 .ebextensions,当我在我的 gradle 插件中为 intellij 使用“bootpackage”时,这些文件没有包含在我的 jar 中。我正在 Amazon Web 上部署 jar服务如何将这些文件包含在我的 jar 中?

我的build.gradle

buildscript {
ext {
springBootVersion = '1.5.9.RELEASE'
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}

apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'org.springframework.boot'

group = 'haughton.daniel'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = 1.8

repositories {
mavenCentral()
}


ext {
springCloudVersion = 'Edgware.SR1'
}



dependencies {
//compile 'org.springframework.cloud:spring-cloud-starter-aws'
compile('org.springframework.boot:spring-boot-starter-data-jpa')
// https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-mail
compile group: 'org.springframework.boot', name: 'spring-boot-starter-mail', version: '2.0.0.RELEASE'

compile('org.springframework.boot:spring-boot-starter-jdbc')
compile('org.springframework.boot:spring-boot-starter-security')
compile('org.springframework.boot:spring-boot-starter-thymeleaf')
// https://mvnrepository.com/artifact/org.thymeleaf.extras/thymeleaf-extras-springsecurity4
compile group: 'org.thymeleaf.extras', name: 'thymeleaf-extras-springsecurity4', version: '2.1.2.RELEASE'

// https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-aws-autoconfigure
//compile group: 'org.springframework.cloud', name: 'spring-cloud-aws-autoconfigure', version: '1.2.2.RELEASE'
// https://mvnrepository.com/artifact/mysql/mysql-connector-java
// https://mvnrepository.com/artifact/mysql/mysql-connector-java
compile group: 'mysql', name: 'mysql-connector-java', version: '6.0.6'


compile('org.springframework.boot:spring-boot-starter-web')
compile ('org.apache.tomcat:tomcat-dbcp:8.0.30')

runtime('mysql:mysql-connector-java')
testCompile('org.springframework.boot:spring-boot-starter-test')
testCompile('org.springframework.security:spring-security-test')
}

dependencyManagement {
imports {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
}
}

最佳答案

解决方法:将此添加到我的 build.gradle

processResources {
from ('.ebextensions/') {
into '.ebextensions'
}
}

关于spring-boot - Gradle Spring 启动 : Add folder at root to jar,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49830570/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com