Skip to content

Latest commit

 

History

History
46 lines (36 loc) · 1.13 KB

File metadata and controls

46 lines (36 loc) · 1.13 KB

SpringApplication.run -> ConfigurableApplicationContext

  • 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);

Spring在VSCode Debug中配置运行时Args

使用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"
            ]
        }
    ]
}