Spring-Boot multi module unable to read properties file from another module

后端 未结 2 456
情歌与酒
情歌与酒 2021-01-12 04:05

I have searched High and low and still I am unable to find a simple answer to this very annoying problem,

I have followed this great guide: JWT with multi service ap

2条回答
  •  鱼传尺愫
    2021-01-12 04:25

    After looking in Mikhail Kholodkov post(Thanks!),

    The solution is to add the following annotation to the using service Execution point:

     @PropertySources({
        @PropertySource("classpath:jwtConfig.properties"),
        @PropertySource("classpath:app.properties")
    })
    public class OtherServiceApplication {
    public static void main(String[] args) {
        SpringApplication.run(OtherServiceApplication.class, args);
        }
    }
    

提交回复
热议问题