Scenario:
- AWS Elastic Beanstalk
- Java application
- .ebextensions currently placed in src/main/resources/.ebextensions
Commands are not being executed.
Where is the .ebextensions supposed to go in a Java application?
Scenario:
Commands are not being executed.
Where is the .ebextensions supposed to go in a Java application?
.ebextensions should be placed in the root of WAR.
The WAR structure looks like the following:
web_app.war
|
|_.ebextensions
| |_ 01run.config
| |_ 02do.config
|
|_META-INF
|
|_WEB-INF
|_ classes
|_ lib
|_ web.xml
Refer to the official AWS docs for further information.
.ebextensions
for a while, but it accepts both paths(in /WEB-INF/.ebextensions
and /.ebextensions
of WAR). –
Shackleton Using Maven I did as follows:
add the following to pom.xml
<plugin>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<webResources>
<resource>
<directory>src/main/ebextensions</directory>
<targetPath>.ebextensions</targetPath>
<filtering>true</filtering>
</resource>
</webResources>
</configuration>
</plugin>
to transfer the files to the top level of the war when it is built.
.ebextensions should be placed in the root of WAR.
The WAR structure looks like the following:
web_app.war
|
|_.ebextensions
| |_ 01run.config
| |_ 02do.config
|
|_META-INF
|
|_WEB-INF
|_ classes
|_ lib
|_ web.xml
Refer to the official AWS docs for further information.
.ebextensions
for a while, but it accepts both paths(in /WEB-INF/.ebextensions
and /.ebextensions
of WAR). –
Shackleton Using gradle I did the following
apply plugin: 'war'
war {
from('src/main/resources/ebextensions') {
into('.ebextensions')
}
}
to transfer the files to the top level of the war when it is built.
you missed resources, it works when I put the path right
war {
from('src/main/resources/ebextensions') {
into('.ebextensions')
}
}
Update for people here in 2020, now task name is "bootWar"
bootWar {
from('src/main/resources/ebextensions') {
into('.ebextensions')
}
}
© 2022 - 2024 — McMap. All rights reserved.