I\'m trying to add an .ebextensions folder to the root level of my jar to be deployed to AWS elastic beanstalk.
My folder structure is:
main:
--src
--re
For those of you using Gradle, here is what needs to be added to your build.gradle in order to add the .ebextensions stuff to the root of the jar.
It assumes that the .ebextensions directory and contents are in the root of your project.
Normal Java app:
jar {
from(".") {
include ".ebextensions/**"
}
}
Spring Boot app:
bootJar {
from(".") {
include ".ebextensions/**"
}
}
The Spring Boot case is slightly different to the normal Java case because with Spring Boot it is the Spring Boot Gradle plugin that actually constructs the jar - and it uses a special "bootJar" task in place of the standard Java plugin "jar" task.
I think that for Maven builds, Javier's answer is the cleanest way to go. For me, this illustrates the flexibility of Gradle over Maven when modifying "standard" builds.