因此,我在spring boot项目的根目录下有一个.ebextensions文件夹,当我在用于intellij.I的gradle插件中使用"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}"
}
}发布于 2018-04-14 19:19:01
解决方案:将此代码添加到我的build.gradle
processResources {
from ('.ebextensions/') {
into '.ebextensions'
}
}发布于 2019-01-31 15:55:09
我在我的项目源代码中添加了一个ebextensions文件夹,其中包含带有nginx配置的.ebextensions文件夹:
文件夹结构

我扩展了bootJar任务:
bootJar {
baseName = 'project'
version = '1.0.0'
from('ebextensions')
//...当我运行./gradlew cle ass bootJar时,解压缩后的项目-1.0.0.jar包含:
我使用的是Gradle 4.10。
根本原因是ElasticBeanstalk的413请求实体太大。
Proxy.conf的完整内容:
client_max_body_size 20M;https://stackoverflow.com/questions/49830570
复制相似问题