I have a properties class below in my spring-boot project.
@Component
@ConfigurationProperties(prefix = \"myprefix\")
public class MyProperties {
private Str
In spring-boot 1.5.10 (and possibly earlier) setting a default value works as-per your suggested way. Example:
@Component
@ConfigurationProperties(prefix = "myprefix")
public class MyProperties {
@Value("${spring.application.name}")
protected String appName;
}
The @Value
default is only used if not overridden in your own property file.