Home / Function/ run() — spring-boot Function Reference

run() — spring-boot Function Reference

Architecture documentation for the run() function in SpringApplication.java from the spring-boot codebase.

Function java GradlePlugin RunTasks calls 18 called by 44

Entity Profile

Dependency Diagram

graph TD
  89cfa04a_3922_680e_945d_5b4338252cc7["run()"]
  f5ecfeee_2faa_bfff_05c7_ad8e17034d42["run()"]
  f5ecfeee_2faa_bfff_05c7_ad8e17034d42 -->|calls| 89cfa04a_3922_680e_945d_5b4338252cc7
  7d95f3c2_28fa_0d04_ca14_7d503e8c0d1e["main()"]
  7d95f3c2_28fa_0d04_ca14_7d503e8c0d1e -->|calls| 89cfa04a_3922_680e_945d_5b4338252cc7
  6354a87f_14d0_df84_0a6c_416a9753a401["main()"]
  6354a87f_14d0_df84_0a6c_416a9753a401 -->|calls| 89cfa04a_3922_680e_945d_5b4338252cc7
  e72d9947_0d33_6ec3_929e_b7656804e297["main()"]
  e72d9947_0d33_6ec3_929e_b7656804e297 -->|calls| 89cfa04a_3922_680e_945d_5b4338252cc7
  1637eabd_fd17_1dd9_f2d3_8edc9bc80bd2["main()"]
  1637eabd_fd17_1dd9_f2d3_8edc9bc80bd2 -->|calls| 89cfa04a_3922_680e_945d_5b4338252cc7
  e22cfaf5_11ef_259d_3423_56f4c8af7ff4["main()"]
  e22cfaf5_11ef_259d_3423_56f4c8af7ff4 -->|calls| 89cfa04a_3922_680e_945d_5b4338252cc7
  903bd4c2_8f4b_9588_a64a_9a4662f829ef["main()"]
  903bd4c2_8f4b_9588_a64a_9a4662f829ef -->|calls| 89cfa04a_3922_680e_945d_5b4338252cc7
  7e15fedf_d901_f5bf_c92c_fba9a0a5aa76["main()"]
  7e15fedf_d901_f5bf_c92c_fba9a0a5aa76 -->|calls| 89cfa04a_3922_680e_945d_5b4338252cc7
  bd188887_6e2f_c71b_e82a_4ea439d7fbe3["main()"]
  bd188887_6e2f_c71b_e82a_4ea439d7fbe3 -->|calls| 89cfa04a_3922_680e_945d_5b4338252cc7
  44a85314_e524_b2d3_0621_46e3ae4aba92["main()"]
  44a85314_e524_b2d3_0621_46e3ae4aba92 -->|calls| 89cfa04a_3922_680e_945d_5b4338252cc7
  d004cdb6_69bd_249d_b0b8_2de29bcbd306["main()"]
  d004cdb6_69bd_249d_b0b8_2de29bcbd306 -->|calls| 89cfa04a_3922_680e_945d_5b4338252cc7
  10ad8526_da56_6450_52fd_70991c6bd5e8["main()"]
  10ad8526_da56_6450_52fd_70991c6bd5e8 -->|calls| 89cfa04a_3922_680e_945d_5b4338252cc7
  23c16ca4_9a14_1c9a_5764_1963d6ff0bbe["main()"]
  23c16ca4_9a14_1c9a_5764_1963d6ff0bbe -->|calls| 89cfa04a_3922_680e_945d_5b4338252cc7
  1303379b_8ceb_3417_5271_8cbad56ff711["main()"]
  1303379b_8ceb_3417_5271_8cbad56ff711 -->|calls| 89cfa04a_3922_680e_945d_5b4338252cc7
  style 89cfa04a_3922_680e_945d_5b4338252cc7 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

core/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java lines 304–342

	public ConfigurableApplicationContext run(String... args) {
		Startup startup = Startup.create();
		if (this.properties.isRegisterShutdownHook()) {
			SpringApplication.shutdownHook.enableShutdownHookAddition();
		}
		DefaultBootstrapContext bootstrapContext = createBootstrapContext();
		ConfigurableApplicationContext context = null;
		configureHeadlessProperty();
		SpringApplicationRunListeners listeners = getRunListeners(args);
		listeners.starting(bootstrapContext, this.mainApplicationClass);
		try {
			ApplicationArguments applicationArguments = new DefaultApplicationArguments(args);
			ConfigurableEnvironment environment = prepareEnvironment(listeners, bootstrapContext, applicationArguments);
			Banner printedBanner = printBanner(environment);
			context = createApplicationContext();
			context.setApplicationStartup(this.applicationStartup);
			prepareContext(bootstrapContext, context, environment, listeners, applicationArguments, printedBanner);
			refreshContext(context);
			afterRefresh(context, applicationArguments);
			Duration timeTakenToStarted = startup.started();
			if (this.properties.isLogStartupInfo()) {
				new StartupInfoLogger(this.mainApplicationClass, environment).logStarted(getApplicationLog(), startup);
			}
			listeners.started(context, timeTakenToStarted);
			callRunners(context, applicationArguments);
		}
		catch (Throwable ex) {
			throw handleRunFailure(context, ex, listeners);
		}
		try {
			if (context.isRunning()) {
				listeners.ready(context, startup.ready());
			}
		}
		catch (Throwable ex) {
			throw handleRunFailure(context, ex, null);
		}
		return context;
	}

Domain

Subdomains

Calls

Frequently Asked Questions

What does run() do?
run() is a function in the spring-boot codebase.
What does run() call?
run() calls 18 function(s): SpringApplication, afterRefresh, callRunners, configureHeadlessProperty, create, createApplicationContext, createBootstrapContext, getApplicationLog, and 10 more.
What calls run()?
run() is called by 44 function(s): aotEnvironmentPostProcessorShouldBeAppliedFirst, callRunner, cleanupOccursAfterWebServerShutdown, clear, contextWithClassLoader, disabled, disabledViaApplicationProperties, enabled, and 36 more.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free