【Video & Communication Platform】
http://study.163.com/course/introduction.htm?courseId=1004329008&utm_campaign=commission&utm_source=400000000155061&utm_medium=share
http://study.163.com/course/introduction.htm?courseId=1004638001&utm_campaign=commission&utm_source=400000000155061&utm_medium=share
https://gitee.com/happyangellxq520/spring-boot
à Spring Boot communication platform
http://412887952-qq-com.iteye.com/blog/2321532
Origin of need :
When recording Spring Boot custom properties, I found that the locations of @ConfigurationProperties are out of date, the following code:
@ConfigurationProperties(prefix="email",locations={"classpath:email.properties"}) public class Email2Properties { }
In the case of the above code, locations are outdated and are not recommended to be used.
Release Notes:
In the above situation, the premise is that the Spring Boot version uses a version above 1.4+ . If the version before 1.4 is used , such as version 1.3.3 , it can be used normally.
Solution:
( 1 ) After @EnableConfigurationProperties
deactivating the custom configuration class
( 2 ) The method used @Component
is to register as a component, and then use @PropertySource
it to specify a custom resource directory, as follows:
@Component @ConfigurationProperties(prefix="email") @PropertySource(value={"classpath:email.properties"}) public class Email2Properties { }
You can refer to the link: https://github.com/spring-projects/spring-boot/issues/6726