Files
spring-boot-rest/spring-boot-artifacts/src/main/java/com/baeldung/properties/ExternalPropertyConfigurer.java
2019-09-27 01:07:06 +05:30

18 lines
733 B
Java

package com.baeldung.properties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
import org.springframework.core.io.FileSystemResource;
@Configuration
public class ExternalPropertyConfigurer {
@Bean
public PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() {
PropertySourcesPlaceholderConfigurer properties = new PropertySourcesPlaceholderConfigurer();
properties.setLocation(new FileSystemResource("src/main/resources/external/conf.properties"));
properties.setIgnoreResourceNotFound(false);
return properties;
}
}