标签:set static ota val int 读取配置 base first class
@Controller @SpringBootApplication @Configuration @ComponentScan(basePackages={"first","third"}) //配置扫描包 @PropertySource(value={"classpath:jdbc.properties"}) //指定读取配置文件 public class HelloApplication { @Value("${url}") private String url; @Bean public DataSource dataSource() { System.out.println(url); DruidDataSource ds = new DruidDataSource(); ds.setUrl(url); return ds; } public static void main(String[] args) { SpringApplication.run(HelloApplication.class, args); } }
标签:set static ota val int 读取配置 base first class
原文地址:https://www.cnblogs.com/dayanjing/p/10027940.html