Reputation: 7647
How can I read the properties in a property file inside a Spring boot application?
In a normal Spring application we can do this by adding this in context:
<context:property-placeholder location="classpath*:my.properties"/>
Then refer the property using:
@Value("${my.property.name}")
Private String name;
Upvotes: 0
Views: 353
Reputation: 2237
Just use @SpringBootApplication and your @Value will pick value from application.properties or yml from resource folder.
Upvotes: 1