Issue
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?
Solution
You need to Enable Configuration Properties.
@EnableConfigurationProperties
Answered By - pvpkiran
Answer Checked By - Marie Seifert (JavaFixing Admin)