Reputation: 3462
I'm trying to get configuration-binding in my Spring-MVC application (non Spring-Boot) enabled using the @ConfigurationProperties. The only thing i did so far, is that I added the Maven spring-boot
dependency to my project, to get the ConfigurationProperties
class.
@Configuration
@PropertySource("classpath:foo.properties")
@ConfigurationProperties(prefix = "foo")
public class FooConfig{
private String bar;
// ...
}
So far nothing is being bound. Any thoughts to get the binding going?
Upvotes: 4
Views: 4197
Reputation: 27078
You need to Enable Configuration Properties.
@EnableConfigurationProperties
Upvotes: 4