|
|
@ -233,7 +233,7 @@ class ConfigDataEnvironment {
|
|
|
|
contributors = processWithoutProfiles(contributors, importer, activationContext);
|
|
|
|
contributors = processWithoutProfiles(contributors, importer, activationContext);
|
|
|
|
activationContext = withProfiles(contributors, activationContext);
|
|
|
|
activationContext = withProfiles(contributors, activationContext);
|
|
|
|
contributors = processWithProfiles(contributors, importer, activationContext);
|
|
|
|
contributors = processWithProfiles(contributors, importer, activationContext);
|
|
|
|
applyToEnvironment(contributors, activationContext);
|
|
|
|
applyToEnvironment(contributors, activationContext, importer.getLoadedLocations());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private ConfigDataEnvironmentContributors processInitial(ConfigDataEnvironmentContributors contributors,
|
|
|
|
private ConfigDataEnvironmentContributors processInitial(ConfigDataEnvironmentContributors contributors,
|
|
|
@ -320,9 +320,9 @@ class ConfigDataEnvironment {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void applyToEnvironment(ConfigDataEnvironmentContributors contributors,
|
|
|
|
private void applyToEnvironment(ConfigDataEnvironmentContributors contributors,
|
|
|
|
ConfigDataActivationContext activationContext) {
|
|
|
|
ConfigDataActivationContext activationContext, Set<ConfigDataLocation> loadedLocations) {
|
|
|
|
checkForInvalidProperties(contributors);
|
|
|
|
checkForInvalidProperties(contributors);
|
|
|
|
checkMandatoryLocations(contributors, activationContext);
|
|
|
|
checkMandatoryLocations(contributors, activationContext, loadedLocations);
|
|
|
|
MutablePropertySources propertySources = this.environment.getPropertySources();
|
|
|
|
MutablePropertySources propertySources = this.environment.getPropertySources();
|
|
|
|
this.logger.trace("Applying config data environment contributions");
|
|
|
|
this.logger.trace("Applying config data environment contributions");
|
|
|
|
for (ConfigDataEnvironmentContributor contributor : contributors) {
|
|
|
|
for (ConfigDataEnvironmentContributor contributor : contributors) {
|
|
|
@ -357,7 +357,7 @@ class ConfigDataEnvironment {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void checkMandatoryLocations(ConfigDataEnvironmentContributors contributors,
|
|
|
|
private void checkMandatoryLocations(ConfigDataEnvironmentContributors contributors,
|
|
|
|
ConfigDataActivationContext activationContext) {
|
|
|
|
ConfigDataActivationContext activationContext, Set<ConfigDataLocation> loadedLocations) {
|
|
|
|
Set<ConfigDataLocation> mandatoryLocations = new LinkedHashSet<>();
|
|
|
|
Set<ConfigDataLocation> mandatoryLocations = new LinkedHashSet<>();
|
|
|
|
for (ConfigDataEnvironmentContributor contributor : contributors) {
|
|
|
|
for (ConfigDataEnvironmentContributor contributor : contributors) {
|
|
|
|
if (contributor.isActive(activationContext)) {
|
|
|
|
if (contributor.isActive(activationContext)) {
|
|
|
@ -369,6 +369,7 @@ class ConfigDataEnvironment {
|
|
|
|
mandatoryLocations.remove(contributor.getLocation());
|
|
|
|
mandatoryLocations.remove(contributor.getLocation());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
mandatoryLocations.removeAll(loadedLocations);
|
|
|
|
if (!mandatoryLocations.isEmpty()) {
|
|
|
|
if (!mandatoryLocations.isEmpty()) {
|
|
|
|
for (ConfigDataLocation mandatoryLocation : mandatoryLocations) {
|
|
|
|
for (ConfigDataLocation mandatoryLocation : mandatoryLocations) {
|
|
|
|
this.notFoundAction.handle(this.logger, new ConfigDataLocationNotFoundException(mandatoryLocation));
|
|
|
|
this.notFoundAction.handle(this.logger, new ConfigDataLocationNotFoundException(mandatoryLocation));
|
|
|
|