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

multiModuleImplicitLayers() — spring-boot Function Reference

Architecture documentation for the multiModuleImplicitLayers() function in AbstractBootArchiveIntegrationTests.java from the spring-boot codebase.

Entity Profile

Dependency Diagram

graph TD
  ac7f2c84_3074_d9f3_cf2a_3c3718897639["multiModuleImplicitLayers()"]
  1b7ab26c_1b23_854e_e55d_187dce5b4cd2["writeSettingsGradle()"]
  ac7f2c84_3074_d9f3_cf2a_3c3718897639 -->|calls| 1b7ab26c_1b23_854e_e55d_187dce5b4cd2
  c1d87296_7b81_712e_cfb5_8a0a1fef6968["writeMainClass()"]
  ac7f2c84_3074_d9f3_cf2a_3c3718897639 -->|calls| c1d87296_7b81_712e_cfb5_8a0a1fef6968
  2537bd26_f68f_0773_f0ef_19e3a06ef3b7["writeResource()"]
  ac7f2c84_3074_d9f3_cf2a_3c3718897639 -->|calls| 2537bd26_f68f_0773_f0ef_19e3a06ef3b7
  4411a1be_530d_c0d4_e4d4_669711600b98["readLayerIndex()"]
  ac7f2c84_3074_d9f3_cf2a_3c3718897639 -->|calls| 4411a1be_530d_c0d4_e4d4_669711600b98
  c312f8db_dbba_3214_8e81_013a94f3f3ca["getExpectedApplicationLayerContents()"]
  ac7f2c84_3074_d9f3_cf2a_3c3718897639 -->|calls| c312f8db_dbba_3214_8e81_013a94f3f3ca
  f135ea13_1496_d12c_baa5_7d8c5094e579["assertExtractedLayers()"]
  ac7f2c84_3074_d9f3_cf2a_3c3718897639 -->|calls| f135ea13_1496_d12c_baa5_7d8c5094e579
  style ac7f2c84_3074_d9f3_cf2a_3c3718897639 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

build-plugin/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/AbstractBootArchiveIntegrationTests.java lines 384–434

	@TestTemplate
	void multiModuleImplicitLayers() throws IOException {
		writeSettingsGradle();
		writeMainClass();
		writeResource();
		BuildTask task = this.gradleBuild.build(this.taskName).task(":" + this.taskName);
		assertThat(task).isNotNull();
		assertThat(task.getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
		Map<String, List<String>> indexedLayers;
		String toolsJar = this.libPath + JarModeLibrary.TOOLS.getName();
		try (JarFile jarFile = new JarFile(new File(this.gradleBuild.getProjectDir(), "build/libs").listFiles()[0])) {
			assertThat(jarFile.getEntry(toolsJar)).isNotNull();
			assertThat(jarFile.getEntry(this.libPath + "alpha-1.2.3.jar")).isNotNull();
			assertThat(jarFile.getEntry(this.libPath + "bravo-1.2.3.jar")).isNotNull();
			assertThat(jarFile.getEntry(this.libPath + "charlie-1.2.3.jar")).isNotNull();
			assertThat(jarFile.getEntry(this.libPath + "commons-lang3-3.9.jar")).isNotNull();
			assertThat(jarFile.getEntry(this.libPath + "spring-core-5.2.5.RELEASE.jar")).isNotNull();
			assertThat(jarFile.getEntry(this.libPath + "spring-jcl-5.2.5.RELEASE.jar")).isNotNull();
			assertThat(jarFile.getEntry(this.libPath + "library-1.0-SNAPSHOT.jar")).isNotNull();
			assertThat(jarFile.getEntry(this.classesPath + "example/Main.class")).isNotNull();
			assertThat(jarFile.getEntry(this.classesPath + "static/file.txt")).isNotNull();
			indexedLayers = readLayerIndex(jarFile);
		}
		List<String> layerNames = Arrays.asList("dependencies", "spring-boot-loader", "snapshot-dependencies",
				"application");
		assertThat(indexedLayers.keySet()).containsExactlyElementsOf(layerNames);
		Set<String> expectedDependencies = new TreeSet<>();
		expectedDependencies.add(this.libPath + "commons-lang3-3.9.jar");
		expectedDependencies.add(this.libPath + "spring-core-5.2.5.RELEASE.jar");
		expectedDependencies.add(this.libPath + "spring-jcl-5.2.5.RELEASE.jar");
		Set<String> expectedSnapshotDependencies = new TreeSet<>();
		expectedSnapshotDependencies.add(this.libPath + "library-1.0-SNAPSHOT.jar");
		(toolsJar.contains("SNAPSHOT") ? expectedSnapshotDependencies : expectedDependencies).add(toolsJar);
		assertThat(indexedLayers.get("dependencies")).containsExactlyElementsOf(expectedDependencies);
		assertThat(indexedLayers.get("spring-boot-loader")).containsExactly("org/");
		assertThat(indexedLayers.get("snapshot-dependencies")).containsExactlyElementsOf(expectedSnapshotDependencies);
		assertThat(indexedLayers.get("application"))
			.containsExactly(getExpectedApplicationLayerContents(this.classesPath, this.libPath + "alpha-1.2.3.jar",
					this.libPath + "bravo-1.2.3.jar", this.libPath + "charlie-1.2.3.jar"));
		BuildResult listLayers = this.gradleBuild.build("listLayers");
		task = listLayers.task(":listLayers");
		assertThat(task).isNotNull();
		assertThat(task.getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
		String listLayersOutput = listLayers.getOutput();
		assertThat(new BufferedReader(new StringReader(listLayersOutput)).lines()).containsSequence(layerNames);
		BuildResult extractLayers = this.gradleBuild.build("extractLayers");
		task = extractLayers.task(":extractLayers");
		assertThat(task).isNotNull();
		assertThat(task.getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
		assertExtractedLayers(layerNames, indexedLayers);
	}

Domain

Subdomains

Frequently Asked Questions

What does multiModuleImplicitLayers() do?
multiModuleImplicitLayers() is a function in the spring-boot codebase.
What does multiModuleImplicitLayers() call?
multiModuleImplicitLayers() calls 6 function(s): assertExtractedLayers, getExpectedApplicationLayerContents, readLayerIndex, writeMainClass, writeResource, writeSettingsGradle.

Analyze Your Own Codebase

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

Try Supermodel Free