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

main() — spring-boot Function Reference

Architecture documentation for the main() function in SpringCli.java from the spring-boot codebase.

Entity Profile

Dependency Diagram

graph TD
  a2c16583_5a36_a7dd_517c_6810d69952d6["main()"]
  6bdc8b08_5507_7805_1483_650e01bbe47a["CommandRunner()"]
  a2c16583_5a36_a7dd_517c_6810d69952d6 -->|calls| 6bdc8b08_5507_7805_1483_650e01bbe47a
  43178ee5_b98d_17d2_e267_9bad8746b2c1["createExtendedClassLoader()"]
  a2c16583_5a36_a7dd_517c_6810d69952d6 -->|calls| 43178ee5_b98d_17d2_e267_9bad8746b2c1
  48695443_ab03_c0ba_5509_a65981075210["addCommand()"]
  a2c16583_5a36_a7dd_517c_6810d69952d6 -->|calls| 48695443_ab03_c0ba_5509_a65981075210
  c84c5a87_8c46_951d_34ab_999d2387ef38["HelpCommand()"]
  a2c16583_5a36_a7dd_517c_6810d69952d6 -->|calls| c84c5a87_8c46_951d_34ab_999d2387ef38
  dd854fc5_d5f8_50f8_ef09_7e9365493bb8["addServiceLoaderCommands()"]
  a2c16583_5a36_a7dd_517c_6810d69952d6 -->|calls| dd854fc5_d5f8_50f8_ef09_7e9365493bb8
  2c823177_81f5_b791_6d91_e50a9a0f89c0["ShellCommand()"]
  a2c16583_5a36_a7dd_517c_6810d69952d6 -->|calls| 2c823177_81f5_b791_6d91_e50a9a0f89c0
  ed677779_3218_5910_6ec6_1fb4aceafa07["HintCommand()"]
  a2c16583_5a36_a7dd_517c_6810d69952d6 -->|calls| ed677779_3218_5910_6ec6_1fb4aceafa07
  b205c07d_819c_fce5_ae8a_ed4686cb30a6["setOptionCommands()"]
  a2c16583_5a36_a7dd_517c_6810d69952d6 -->|calls| b205c07d_819c_fce5_ae8a_ed4686cb30a6
  8de84945_7cc0_ac07_bb85_54615794800e["setHiddenCommands()"]
  a2c16583_5a36_a7dd_517c_6810d69952d6 -->|calls| 8de84945_7cc0_ac07_bb85_54615794800e
  146781aa_36d9_10e6_eb21_8c24c5539805["runAndHandleErrors()"]
  a2c16583_5a36_a7dd_517c_6810d69952d6 -->|calls| 146781aa_36d9_10e6_eb21_8c24c5539805
  style a2c16583_5a36_a7dd_517c_6810d69952d6 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

cli/spring-boot-cli/src/main/java/org/springframework/boot/cli/SpringCli.java lines 52–70

	public static void main(String... args) {
		System.setProperty("java.awt.headless", Boolean.toString(true));
		LogbackInitializer.initialize();

		CommandRunner runner = new CommandRunner("spring");
		ClassUtils.overrideThreadContextClassLoader(createExtendedClassLoader(runner));
		runner.addCommand(new HelpCommand(runner));
		addServiceLoaderCommands(runner);
		runner.addCommand(new ShellCommand());
		runner.addCommand(new HintCommand(runner));
		runner.setOptionCommands(HelpCommand.class, VersionCommand.class);
		runner.setHiddenCommands(HintCommand.class);

		int exitCode = runner.runAndHandleErrors(args);
		if (exitCode != 0) {
			// If successful, leave it to run in case it's a server app
			System.exit(exitCode);
		}
	}

Domain

Subdomains

Frequently Asked Questions

What does main() do?
main() is a function in the spring-boot codebase.
What does main() call?
main() calls 10 function(s): CommandRunner, HelpCommand, HintCommand, ShellCommand, addCommand, addServiceLoaderCommands, createExtendedClassLoader, runAndHandleErrors, and 2 more.

Analyze Your Own Codebase

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

Try Supermodel Free