我已将我的war文件部署在AWS的Elastic Beanstalk上作为java应用程序。
我想在AWS上指定:spring.profiles.active就像我执行时一样:
java -jar -Dspring.profiles.active=prod target/gaming-boost-0.0.1-SNAPSHOT.war
我只能在“配置”上配置“环境属性”
在ElasticBeanStalk中设置以下环境变量
SPRING_PROFILES_ACTIVE=prod
看看https://stackoverflow.com/a/39021794/2135973
设置为环境变量与命令行属性时,外壳不同。尝试在EB配置中设置SPRING_PROFILES_ACTIVE。