下面列出了org.springframework.context.support.PropertySourcesPlaceholderConfigurer#setLocation ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
/**
* Make vars.properties available to spring integration configuration
* System properties are only used if there is no setting in vars.properties.
*/
@Bean(name = "aemServiceConfigurationPropertiesConfigurer")
public static PropertySourcesPlaceholderConfigurer configurer() {
PropertySourcesPlaceholderConfigurer ppc = new PropertySourcesPlaceholderConfigurer();
ppc.setLocation(new ClassPathResource("META-INF/spring/jwala-defaults.properties"));
ppc.setLocalOverride(true);
ppc.setProperties(ApplicationProperties.getProperties());
return ppc;
}
@Bean
@Profile("!"+Initializer.PROFILE_SPRING_BOOT)
public static PropertySourcesPlaceholderConfigurer propertyPlaceholder() {
PropertySourcesPlaceholderConfigurer configurer = new PropertySourcesPlaceholderConfigurer();
configurer.setLocation(new ClassPathResource("application.properties"));
return configurer;
}
@Bean
public static PropertySourcesPlaceholderConfigurer placeholderConfigurer() {
PropertySourcesPlaceholderConfigurer c = new PropertySourcesPlaceholderConfigurer();
c.setLocation(new ClassPathResource("git.properties"));
c.setIgnoreResourceNotFound(true);
c.setIgnoreUnresolvablePlaceholders(true);
return c;
}
@Bean
public PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() {
PropertySourcesPlaceholderConfigurer properties = new PropertySourcesPlaceholderConfigurer();
properties.setLocation(new FileSystemResource("src/main/resources/external/conf.properties"));
properties.setIgnoreResourceNotFound(false);
return properties;
}
@Bean
public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() {
PropertySourcesPlaceholderConfigurer propertyPlaceholderConfigurer = new PropertySourcesPlaceholderConfigurer();
propertyPlaceholderConfigurer.setLocation(new ClassPathResource("nextrtc.properties"));
return propertyPlaceholderConfigurer;
}