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

writeMainClass() — spring-boot Function Reference

Architecture documentation for the writeMainClass() function in BootBuildImageIntegrationTests.java from the spring-boot codebase.

Entity Profile

Dependency Diagram

graph TD
  f965ce7e_2357_c125_a1d3_24069c68ecf8["writeMainClass()"]
  f76834a2_f6a8_57e0_bbb7_05adc3fd3e16["buildsImageWithDefaultBuilder()"]
  f76834a2_f6a8_57e0_bbb7_05adc3fd3e16 -->|calls| f965ce7e_2357_c125_a1d3_24069c68ecf8
  7bc9c885_8b03_be0b_ebb0_984160122086["buildsImageWithTrustBuilder()"]
  7bc9c885_8b03_be0b_ebb0_984160122086 -->|calls| f965ce7e_2357_c125_a1d3_24069c68ecf8
  f33a2be5_cfe6_a6a5_a3c4_4da4d8dc484a["buildsImageWithWarPackaging()"]
  f33a2be5_cfe6_a6a5_a3c4_4da4d8dc484a -->|calls| f965ce7e_2357_c125_a1d3_24069c68ecf8
  f68efe3e_fcd9_a73c_7a43_61e75d2cfb1e["buildsImageWithWarPackagingAndJarConfiguration()"]
  f68efe3e_fcd9_a73c_7a43_61e75d2cfb1e -->|calls| f965ce7e_2357_c125_a1d3_24069c68ecf8
  2419060f_7625_2c19_b30f_7c9ad0f79d04["buildsImageWithCustomName()"]
  2419060f_7625_2c19_b30f_7c9ad0f79d04 -->|calls| f965ce7e_2357_c125_a1d3_24069c68ecf8
  6aef7cb7_4392_437d_4726_ab3c46124455["buildsImageWithCustomBuilderAndRunImage()"]
  6aef7cb7_4392_437d_4726_ab3c46124455 -->|calls| f965ce7e_2357_c125_a1d3_24069c68ecf8
  f5dda5d1_e20e_34d7_f2be_0e1de612579e["buildsImageWithCommandLineOptions()"]
  f5dda5d1_e20e_34d7_f2be_0e1de612579e -->|calls| f965ce7e_2357_c125_a1d3_24069c68ecf8
  0af8c591_6b98_4196_747c_7d4c5d984a4f["buildsImageWithPullPolicy()"]
  0af8c591_6b98_4196_747c_7d4c5d984a4f -->|calls| f965ce7e_2357_c125_a1d3_24069c68ecf8
  d7edc2cb_45a7_bb69_2475_85cbc75d8407["buildsImageWithBuildpackFromBuilder()"]
  d7edc2cb_45a7_bb69_2475_85cbc75d8407 -->|calls| f965ce7e_2357_c125_a1d3_24069c68ecf8
  08c15059_8d06_deba_60d1_38fc914b7eac["buildsImageWithBuildpackFromDirectory()"]
  08c15059_8d06_deba_60d1_38fc914b7eac -->|calls| f965ce7e_2357_c125_a1d3_24069c68ecf8
  606662c0_6bc0_19e8_fd7a_55751c6386f3["buildsImageWithBuildpackFromTarGzip()"]
  606662c0_6bc0_19e8_fd7a_55751c6386f3 -->|calls| f965ce7e_2357_c125_a1d3_24069c68ecf8
  b50b80c8_faff_481a_7204_0362af352b9f["buildsImageWithBuildpacksFromImages()"]
  b50b80c8_faff_481a_7204_0362af352b9f -->|calls| f965ce7e_2357_c125_a1d3_24069c68ecf8
  b758812c_0e2e_2c75_ad06_b9167981e138["buildsImageWithBinding()"]
  b758812c_0e2e_2c75_ad06_b9167981e138 -->|calls| f965ce7e_2357_c125_a1d3_24069c68ecf8
  0fd4fc95_a04e_78c7_8433_2908e613bffa["buildsImageWithTag()"]
  0fd4fc95_a04e_78c7_8433_2908e613bffa -->|calls| f965ce7e_2357_c125_a1d3_24069c68ecf8
  style f965ce7e_2357_c125_a1d3_24069c68ecf8 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

build-plugin/spring-boot-gradle-plugin/src/dockerTest/java/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests.java lines 585–605

	private void writeMainClass() throws IOException {
		File examplePackage = new File(this.gradleBuild.getProjectDir(), "src/main/java/example");
		examplePackage.mkdirs();
		File main = new File(examplePackage, "Main.java");
		try (PrintWriter writer = new PrintWriter(new FileWriter(main))) {
			writer.println("package example;");
			writer.println();
			writer.println("import java.io.IOException;");
			writer.println();
			writer.println("public class Main {");
			writer.println();
			writer.println("    public static void main(String[] args) throws Exception {");
			writer.println("        System.out.println(\"Launched\");");
			writer.println("        synchronized(args) {");
			writer.println("            args.wait(); // Prevent exit");
			writer.println("        }");
			writer.println("    }");
			writer.println();
			writer.println("}");
		}
	}

Subdomains

Calls

Frequently Asked Questions

What does writeMainClass() do?
writeMainClass() is a function in the spring-boot codebase.
What does writeMainClass() call?
writeMainClass() calls 1 function(s): wait.
What calls writeMainClass()?
writeMainClass() is called by 31 function(s): buildsImageOnLinuxArmWithImagePlatformLinuxArm, buildsImageWithApplicationDirectory, buildsImageWithBindCaches, buildsImageWithBinding, buildsImageWithBuildpackFromBuilder, buildsImageWithBuildpackFromDirectory, buildsImageWithBuildpackFromTarGzip, buildsImageWithBuildpacksFromImages, and 23 more.

Analyze Your Own Codebase

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

Try Supermodel Free