Spring Boot 1.5.x
2019-01-23 15:05:23 25 举报
AI智能生成
spring-boot笔记
作者其他创作
大纲/内容
Reference
SpringApplication
main()
SpringApplication.run
Startup failure
FailureAnalyzers
logging.level
org.springframework.boot.autoconfigure.logging.AutoConfigurationReportLoggingInitializer
commond line argument
java -jar --debug
Customizing the Banner
Properties
spring.main.banner-mode="off"
Customizing SpringApplication
Fluent builder API
SpringApplicationBuilder
Application events and listeners
run envents
ApplicationStartingEvent
ApplicationEnvironmentPreparedEvent
ApplicationPreparedEvent
ApplicationReadyEvent
ApplicationFailedEvent
add listener
contexts
child context
ancestors contexts
descendant context
hierarchy
Web environment
ApplicationContext
AnnotationConfigApplicationContext
web application
AnnotationConfigEmbeddedWebApplicationContext
not web application
Accessing application arguments
Using the ApplicationRunner or CommandLineRunner
Application exit
ExitCodeGenerator
SpringApplication.exit
System.exit
Admin features
spring.application.admin.enabled
Externalized Configuration
configurate method
properties files
YAML files
environment variables
command-line arguments
order & priority
Devtools global settings properties
@TestPropertySource
@SpringBootTest#properties
Command line arguments
$ java -jar myapp.jar --spring.application.json='{"foo":"bar"}'
SPRING_APPLICATION_JSON in an environment variable or system property
ServletConfig
ServletContext
JNDI attributes
Java System properties
OS environment variables
$ SPRING_APPLICATION_JSON='{"foo":{"bar":"spam"}}' java -jar myapp.jar
A RandomValuePropertySource that only has properties in random.*
Profile-specific application properties outside of your packaged jar
Profile-specific application properties packaged inside your jar
Application properties outside of your packaged jar
Application properties packaged inside your jar
@PropertySource annotations on your @Configuration classes
SpringApplication.setDefaultProperties
0 条评论
下一页