<!-- <context:property-placeholder location="classpath:config.properties" ignore-resource-not-found="true" ignore-unresolvable="true" />-->
着手把ssm 4.3.14.RELEASE项目改成springboot 2.2.2.RELEASE
需要@Configuration一个 properties 配置properties的Bean 如下即可生效, 此配置类放在springboot启动类同级别的config包下
package com.config;import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;/*** @author wbzhongsy on 2020/8/21 update** Adds support for runtime property files. Run with -Dspring.profiles.active={production,default,development,test} defaults to development.**/@Configuration
@PropertySource(value={"classpath:Business/ALL/config.properties"})
public class PropertyConfig {public PropertyConfig() {}@Beanpublic PropertySourcesPlaceholderConfigurer myPropertySourcesPlaceholderConfigurer() {return new PropertySourcesPlaceholderConfigurer();}
}