Not able to get placeholder property key, while reading place holders in the application-dev.yml from external file.
@SpringBootApplication
@EnableAutoConfiguration(exclude = {WebMvcAutoConfiguration.class })
@ComponentScan("com.test.example")
@PropertySources({
@PropertySource(value = "file:/Users/myuserid/external-service.properties")
})
public class MysampleApp {
public static void main(String[] args) {
SpringApplication.run(MysampleApp.class, args);
}
}
application.yml
MySampleApp --- src -----main -- resources --config --application.yml --application-dev.yml
properties defined in application.yml
my-sample-app:
props:
url : ${external_url}
external-service.properties
external_url = http://domain/external-app/dates
ExternalServicePropConfig.java
@Component
@ConfigurationProperties(prefix = "my-sample-app.props")
@Data
public class ExternalServicePropConfig
{
private String url;
}
JDK - Zulu11 SpringBoot - 2.7.4