Register SpringApplication on ReflectionHints for binding

Closes gh-31534
pull/31796/head
Moritz Halbritter 2 years ago
parent 55bb921a37
commit 26741d8044

@ -33,6 +33,8 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.springframework.aot.AotDetector; import org.springframework.aot.AotDetector;
import org.springframework.aot.hint.RuntimeHints;
import org.springframework.aot.hint.RuntimeHintsRegistrar;
import org.springframework.beans.BeansException; import org.springframework.beans.BeansException;
import org.springframework.beans.CachedIntrospectionResults; import org.springframework.beans.CachedIntrospectionResults;
import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.beans.factory.config.BeanDefinition;
@ -45,6 +47,7 @@ import org.springframework.beans.factory.support.BeanNameGenerator;
import org.springframework.beans.factory.support.DefaultListableBeanFactory; import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader; import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
import org.springframework.boot.Banner.Mode; import org.springframework.boot.Banner.Mode;
import org.springframework.boot.context.properties.ConfigurationPropertiesReflectionHintsRegistrar;
import org.springframework.boot.context.properties.bind.Bindable; import org.springframework.boot.context.properties.bind.Bindable;
import org.springframework.boot.context.properties.bind.Binder; import org.springframework.boot.context.properties.bind.Binder;
import org.springframework.boot.context.properties.source.ConfigurationPropertySources; import org.springframework.boot.context.properties.source.ConfigurationPropertySources;
@ -1390,4 +1393,14 @@ public class SpringApplication {
} }
static class SpringApplicationRuntimeHints implements RuntimeHintsRegistrar {
@Override
public void registerHints(RuntimeHints hints, ClassLoader classLoader) {
ConfigurationPropertiesReflectionHintsRegistrar.processConfigurationProperties(SpringApplication.class,
hints.reflection());
}
}
} }

@ -4,6 +4,7 @@ org.springframework.boot.env.PropertySourceRuntimeHints,\
org.springframework.boot.json.JacksonRuntimeHints,\ org.springframework.boot.json.JacksonRuntimeHints,\
org.springframework.boot.logging.java.JavaLoggingSystemRuntimeHints,\ org.springframework.boot.logging.java.JavaLoggingSystemRuntimeHints,\
org.springframework.boot.logging.logback.LogbackRuntimeHints,\ org.springframework.boot.logging.logback.LogbackRuntimeHints,\
org.springframework.boot.SpringApplication.SpringApplicationRuntimeHints,\
org.springframework.boot.WebApplicationType.WebApplicationTypeRuntimeHints org.springframework.boot.WebApplicationType.WebApplicationTypeRuntimeHints
org.springframework.beans.factory.aot.BeanFactoryInitializationAotProcessor=\ org.springframework.beans.factory.aot.BeanFactoryInitializationAotProcessor=\

Loading…
Cancel
Save