配置了多profile,指定application-dev.properties生效
测试类中打印注入的cat.name
报错:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cat': Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'cat.name' in value "${cat.name}"
如果不使用多profile,注释掉application.properties中的spring.profiles.active=dev,直接设置cat类的参数,可以打印“花少”
请高手指点
备注,使用yml配置可实现多profile配置