springboot---->获取不到yml配置文件指定的值

时间:2025-02-13 07:24:44
1 import ; 2 import ; 3 @SpringBootApplication 4 public class App { 5 public static void main(String[] args) { 6 SpringApplication app = new SpringApplication(App.class); 7 ConfigurableApplicationContext context = (args); 8 (().getProperty("")); 9 (); 10 } 11 }

放置在classpath路径下
1 jdbc:
2 pwd: 123456 #冒号和数字之间有一个空格,没有否则获取失败,pwd前面有缩进两个字符

ps:版本spring-4.3.2-release,springboot-1.4