bootstrapProperties #來自configServer的值 commandLineArgs #命令行參數 servletConfigInitParams servletContextInitParams systemProperties systemEnvironment random applicationConfig: [classpath:/application.yml] springCloudClientHostInfo applicationConfig: [classpath:/bootstrap.yml] defaultProperties Management Server
上面的排序是通過 implements ApplicationListener<ApplicationPreparedEvent>
然后打印出來的。
通過上面的順序,我們可以知道,Spring想要得到一個配置的值,就按照上面的順序一個個去找,找到就直接返回。由於Spring cloud ConfigServer處於最優先級,本地項目不管怎么設置都不能覆蓋。