Spring Boot, SpringApplication nesnesinin örneğini oluştururken META-INF / spring.factories dosyasını yükler ve yapılandırma dosyasındaki yapılandırmayı Spring kapsayıcısına yükler.
1.1 Maven indirme kaynak kodu
Projedeki tüm bağımlı paketlerin kaynak kodu, bağımlılık: kaynaklar komutu ile indirilebilir.
1.2 Kaynak kod analizi
org.springframework.boot.SpringApplication:
org.springframework.core.io.support.SpringFactoriesLoader:
Yapılandırma dosyasının içeriği yüklemek için okunduğu görülebilir.
1.3 Spring.factories dosyası
# PropertySource Yükleyiciler org.springframework.boot.env.PropertySourceLoader = \ org.springframework.boot.env.PropertiesPropertySourceLoader, \ org.springframework.boot.env.YamlPropertySourceLoader # Dinleyicileri Çalıştır org.springframework.boot.SpringApplicationRunListener = \ org.springframework.boot.context.event.EventPublishingRunListener # Uygulama Bağlamı Başlatıcıları org.springframework.context.ApplicationContextInitializer = \ org.springframework.boot.context.ConfigurationWarningsApplicationContextInitializer, \ org.springframework.boot.context.ContextIdApplicationContextInitializer, \ org.springframework.boot.context.config.DelegatingApplicationContextInitializer, \ org.springframework.boot.context.embedded.ServerPortInfoApplicationContextInitializer # Uygulama Dinleyici org.springframework.context.ApplicationListener = \ org.springframework.boot.ClearCachesApplicationListener, \ org.springframework.boot.builder.ParentContextCloserApplicationListener, \ org.springframework.boot.context.FileEncodingApplicationListener, \ org.springframework.boot.context.config.AnsiOutputApplicationListener, \ org.springframework.boot.context.config.ConfigFileApplicationListener, \ org.springframework.boot.context.config.DelegatingApplicationListener, \ org.springframework.boot.liquibase.LiquibaseServiceLocatorApplicationListener, \ org.springframework.boot.logging.ClasspathLoggingApplicationListener, \ org.springframework.boot.logging.LoggingApplicationListener # Ortam Sonrası İşlemciler org.springframework.boot.env.EnvironmentPostProcessor = \ org.springframework.boot.cloud.CloudFoundryVcapEnvironmentPostProcessor, \ org.springframework.boot.env.SpringApplicationJsonEnvironmentPostProcessor # Hata Analizörleri org.springframework.boot.diagnostics.FailureAnalyzer = \ org.springframework.boot.diagnostics.analyzer.BeanCurrentlyInCreationFailureAnalyzer, \ org.springframework.boot.diagnostics.analyzer.BeanNotOfRequiredTypeFailureAnalyzer, \ org.springframework.boot.diagnostics.analyzer.BindFailureAnalyzer, \ org.springframework.boot.diagnostics.analyzer.ConnectorStartFailureAnalyzer, \ org.springframework.boot.diagnostics.analyzer.NoUniqueBeanDefinitionFailureAnalyzer, \ org.springframework.boot.diagnostics.analyzer.PortInUseFailureAnalyzer, \ org.springframework.boot.diagnostics.analyzer.ValidationExceptionFailureAnalyzer # FailureAnalysisReporters org.springframework.boot.diagnostics.FailureAnalysisReporter = \ org.springframework.boot.diagnostics.LoggingFailureAnalysisReporter\ Sonsuz anlamına gelir.
1.4 Örnek: Redis otomatik yapılandırması
Yukarıdaki yapılandırmadan görülebileceği gibi, org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration, Redis'in otomatik yapılandırmasıdır.
içerik:
1.5 Durum yorumu