When i use spring.profiles.active=xxx in properties file ,it throws a exception named InvalidConfigDataPropertyException.
static void throwOrWarn(Log logger, ConfigDataEnvironmentContributor contributor) {
ConfigurationPropertySource propertySource = contributor.getConfigurationPropertySource();
if (propertySource != null) {
WARNINGS.forEach((name, replacement) -> {
ConfigurationProperty property = propertySource.getConfigurationProperty(name);
if (property != null) {
logger.warn(getMessage(property, false, replacement, contributor.getResource()));
}
});
if (contributor.isFromProfileSpecificImport()
&& !contributor.hasConfigDataOption(ConfigData.Option.IGNORE_PROFILES)) {
PROFILE_SPECIFIC_ERRORS.forEach((name) -> {
ConfigurationProperty property = propertySource.getConfigurationProperty(name);
**_//Is it '==' rather then '!=' ?_**
if (property != null) {
throw new InvalidConfigDataPropertyException(property, true, null, contributor.getResource());
}
});
}
}
}
Comment From: snicoll
@LonelyPm it is impossible to say without showing your sample configuration. My best guess is that this section of the migration guide should answer your question. If it doesn't, please follow-up on StackOverflow, as mentioned in the guidelines for contributing, we prefer to use GitHub issues only for bugs and enhancements.