[root@xx ~]# tree /data/portal/
/data/portal/
├── portal.jar
└── config
└── application.properties // I wish it read this
java -jar portal.jar
不读取config文件夹中的属性,它固执地读取jar包中的相同文件。但是,基于24.3 Application Property Files jar应该读取config文件夹中的配置。 Maven项目也是如此。现在我必须通过--spring.config.location
手动配置文件位置。
编辑:
我刚刚发现,使用--spring.config.location=file:/absolutepath/config/application.yml
实际上并没有加载任何包含的属性文件。像这样:
spring.profiles.include: 'routes'
不会加载application-routes.yml,即使日志显示为The following profiles are active: routes