- ConfigurableApplicationContext context
- ConfigurableListableBeanFactory
- final AnnotatedBeanDefinitionReader reader
- final ClassPathBeanDefinitionScanner scanner
- ConfigurableEnvironment environment
Step 1
prepareContext(context, environment, listeners, applicationArguments, printedBanner);
Step 2
refreshContext(context);
- ((AbstractApplicationContext)context).refresh()
- prepareRefresh();
Step 3
afterRefresh(context, applicationArguments);
使用vmArgs代替args携带Spring参数, 参考: stackoverflow
{
"version": "0.2.0",
"configurations": [
{
"type": "java",
"name": "Debug Blog Rest",
"request": "launch",
"mainClass": "com.example.BlogRestApplication",
"vmArgs": [
"-Dspring.config.location=classpath:/application.yml,classpath:/application-secret.yml"
]
}
]
}