/** * Resolve the given path, replacing placeholders with corresponding * environment property values if necessary. Applied to config locations. * @param path the original file path * @return the resolved file path * @see org.springframework.core.env.Environment#resolveRequiredPlaceholders(String) */ protected String resolvePath(String path) { return getEnvironment().resolveRequiredPlaceholders(path); }
/** * Resolve the given path, replacing placeholders with corresponding * environment property values if necessary. Applied to config locations. * @param path the original file path * @return the resolved file path * @see org.springframework.core.env.Environment#resolveRequiredPlaceholders(String) */ protected String resolvePath(String path) { return getEnvironment().resolveRequiredPlaceholders(path); }
/** * Resolve the given path, replacing placeholders with corresponding * environment property values if necessary. Applied to config locations. * @param path the original file path * @return the resolved file path * @see org.springframework.core.env.Environment#resolveRequiredPlaceholders(String) */ protected String resolvePath(String path) { return getEnvironment().resolveRequiredPlaceholders(path); }
@Override public void initialize(AbstractRefreshableConfigApplicationContext ctx) { ctx.setAllowBeanDefinitionOverriding(false); ConfigurableEnvironment env = ctx.getEnvironment(); Set<String> aps = new LinkedHashSet<>(); Collections.addAll(aps, env.getActiveProfiles()); Collections.addAll(aps, testConfig ? Constants.PROFILES_TEST : Constants.PROFILES_PROD); env.getPropertySources().addLast(new LabelPropertySource()); env.getPropertySources().addLast(new DomainPropertySource(ctx)); env.setDefaultProfiles(Constants.PROFILE_ROOT_DEFAULT); ctx.setConfigLocations(Constants.DEFAULT_LOCATIONS); env.setActiveProfiles(aps.toArray(new String[aps.size()])); }